From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: vipin@linux.vnet.ibm.com,
Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>,
Anshuman Khandual <khandual@linux.vnet.ibm.com>,
Anton Blanchard <anton@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>
Subject: [PATCH v3] powerpc/pseries: Limit EPOW reset event warnings
Date: Tue, 14 Jul 2015 20:39:24 +0530 [thread overview]
Message-ID: <1436886564-3373-1-git-send-email-kamalesh@linux.vnet.ibm.com> (raw)
We print the respective warning after parsing EPOW interrupts,
prompting user to take action depending upon the severity of the
event.
Some times EPOW rest event warning, such as below could flood
kernel log, over a period of time. Limit these warnings by use of
epow_state flag, which is initialized to false and when any event
gets reported, the flag set to true once an event gets acknowledged
by a reset.
The reset action is guarded by bool flag (set only if there was event
reported previously) and ignore multiple resets, without real EPOW
event. Also, merge adjacent pr_err/pr_emerg into single one to reduce
the number of lines printed per warning.
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
Suggested-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
---
v3 Changes:
- Limit warning printed by EPOW RESET event, by guarding it with bool flag.
Instead of rate limiting all the EPOW events.
v2 Changes:
- Merged multiple adjacent pr_err/pr_emerg into single line to reduce multi-line
warnings, based on Michael's comments.
arch/powerpc/platforms/pseries/ras.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 02e4a17..b30396a 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -40,6 +40,9 @@ static int ras_check_exception_token;
#define EPOW_SENSOR_TOKEN 9
#define EPOW_SENSOR_INDEX 0
+/* Flag to limit EPOW RESET warning. */
+static bool epow_state;
+
static irqreturn_t ras_epow_interrupt(int irq, void *dev_id);
static irqreturn_t ras_error_interrupt(int irq, void *dev_id);
@@ -145,21 +148,27 @@ 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");
+ if (epow_state) {
+ pr_err("Non critical power or cooling issue cleared");
+ epow_state = false;
+ }
break;
case EPOW_WARN_COOLING:
- pr_err("Non critical cooling issue reported by firmware");
- pr_err("Check RTAS error log for details");
+ pr_err("Non critical cooling issue reported by firmware, "
+ "Check RTAS error log for details");
+ epow_state = true;
break;
case EPOW_WARN_POWER:
- pr_err("Non critical power issue reported by firmware");
- pr_err("Check RTAS error log for details");
+ pr_err("Non critical power issue reported by firmware, "
+ "Check RTAS error log for details");
+ epow_state = true;
break;
case EPOW_SYSTEM_SHUTDOWN:
handle_system_shutdown(epow_log->event_modifier);
+ epow_state = true;
break;
case EPOW_SYSTEM_HALT:
@@ -169,9 +178,8 @@ static void rtas_parse_epow_errlog(struct rtas_error_log *log)
case EPOW_MAIN_ENCLOSURE:
case EPOW_POWER_OFF:
- pr_emerg("Critical power/cooling issue reported by firmware");
- pr_emerg("Check RTAS error log for details");
- pr_emerg("Immediate power off");
+ pr_emerg("Critical power/cooling issue reported by firmware, "
+ "Check RTAS error log for details. Immediate power off.");
emergency_sync();
kernel_power_off();
break;
@@ -179,6 +187,7 @@ static void rtas_parse_epow_errlog(struct rtas_error_log *log)
default:
pr_err("Unknown power/cooling event (action code %d)",
action_code);
+ epow_state = true;
}
}
--
2.1.2
next reply other threads:[~2015-07-14 15:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-14 15:09 Kamalesh Babulal [this message]
2015-07-14 18:01 ` [PATCH v3] powerpc/pseries: Limit EPOW reset event warnings Vipin K Parashar
2015-07-15 4:22 ` [RESEND PATCH " Kamalesh Babulal
2015-07-15 7:01 ` Vipin K Parashar
2015-07-16 4:05 ` [RESEND,v3] " Michael Ellerman
2015-07-17 8:17 ` Kamalesh Babulal
2015-09-07 21:40 ` Vipin K Parashar
2015-09-10 17:17 ` Vipin K Parashar
2015-07-17 9:51 ` Vipin K Parashar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436886564-3373-1-git-send-email-kamalesh@linux.vnet.ibm.com \
--to=kamalesh@linux.vnet.ibm.com \
--cc=anton@samba.org \
--cc=khandual@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=vipin@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).