Skip to content

Commit 1b3da8f

Browse files
nathanlynchmpe
authored andcommitted
powerpc/cacheinfo: Improve diagnostics about malformed cache lists
If we have a bug which causes us to start with the wrong kind of OF node when linking up the cache tree, it's helpful for debugging to print information about what we found vs what we expected. So replace uses of WARN_ON_ONCE with WARN_ONCE, which lets us include an informative message instead of a contentless backtrace. Signed-off-by: Nathan Lynch <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent be6f885 commit 1b3da8f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arch/powerpc/kernel/cacheinfo.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,14 @@ static void link_cache_lists(struct cache *smaller, struct cache *bigger)
424424

425425
static void do_subsidiary_caches_debugcheck(struct cache *cache)
426426
{
427-
WARN_ON_ONCE(cache->level != 1);
428-
WARN_ON_ONCE(!of_node_is_type(cache->ofnode, "cpu"));
427+
WARN_ONCE(cache->level != 1,
428+
"instantiating cache chain from L%d %s cache for "
429+
"%pOFP instead of an L1\n", cache->level,
430+
cache_type_string(cache), cache->ofnode);
431+
WARN_ONCE(!of_node_is_type(cache->ofnode, "cpu"),
432+
"instantiating cache chain from node %pOFP of type '%s' "
433+
"instead of a cpu node\n", cache->ofnode,
434+
of_node_get_device_type(cache->ofnode));
429435
}
430436

431437
static void do_subsidiary_caches(struct cache *cache)

0 commit comments

Comments
 (0)