We print the respective warning after parsing EPOW interrupts,
prompting user to take action depending upon the severity of the
event.

Some times same EPOW event warning, such as below could flood kernel
log, within very short duration. So Limit the message by using
ratelimit variant of pr_err.

May 25 03:46:34 alp kernel: Non critical power or cooling issue cleared
May 25 03:46:52 alp kernel: Non critical power or cooling issue cleared
May 25 03:53:48 alp kernel: Non critical power or cooling issue cleared
May 25 03:55:46 alp kernel: Non critical power or cooling issue cleared
May 25 03:56:34 alp kernel: Non critical power or cooling issue cleared
May 25 03:59:04 alp kernel: Non critical power or cooling issue cleared
May 25 04:02:01 alp kernel: Non critical power or cooling issue cleared
May 25 04:04:24 alp kernel: Non critical power or cooling issue cleared
May 25 04:07:18 alp kernel: Non critical power or cooling issue cleared
May 25 04:13:04 alp kernel: Non critical power or cooling issue cleared
May 25 04:22:04 alp kernel: Non critical power or cooling issue cleared
May 25 04:22:26 alp kernel: Non critical power or cooling issue cleared
May 25 04:22:36 alp kernel: Non critical power or cooling issue cleared

Signed-off-by: Kamalesh Babulal <kamal...@linux.vnet.ibm.com>
Cc: Anshuman Khandual <khand...@linux.vnet.ibm.com>
Cc: Anton Blanchard <an...@samba.org>
Cc: Michael Ellerman <m...@ellerman.id.au>
---
 arch/powerpc/platforms/pseries/ras.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/ras.c 
b/arch/powerpc/platforms/pseries/ras.c
index 02e4a17..2556bc2 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -145,17 +145,17 @@ static void rtas_parse_epow_errlog(struct rtas_error_log 
*log)
 
        switch (action_code) {
        case EPOW_RESET:
-               pr_err("Non critical power or cooling issue cleared");
+               pr_err_ratelimited("Non critical power or cooling issue 
cleared");
                break;
 
        case EPOW_WARN_COOLING:
-               pr_err("Non critical cooling issue reported by firmware");
-               pr_err("Check RTAS error log for details");
+               pr_err_ratelimited("Non critical cooling issue reported by 
firmware");
+               pr_err_ratelimited("Check RTAS error log for details");
                break;
 
        case EPOW_WARN_POWER:
-               pr_err("Non critical power issue reported by firmware");
-               pr_err("Check RTAS error log for details");
+               pr_err_ratelimited("Non critical power issue reported by 
firmware");
+               pr_err_ratelimited("Check RTAS error log for details");
                break;
 
        case EPOW_SYSTEM_SHUTDOWN:
@@ -177,7 +177,7 @@ static void rtas_parse_epow_errlog(struct rtas_error_log 
*log)
                break;
 
        default:
-               pr_err("Unknown power/cooling event (action code %d)",
+               pr_err_ratelimited("Unknown power/cooling event (action code 
%d)",
                        action_code);
        }
 }
-- 
2.1.2

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to