Skip to contentSkip to conversation

arch_topology: Remove early cacheinfo error message if -ENOENT

PATCH Superseded Florian Fainelli 1 participant 1 message May 30, 2023 Stable branch

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch_topology: Remove early cacheinfo error message if -ENOENT

From: Pierre Gondois <[email protected]>

fetch_cache_info() tries to get the number of cache leaves/levels for each CPU in order to pre-allocate memory for cacheinfo struct. Allocating this memory later triggers a:
'BUG: sleeping function called from invalid context'
in PREEMPT_RT kernels.

If there is no cache related information available in DT or ACPI, fetch_cache_info() fails and an error message is printed:
'Early cacheinfo failed, ret = ...'

Not having cache information should be a valid configuration. Remove the error message if fetch_cache_info() fails with -ENOENT.

---
 drivers/base/arch_topology.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/base/arch_topology.c +4 -3
index 147fb7d4af96..b741b5ba82bd 100644
@@ -843,10 +843,11 @@ void __init init_cpu_topology(void)
 
 	for_each_possible_cpu(cpu) {
 		ret = fetch_cache_info(cpu);
-		if (ret) {
+		if (!ret)
+			continue;
+		else if (ret != -ENOENT)
 			pr_err("Early cacheinfo failed, ret = %d\n", ret);
-			break;
-		}
+		return;
 	}
 }
 
Signature · 1 line
2.25.1