linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Richard A Lary <rlary@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: antonb@au1.ibm.com
Subject: [PATCH 2/3] powerpc/eeh: Handle functional reset on non-PCIe device
Date: Fri, 22 Apr 2011 13:00:05 -0700	[thread overview]
Message-ID: <4DB1DE45.1070608@linux.vnet.ibm.com> (raw)

From: Richard A Lary <rlary@linux.vnet.ibm.com>

  Fundamental reset is an optional reset type supported only by PCIe adapters.
  Handle the unexpected case where a non-PCIe device has requested a
  fundamental reset. Try hot-reset as a fallback to handle this case.

Signed-off-by: Richard A Lary <rlary@linux.vnet.ibm.com>
---
  arch/powerpc/platforms/pseries/eeh.c |   21 	16 +	5 -	0 !
  1 file changed, 16 insertions(+), 5 deletions(-)

Index: b/arch/powerpc/platforms/pseries/eeh.c
===================================================================
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -725,15 +725,26 @@ rtas_pci_slot_reset(struct pci_dn *pdn,
  	if (pdn->eeh_pe_config_addr)
  		config_addr = pdn->eeh_pe_config_addr;

-	rc = rtas_call(ibm_set_slot_reset,4,1, NULL,
+	rc = rtas_call(ibm_set_slot_reset, 4, 1, NULL,
  	               config_addr,
  	               BUID_HI(pdn->phb->buid),
  	               BUID_LO(pdn->phb->buid),
  	               state);
-	if (rc)
-		printk (KERN_WARNING "EEH: Unable to reset the failed slot,"
-		        " (%d) #RST=%d dn=%s\n",
-		        rc, state, pdn->node->full_name);
+
+	/* Fundamental-reset not supported on this PE, try hot-reset */
+	if (rc == -8 && state == 3) {
+		state = 1;
+		rc = rtas_call(ibm_set_slot_reset, 4, 1, NULL,
+			       config_addr,
+			       BUID_HI(pdn->phb->buid),
+			       BUID_LO(pdn->phb->buid),
+			       state);
+		if (rc)
+			printk(KERN_WARNING
+				"EEH: Unable to reset the failed slot,"
+				" (%d) #RST=%d dn=%s\n",
+				rc, state, pdn->node->full_name);
+	}
  }

  /**

                 reply	other threads:[~2011-04-22 20:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4DB1DE45.1070608@linux.vnet.ibm.com \
    --to=rlary@linux.vnet.ibm.com \
    --cc=antonb@au1.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).