Skip to content

Commit

Permalink
PCI: export pci_restore_msi_state()
Browse files Browse the repository at this point in the history
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: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Linas Vepstas authored and Greg Kroah-Hartman committed Feb 1, 2008
1 parent 1b7c9fc commit 94688cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static void pci_intx_for_msi(struct pci_dev *dev, int enable)
pci_intx(dev, enable);
}

#ifdef CONFIG_PM
static void __pci_restore_msi_state(struct pci_dev *dev)
{
int pos;
Expand Down Expand Up @@ -288,7 +287,7 @@ void pci_restore_msi_state(struct pci_dev *dev)
__pci_restore_msi_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
Expand Down
6 changes: 0 additions & 6 deletions drivers/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ static inline void pci_no_msi(void) { }
static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
#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
void pci_no_aer(void);
#else
Expand Down
2 changes: 2 additions & 0 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,15 @@ static inline int pci_enable_msix(struct pci_dev* dev,
struct msix_entry *entries, int nvec) {return -1;}
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 pci_restore_msi_state(struct pci_dev *dev) {}
#else
extern int pci_enable_msi(struct pci_dev *dev);
extern void pci_disable_msi(struct pci_dev *dev);
extern int pci_enable_msix(struct pci_dev* dev,
struct msix_entry *entries, int nvec);
extern void pci_disable_msix(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

#ifdef CONFIG_HT_IRQ
Expand Down

0 comments on commit 94688cf

Please sign in to comment.