* Re: [PATCH 1/1] powerpc: Export PCI slot reset API
@ 2007-01-26 2:49 Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2007-01-26 2:49 UTC (permalink / raw)
To: Brian King; +Cc: linuxppc-dev, paulus
On Fri, Jan 12, 2007 at 02:49:32PM -0600, Brian King wrote:
>
> Adds two new APIs to assert/deassert PCI reset to a given
> device. This is needed for an ipr PCI-E adapter which does not
> properly implement either BIST nor PCI-E hot reset, requiring
> a PCI-E warm reset, which is what this implements.
Having this exported only on a single platform is wrong. Any API
for PCI drivers should be implemented on all platforms, even if
some of it have it stubbed out.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] powerpc: Export PCI slot reset API
@ 2007-01-24 22:03 Brian King
0 siblings, 0 replies; 4+ messages in thread
From: Brian King @ 2007-01-24 22:03 UTC (permalink / raw)
To: paulus; +Cc: brking, linuxppc-dev, brazilnut
Adds two new APIs to assert/deassert PCI reset to a given
device. This is needed for an ipr PCI-E adapter which does not
properly implement either BIST nor PCI-E hot reset, requiring
a PCI-E warm reset, which is what this implements.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c | 41 +++++++++++++++++
linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h | 3 +
2 files changed, 44 insertions(+)
diff -puN arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api2 arch/powerpc/platforms/pseries/eeh.c
--- linux-2.6/arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api2 2007-01-11 15:52:57.000000000 -0600
+++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c 2007-01-11 15:52:57.000000000 -0600
@@ -591,6 +591,47 @@ 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, 3);
+ 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);
+
+ 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_api2 include/asm-powerpc/ppc-pci.h
--- linux-2.6/include/asm-powerpc/ppc-pci.h~powerpc_slot_reset_api2 2007-01-11 15:52:57.000000000 -0600
+++ linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h 2007-01-11 15:52: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__ */
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] powerpc: Export PCI slot reset API
2007-01-12 20:49 Brian King
@ 2007-01-23 23:28 ` Brian King
0 siblings, 0 replies; 4+ messages in thread
From: Brian King @ 2007-01-23 23:28 UTC (permalink / raw)
To: Brian King; +Cc: paulus, linas, linuxppc-dev
Any comments on this?
Thanks,
Brian
Brian King wrote:
> Adds two new APIs to assert/deassert PCI reset to a given
> device. This is needed for an ipr PCI-E adapter which does not
> properly implement either BIST nor PCI-E hot reset, requiring
> a PCI-E warm reset, which is what this implements.
>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
>
> linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c | 41 +++++++++++++++++
> linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h | 3 +
> 2 files changed, 44 insertions(+)
>
> diff -puN arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api2 arch/powerpc/platforms/pseries/eeh.c
> --- linux-2.6/arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api2 2007-01-11 15:52:57.000000000 -0600
> +++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c 2007-01-11 15:52:57.000000000 -0600
> @@ -591,6 +591,47 @@ 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, 3);
> + 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);
> +
> + 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_api2 include/asm-powerpc/ppc-pci.h
> --- linux-2.6/include/asm-powerpc/ppc-pci.h~powerpc_slot_reset_api2 2007-01-11 15:52:57.000000000 -0600
> +++ linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h 2007-01-11 15:52: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__ */
> _
--
Brian King
eServer Storage I/O
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] powerpc: Export PCI slot reset API
@ 2007-01-12 20:49 Brian King
2007-01-23 23:28 ` Brian King
0 siblings, 1 reply; 4+ messages in thread
From: Brian King @ 2007-01-12 20:49 UTC (permalink / raw)
To: paulus; +Cc: brking, linuxppc-dev
Adds two new APIs to assert/deassert PCI reset to a given
device. This is needed for an ipr PCI-E adapter which does not
properly implement either BIST nor PCI-E hot reset, requiring
a PCI-E warm reset, which is what this implements.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c | 41 +++++++++++++++++
linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h | 3 +
2 files changed, 44 insertions(+)
diff -puN arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api2 arch/powerpc/platforms/pseries/eeh.c
--- linux-2.6/arch/powerpc/platforms/pseries/eeh.c~powerpc_slot_reset_api2 2007-01-11 15:52:57.000000000 -0600
+++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/eeh.c 2007-01-11 15:52:57.000000000 -0600
@@ -591,6 +591,47 @@ 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, 3);
+ 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);
+
+ 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_api2 include/asm-powerpc/ppc-pci.h
--- linux-2.6/include/asm-powerpc/ppc-pci.h~powerpc_slot_reset_api2 2007-01-11 15:52:57.000000000 -0600
+++ linux-2.6-bjking1/include/asm-powerpc/ppc-pci.h 2007-01-11 15:52: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__ */
_
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-01-26 2:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-26 2:49 [PATCH 1/1] powerpc: Export PCI slot reset API Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2007-01-24 22:03 Brian King
2007-01-12 20:49 Brian King
2007-01-23 23:28 ` Brian King
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.