Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7bdd12d234d9064bd0aa1b5610508959120a9b4
Commit:     f7bdd12d234d9064bd0aa1b5610508959120a9b4
Parent:     988cbb15e00e6f924d052874b40c6a5447f9fdd7
Author:     Brian King <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 6 16:39:36 2007 -0500
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed May 2 19:02:34 2007 -0700

    pci: New PCI-E reset API
    
    Adds a new API which can be used to issue various types
    of PCI-E reset, including PCI-E warm reset and PCI-E hot reset.
    This is needed for an ipr PCI-E adapter which does not properly
    implement BIST. Running BIST on this adapter results in PCI-E
    errors. The only reliable reset mechanism that exists on this
    hardware is PCI Fundamental reset (warm reset). Since driving
    this type of reset is architecture unique, this provides the
    necessary hooks for architectures to add this support.
    
    Signed-off-by: Brian King <[EMAIL PROTECTED]>
    Acked-by: Linas Vepstas <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/pci/pci.c   |   29 +++++++++++++++++++++++++++++
 include/linux/pci.h |   14 ++++++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 2a45827..2086cd1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -892,6 +892,34 @@ pci_disable_device(struct pci_dev *dev)
 }
 
 /**
+ * pcibios_set_pcie_reset_state - set reset state for device dev
+ * @dev: the PCI-E device reset
+ * @state: Reset state to enter into
+ *
+ *
+ * Sets the PCI-E reset state for the device. This is the default
+ * implementation. Architecture implementations can override this.
+ */
+int __attribute__ ((weak)) pcibios_set_pcie_reset_state(struct pci_dev *dev,
+                                                       enum pcie_reset_state 
state)
+{
+       return -EINVAL;
+}
+
+/**
+ * pci_set_pcie_reset_state - set reset state for device dev
+ * @dev: the PCI-E device reset
+ * @state: Reset state to enter into
+ *
+ *
+ * Sets the PCI reset state for the device.
+ */
+int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state)
+{
+       return pcibios_set_pcie_reset_state(dev, state);
+}
+
+/**
  * pci_enable_wake - enable PCI device as wakeup event source
  * @dev: PCI device affected
  * @state: PCI state from which device will issue wakeup events
@@ -1427,4 +1455,5 @@ EXPORT_SYMBOL(pci_set_power_state);
 EXPORT_SYMBOL(pci_save_state);
 EXPORT_SYMBOL(pci_restore_state);
 EXPORT_SYMBOL(pci_enable_wake);
+EXPORT_SYMBOL_GPL(pci_set_pcie_reset_state);
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 9724910..3aba02a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -96,6 +96,19 @@ enum pci_channel_state {
        pci_channel_io_perm_failure = (__force pci_channel_state_t) 3,
 };
 
+typedef unsigned int __bitwise pcie_reset_state_t;
+
+enum pcie_reset_state {
+       /* Reset is NOT asserted (Use to deassert reset) */
+       pcie_deassert_reset = (__force pcie_reset_state_t) 1,
+
+       /* Use #PERST to reset PCI-E device */
+       pcie_warm_reset = (__force pcie_reset_state_t) 2,
+
+       /* Use PCI-E Hot Reset to reset device */
+       pcie_hot_reset = (__force pcie_reset_state_t) 3
+};
+
 typedef unsigned short __bitwise pci_bus_flags_t;
 enum pci_bus_flags {
        PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
@@ -532,6 +545,7 @@ static inline int pci_is_managed(struct pci_dev *pdev)
 
 void pci_disable_device(struct pci_dev *dev);
 void pci_set_master(struct pci_dev *dev);
+int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
 #define HAVE_PCI_SET_MWI
 int __must_check pci_set_mwi(struct pci_dev *dev);
 void pci_clear_mwi(struct pci_dev *dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to