|
@@ -55,9 +55,12 @@ static int ibm_get_config_addr_info;
|
|
|
static int ibm_get_config_addr_info2;
|
|
|
static int ibm_configure_pe;
|
|
|
|
|
|
+#ifdef CONFIG_PCI_IOV
|
|
|
void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
|
|
|
{
|
|
|
struct pci_dn *pdn = pci_get_pdn(pdev);
|
|
|
+ struct pci_dn *physfn_pdn;
|
|
|
+ struct eeh_dev *edev;
|
|
|
|
|
|
if (!pdev->is_virtfn)
|
|
|
return;
|
|
@@ -65,6 +68,15 @@ void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
|
|
|
pdn->device_id = pdev->device;
|
|
|
pdn->vendor_id = pdev->vendor;
|
|
|
pdn->class_code = pdev->class;
|
|
|
+ /*
|
|
|
+ * Last allow unfreeze return code used for retrieval
|
|
|
+ * by user space in eeh-sysfs to show the last command
|
|
|
+ * completion from platform.
|
|
|
+ */
|
|
|
+ pdn->last_allow_rc = 0;
|
|
|
+ physfn_pdn = pci_get_pdn(pdev->physfn);
|
|
|
+ pdn->pe_number = physfn_pdn->pe_num_map[pdn->vf_index];
|
|
|
+ edev = pdn_to_eeh_dev(pdn);
|
|
|
|
|
|
/*
|
|
|
* The following operations will fail if VF's sysfs files
|
|
@@ -72,9 +84,13 @@ void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
|
|
|
*/
|
|
|
eeh_add_device_early(pdn);
|
|
|
eeh_add_device_late(pdev);
|
|
|
+ edev->pe_config_addr = (pdn->busno << 16) | (pdn->devfn << 8);
|
|
|
+ eeh_rmv_from_parent_pe(edev); /* Remove as it is adding to bus pe */
|
|
|
+ eeh_add_to_parent_pe(edev); /* Add as VF PE type */
|
|
|
eeh_sysfs_add_device(pdev);
|
|
|
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
/*
|
|
|
* Buffer for reporting slot-error-detail rtas calls. Its here
|
|
@@ -141,8 +157,10 @@ static int pseries_eeh_init(void)
|
|
|
/* Set EEH probe mode */
|
|
|
eeh_add_flag(EEH_PROBE_MODE_DEVTREE | EEH_ENABLE_IO_FOR_LOG);
|
|
|
|
|
|
+#ifdef CONFIG_PCI_IOV
|
|
|
/* Set EEH machine dependent code */
|
|
|
ppc_md.pcibios_bus_add_device = pseries_pcibios_bus_add_device;
|
|
|
+#endif
|
|
|
|
|
|
return 0;
|
|
|
}
|