powerpc/eeh: Don't use pci_dev during BAR restore
While restoring BARs for one specific PCI device, the pci_dev instance should have been released. So it's not reliable to use the pci_dev instance on restoring BARs. However, we still need some information (e.g. PCIe capability position, header type) from the pci_dev instance. So we have to store those information to EEH device in advance. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:

committed by
Benjamin Herrenschmidt

parent
f5c57710dd
commit
4b83bd452f
@@ -84,8 +84,11 @@ struct eeh_pe {
|
||||
* another tree except the currently existing tree of PCI
|
||||
* buses and PCI devices
|
||||
*/
|
||||
#define EEH_DEV_IRQ_DISABLED (1 << 0) /* Interrupt disabled */
|
||||
#define EEH_DEV_DISCONNECTED (1 << 1) /* Removing from PE */
|
||||
#define EEH_DEV_BRIDGE (1 << 0) /* PCI bridge */
|
||||
#define EEH_DEV_ROOT_PORT (1 << 1) /* PCIe root port */
|
||||
#define EEH_DEV_DS_PORT (1 << 2) /* Downstream port */
|
||||
#define EEH_DEV_IRQ_DISABLED (1 << 3) /* Interrupt disabled */
|
||||
#define EEH_DEV_DISCONNECTED (1 << 4) /* Removing from PE */
|
||||
|
||||
struct eeh_dev {
|
||||
int mode; /* EEH mode */
|
||||
@@ -93,6 +96,7 @@ struct eeh_dev {
|
||||
int config_addr; /* Config address */
|
||||
int pe_config_addr; /* PE config address */
|
||||
u32 config_space[16]; /* Saved PCI config space */
|
||||
u8 pcie_cap; /* Saved PCIe capability */
|
||||
struct eeh_pe *pe; /* Associated PE */
|
||||
struct list_head list; /* Form link list in the PE */
|
||||
struct pci_controller *phb; /* Associated PHB */
|
||||
|
Reference in New Issue
Block a user