linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <bjking1@us.ibm.com>
To: Linas Vepstas <linas@austin.ibm.com>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc export rtas_set_slot_reset()
Date: Tue, 19 Dec 2006 16:08:21 -0600	[thread overview]
Message-ID: <458862D5.6070409@us.ibm.com> (raw)
In-Reply-To: <20061219190210.GE5506@austin.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

Linas Vepstas wrote:
> Hi Paul,
> A patch that provides an export for a bug being worked on the
> IPR evice driver.

This is not the API that I tested with... Here is the patch I
was using in my test. This is not ready to apply as we are
still working issues with various hardware...

Brian


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: powerpc_slot_reset_api.patch --]
[-- Type: text/x-patch; name="powerpc_slot_reset_api.patch", Size: 2627 bytes --]


The following patch adds a generic API to assert and deassert
PCI reset to a device on a pSeries machine. This is needed to
solve an issue with a new ipr PCI-E adapter which causes EEH
errors when running BIST. The only way to reset this adapter
without causing an EEH error is to use PCI reset.

Signed-off-by: Brian King <brking@us.ibm.com>
---

 linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c |   42 +++++++++++++++++
 linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h        |    3 +
 2 files changed, 45 insertions(+)

diff -puN arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api arch/powerpc/platforms/pseries/eeh.c
--- linux-2.6/arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api	2006-12-18 15:58:56.000000000 -0600
+++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c	2006-12-18 15:58:57.000000000 -0600
@@ -591,6 +591,48 @@ static void __rtas_set_slot_reset(struct
 	msleep (PCI_BUS_SETTLE_TIME_MSEC);
 }
 
+/**
+ * pci_set_slot_reset - Assert PCI reset to the PCI slot
+ * @dev:	pci device struct
+ *
+ * After asserting PCI reset, the caller should wait for
+ * 100 milliseconds or longer.
+ *
+ * Return value:
+ * 	0 if success
+ **/
+int pci_set_slot_reset(struct pci_dev *dev)
+{
+	struct device_node *dn = pci_device_to_OF_node(dev);
+	struct pci_dn *pdn = PCI_DN(dn);
+
+	rtas_pci_slot_reset(pdn, 1);
+	return 0;
+}
+EXPORT_SYMBOL_GPL(pci_set_slot_reset);
+
+/**
+ * pci_clear_slot_reset - Clear PCI reset to the PCI slot
+ * @dev:	pci device struct
+ *
+ * After clearing PCI reset, the caller should wait 1.8 seconds
+ * or longer for the bus to stabilize and the device to come
+ * ready.
+ *
+ * Return value:
+ * 	0 if success
+ **/
+int pci_clear_slot_reset(struct pci_dev *dev)
+{
+	struct device_node *dn = pci_device_to_OF_node(dev);
+	struct pci_dn *pdn = PCI_DN(dn);
+
+	eeh_clear_slot (pdn->node, EEH_MODE_ISOLATED);
+	rtas_pci_slot_reset (pdn, 0);
+	return 0;
+}
+EXPORT_SYMBOL_GPL(pci_clear_slot_reset);
+
 int rtas_set_slot_reset(struct pci_dn *pdn)
 {
 	int i, rc;
diff -puN include/asm-powerpc/ppc-pci.h~powerpc_slot_reset_api include/asm-powerpc/ppc-pci.h
--- linux-2.6/include/asm-powerpc/ppc-pci.h~powerpc_slot_reset_api	2006-12-18 15:58:56.000000000 -0600
+++ linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h	2006-12-18 15:58:57.000000000 -0600
@@ -124,6 +124,9 @@ void eeh_clear_slot (struct device_node 
 /* Find the associated "Partiationable Endpoint" PE */
 struct device_node * find_device_pe(struct device_node *dn);
 
+int pci_set_slot_reset(struct pci_dev *dev);
+int pci_clear_slot_reset(struct pci_dev *dev);
+
 #endif
 
 #endif /* __KERNEL__ */
_

  reply	other threads:[~2006-12-19 22:08 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-19  6:23 Bug fixes for 2.6.20 Paul Mackerras
2006-12-19  9:54 ` [PATCH] Probe Efika platform before CHRP David Woodhouse
2006-12-19 11:39   ` Benjamin Herrenschmidt
2006-12-19 11:55     ` Sylvain Munaut
2006-12-19 14:29       ` David Woodhouse
2006-12-19 15:46         ` Grant Likely
2006-12-19 19:58         ` Benjamin Herrenschmidt
2006-12-19 22:33           ` Sylvain Munaut
2007-01-02 21:29           ` David Woodhouse
2007-01-02 21:37             ` Benjamin Herrenschmidt
2007-01-02 22:04               ` David Woodhouse
2007-01-02 23:04                 ` Grant Likely
     [not found]                   ` <45A01416.6080401@genesi-usa.com>
2007-01-06 22:23                     ` Grant Likely
2007-01-06 23:13                       ` David Woodhouse
2007-01-06 23:37                         ` Grant Likely
2007-01-07  2:55                       ` Sylvain Munaut
2007-01-07  9:11                         ` Raquel Velasco and Bill Buck
2007-03-31 13:15                           ` David Woodhouse
2007-03-31 13:18                             ` Raquel Velasco and Bill Buck
2007-03-31 13:21                               ` David Woodhouse
2007-05-09 11:42                               ` Olaf Hering
2007-05-09 11:45                                 ` Raquel Velasco and Bill Buck
2007-01-07 20:09                       ` Matt Sealey
2007-01-07 20:24                         ` Segher Boessenkool
2007-01-07 22:10                           ` Matt Sealey
2007-01-07 22:35                             ` Benjamin Herrenschmidt
2007-01-07 22:35                             ` Sylvain Munaut
2007-01-07 23:04                               ` Segher Boessenkool
2007-01-07 23:07                               ` Matt Sealey
2007-01-07 23:38                                 ` Sylvain Munaut
2007-01-08  0:37                                 ` Benjamin Herrenschmidt
2007-01-07 22:32                           ` Matt Sealey
2007-01-07 22:39                           ` Matt Sealey
2007-01-07 23:27                             ` Segher Boessenkool
2007-01-07 21:16                         ` Benjamin Herrenschmidt
2007-01-08  2:17                         ` David Woodhouse
2007-01-08  9:18                           ` Matt Sealey
2007-01-08 12:52                             ` Sylvain Munaut
2007-01-08 13:16                               ` Sylvain Munaut
2007-01-08 17:25                                 ` Matt Sealey
2007-01-08 15:44                               ` Sylvain Munaut
2007-01-08 17:25                                 ` Matt Sealey
2007-01-08 17:24                               ` Matt Sealey
2007-01-08 17:59                                 ` Sylvain Munaut
2006-12-19 19:02 ` [PATCH] powerpc export rtas_set_slot_reset() Linas Vepstas
2006-12-19 22:08   ` Brian King [this message]
2006-12-19 19:06 ` [PATCH] powerpc fixup error message Linas Vepstas
2006-12-19 20:00 ` [PATCH] powerpc initialize pci device channel state Linas Vepstas

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=458862D5.6070409@us.ibm.com \
    --to=bjking1@us.ibm.com \
    --cc=linas@austin.ibm.com \
    --cc=linuxppc-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;
as well as URLs for NNTP newsgroup(s).