From: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] powerpc/eeh: Disable EEH stack dump by default
Date: Tue, 19 Sep 2017 11:25:39 -0300 [thread overview]
Message-ID: <1505831139-6053-1-git-send-email-joserz@linux.vnet.ibm.com> (raw)
Today, each EEH causes a stack dump to be printed in the logs. In
production environment it's not quite necessary. Thus, this patch
adds a new command line argument in order to enable the stack
dump for debugging purposes.
For example, instead of the following:
[ 131.778661] EEH: Frozen PHB#2-PE#fd detected
[ 131.778672] EEH: PE location: N/A, PHB location: N/A
[ 131.778677] CPU: 21 PID: 10098 Comm: lspci Not tainted ...
[ 131.778680] Call Trace:
[ 131.778686] [c0000003a140bab0] [c000000000beb58c] dump_stack+...
<snip ~10 lines>
[ 131.778770] EEH: Detected PCI bus error on PHB#2-PE#fd
[ 131.778775] EEH: This PCI device has failed 1 times in the last hour
...
we will have this by default:
[12777.175880] EEH: Frozen PHB#2-PE#fd detected
[12777.175893] EEH: PE location: N/A, PHB location: N/A
[12777.175922] EEH: Detected PCI bus error on PHB#2-PE#fd
[12777.175931] EEH: This PCI device has failed 2 times in the last hour
...
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
---
arch/powerpc/kernel/eeh.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 9e81678..4336c3b1 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -157,6 +157,19 @@ static int __init eeh_setup(char *str)
__setup("eeh=", eeh_setup);
/*
+ * It's not necessary to dump the stack trace when an EEH occours
+ * in the production environment. For debugging, the command line
+ * option "enable_eeh_stacktrace" brings the stack dump back
+ */
+static bool eeh_show_stacktrace;
+static int __init enable_eeh_stacktrace(char *p)
+{
+ eeh_show_stacktrace = true;
+ return 0;
+}
+early_param("enable_eeh_stacktrace", enable_eeh_stacktrace);
+
+/*
* This routine captures assorted PCI configuration space data
* for the indicated PCI device, and puts them into a buffer
* for RTAS error logging.
@@ -407,7 +420,10 @@ static int eeh_phb_check_failure(struct eeh_pe *pe)
pr_err("EEH: PHB#%x failure detected, location: %s\n",
phb_pe->phb->global_number, eeh_pe_loc_get(phb_pe));
- dump_stack();
+
+ if (eeh_show_stacktrace)
+ dump_stack();
+
eeh_send_failure_event(phb_pe);
return 1;
@@ -504,7 +520,9 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
eeh_driver_name(dev), eeh_pci_name(dev));
printk(KERN_ERR "EEH: Might be infinite loop in %s driver\n",
eeh_driver_name(dev));
- dump_stack();
+
+ if (eeh_show_stacktrace)
+ dump_stack();
}
goto dn_unlock;
}
@@ -572,7 +590,9 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
pe->phb->global_number, pe->addr);
pr_err("EEH: PE location: %s, PHB location: %s\n",
eeh_pe_loc_get(pe), eeh_pe_loc_get(phb_pe));
- dump_stack();
+
+ if (eeh_show_stacktrace)
+ dump_stack();
eeh_send_failure_event(pe);
--
2.7.4
next reply other threads:[~2017-09-19 14:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 14:25 Jose Ricardo Ziviani [this message]
2017-09-20 4:47 ` [PATCH] powerpc/eeh: Disable EEH stack dump by default Michael Ellerman
2017-09-20 17:55 ` joserz
2017-09-20 5:54 ` Andrew Donnellan
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=1505831139-6053-1-git-send-email-joserz@linux.vnet.ibm.com \
--to=joserz@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/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).