diff options
author | Joel Stanley <joel@jms.id.au> | 2019-08-01 14:46:30 +0930 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-09-08 22:57:11 +1000 |
commit | 8f55984f530d7275531e17f36ea29229c2c410dd (patch) | |
tree | 247eaa4c7df507255b8acfebce5805affb9f4741 | |
parent | 8c0d51592f6f0123953633d1ecf21e843fce0bfd (diff) | |
download | linux-stable-8f55984f530d7275531e17f36ea29229c2c410dd.tar.gz linux-stable-8f55984f530d7275531e17f36ea29229c2c410dd.tar.bz2 linux-stable-8f55984f530d7275531e17f36ea29229c2c410dd.zip |
powerpc/powernv: Print helpful message when cores guarded
Often the firmware will guard out cores after a crash. This often
undesirable, and is not immediately noticeable.
This adds an informative message when a CPU device tree nodes are
marked bad in the device tree.
Signed-off-by: Joel Stanley <joel@jms.id.au>
[mpe: Use an eye-catcher that's less likely to get us in trouble]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190801051630.5804-1-joel@jms.id.au
-rw-r--r-- | arch/powerpc/platforms/powernv/setup.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 7fcb88623081..9acaa0f131b9 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -130,6 +130,28 @@ static void pnv_setup_rfi_flush(void) setup_count_cache_flush(); } +static void __init pnv_check_guarded_cores(void) +{ + struct device_node *dn; + int bad_count = 0; + + for_each_node_by_type(dn, "cpu") { + if (of_property_match_string(dn, "status", "bad") >= 0) + bad_count++; + }; + + if (bad_count) { + printk(" _ _______________\n"); + pr_cont(" | | / \\\n"); + pr_cont(" | | | WARNING! |\n"); + pr_cont(" | | | |\n"); + pr_cont(" | | | It looks like |\n"); + pr_cont(" |_| | you have %*d |\n", 3, bad_count); + pr_cont(" _ | guarded cores |\n"); + pr_cont(" (_) \\_______________/\n"); + } +} + static void __init pnv_setup_arch(void) { set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); @@ -150,6 +172,8 @@ static void __init pnv_setup_arch(void) /* Enable NAP mode */ powersave_nap = 1; + pnv_check_guarded_cores(); + /* XXX PMCS */ } |