Commit 94688cf2 authored by Linas Vepstas's avatar Linas Vepstas Committed by Greg Kroah-Hartman

PCI: export pci_restore_msi_state()

PCI error recovery usually involves the PCI adapter being reset.
If the device is using MSI, the reset will cause the MSI state
to be lost; the device driver needs to restore the MSI state.

The pci_restore_msi_state() routine is currently protected
by CONFIG_PM; remove this, and also export the symbol, so
that it can be used in a modle.
Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1b7c9fca
...@@ -230,7 +230,6 @@ static void pci_intx_for_msi(struct pci_dev *dev, int enable) ...@@ -230,7 +230,6 @@ static void pci_intx_for_msi(struct pci_dev *dev, int enable)
pci_intx(dev, enable); pci_intx(dev, enable);
} }
#ifdef CONFIG_PM
static void __pci_restore_msi_state(struct pci_dev *dev) static void __pci_restore_msi_state(struct pci_dev *dev)
{ {
int pos; int pos;
...@@ -288,7 +287,7 @@ void pci_restore_msi_state(struct pci_dev *dev) ...@@ -288,7 +287,7 @@ void pci_restore_msi_state(struct pci_dev *dev)
__pci_restore_msi_state(dev); __pci_restore_msi_state(dev);
__pci_restore_msix_state(dev); __pci_restore_msix_state(dev);
} }
#endif /* CONFIG_PM */ EXPORT_SYMBOL_GPL(pci_restore_msi_state);
/** /**
* msi_capability_init - configure device's MSI capability structure * msi_capability_init - configure device's MSI capability structure
......
...@@ -45,12 +45,6 @@ static inline void pci_no_msi(void) { } ...@@ -45,12 +45,6 @@ static inline void pci_no_msi(void) { }
static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
#endif #endif
#if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM)
void pci_restore_msi_state(struct pci_dev *dev);
#else
static inline void pci_restore_msi_state(struct pci_dev *dev) {}
#endif
#ifdef CONFIG_PCIEAER #ifdef CONFIG_PCIEAER
void pci_no_aer(void); void pci_no_aer(void);
#else #else
......
...@@ -668,6 +668,7 @@ static inline int pci_enable_msix(struct pci_dev* dev, ...@@ -668,6 +668,7 @@ static inline int pci_enable_msix(struct pci_dev* dev,
struct msix_entry *entries, int nvec) {return -1;} struct msix_entry *entries, int nvec) {return -1;}
static inline void pci_disable_msix(struct pci_dev *dev) {} static inline void pci_disable_msix(struct pci_dev *dev) {}
static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
static inline void pci_restore_msi_state(struct pci_dev *dev) {}
#else #else
extern int pci_enable_msi(struct pci_dev *dev); extern int pci_enable_msi(struct pci_dev *dev);
extern void pci_disable_msi(struct pci_dev *dev); extern void pci_disable_msi(struct pci_dev *dev);
...@@ -675,6 +676,7 @@ extern int pci_enable_msix(struct pci_dev* dev, ...@@ -675,6 +676,7 @@ extern int pci_enable_msix(struct pci_dev* dev,
struct msix_entry *entries, int nvec); struct msix_entry *entries, int nvec);
extern void pci_disable_msix(struct pci_dev *dev); extern void pci_disable_msix(struct pci_dev *dev);
extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
extern void pci_restore_msi_state(struct pci_dev *dev);
#endif #endif
#ifdef CONFIG_HT_IRQ #ifdef CONFIG_HT_IRQ
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment