mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linas <linas@austin.ibm.com>
To: paulus@samba.org
Cc: linuxppc64-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] ppc64: EEH handle empty PCI slot failure
Date: Thu, 29 Sep 2005 19:58:27 -0500	[thread overview]
Message-ID: <20050930005827.GE6173@austin.ibm.com> (raw)
In-Reply-To: <20050930004800.GL29826@austin.ibm.com>



05-eeh-empty-slot-error.patch

Performing PCI config-space reads to empty PCI slots can lead to reports of 
"permanent failure" from the firmware. Ignore permanent failures on empty slots.

Signed-off-by: Linas Vepstas <linas@linas.org>

Index: linux-2.6.14-rc2-git6/arch/ppc64/kernel/eeh.c
===================================================================
--- linux-2.6.14-rc2-git6.orig/arch/ppc64/kernel/eeh.c	2005-09-29 16:06:25.583986100 -0500
+++ linux-2.6.14-rc2-git6/arch/ppc64/kernel/eeh.c	2005-09-29 16:06:33.567867154 -0500
@@ -617,7 +617,32 @@
 	 * In any case they must share a common PHB.
 	 */
 	ret = read_slot_reset_state(pdn, rets);
-	if (!(ret == 0 && rets[1] == 1 && (rets[0] == 2 || rets[0] == 4))) {
+
+	/* If the call to firmware failed, punt */
+	if (ret != 0) {
+		printk(KERN_WARNING "EEH: read_slot_reset_state() failed; rc=%d dn=%s\n",
+		       ret, dn->full_name);
+		__get_cpu_var(false_positives)++;
+		return 0;
+	}
+
+	/* If EEH is not supported on this device, punt. */
+	if (rets[1] != 1) {
+		printk(KERN_WARNING "EEH: event on unsupported device, rc=%d dn=%s\n",
+		       ret, dn->full_name);
+		__get_cpu_var(false_positives)++;
+		return 0;
+	}
+
+	/* If not the kind of error we know about, punt. */
+	if (rets[0] != 2 && rets[0] != 4 && rets[0] != 5) {
+		__get_cpu_var(false_positives)++;
+		return 0;
+	}
+
+	/* Note that config-io to empty slots may fail;
+	 * we recognize empty because they don't have children. */
+	if ((rets[0] == 5) && (dn->child == NULL)) {
 		__get_cpu_var(false_positives)++;
 		return 0;
 	}
@@ -650,7 +675,7 @@
 	/* Most EEH events are due to device driver bugs.  Having
 	 * a stack trace will help the device-driver authors figure
 	 * out what happened.  So print that out. */
-	dump_stack();
+	if (rets[0] != 5) dump_stack();
 	schedule_work(&eeh_event_wq);
 
 	return 0;

  parent reply	other threads:[~2005-09-30  0:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-30  0:48 [PATCH 0/7] ppc64: Assorted minor EEH cleanups linas
2005-09-30  0:51 ` [PATCH 1/7] ppc64: EEH typos, include files, macros, whitespace linas
2005-10-05 11:11   ` Paul Mackerras
2005-10-07 19:46     ` linas
2005-09-30  0:53 ` [PATCH 2/7] ppc64: EEH PCI address cache cleanups linas
2005-09-30  0:54 ` [PATCH 3/7] ppc64: EEH Add event/internal state statistics linas
2005-10-05 11:14   ` Paul Mackerras
2005-10-07 14:59     ` linas
2005-09-30  0:56 ` [PATCH 4/7] ppc64: EEH PCI slot error details abstraction linas
2005-09-30  0:58 ` linas [this message]
2005-09-30  1:00 ` [PATCH 6/7] ppc64: EEH Avoid racing reports of errors linas
2005-10-05 11:23   ` Paul Mackerras
2005-10-07 15:23     ` linas
2005-09-30  1:02 ` [PATCH 7/7] ppc64: EEH Halt if bad drivers spin in error condition linas
2005-09-30  4:49   ` Doug Maxey
2005-09-30 14:58     ` linas
2005-09-30 22:29 ` [PATCH 0/7] ppc64: Assorted minor EEH cleanups linas

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=20050930005827.GE6173@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=paulus@samba.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

Powered by JetHome