|
@@ -299,7 +299,10 @@ static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev)
|
|
|
* EEH device already having associated PE, but
|
|
|
* the direct parent EEH device doesn't have yet.
|
|
|
*/
|
|
|
- pdn = pdn ? pdn->parent : NULL;
|
|
|
+ if (edev->physfn)
|
|
|
+ pdn = pci_get_pdn(edev->physfn);
|
|
|
+ else
|
|
|
+ pdn = pdn ? pdn->parent : NULL;
|
|
|
while (pdn) {
|
|
|
/* We're poking out of PCI territory */
|
|
|
parent = pdn_to_eeh_dev(pdn);
|
|
@@ -382,7 +385,10 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
|
|
|
}
|
|
|
|
|
|
/* Create a new EEH PE */
|
|
|
- pe = eeh_pe_alloc(edev->phb, EEH_PE_DEVICE);
|
|
|
+ if (edev->physfn)
|
|
|
+ pe = eeh_pe_alloc(edev->phb, EEH_PE_VF);
|
|
|
+ else
|
|
|
+ pe = eeh_pe_alloc(edev->phb, EEH_PE_DEVICE);
|
|
|
if (!pe) {
|
|
|
pr_err("%s: out of memory!\n", __func__);
|
|
|
return -ENOMEM;
|