aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2016-09-12 00:17:23 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-09-22 17:54:21 -0400
commite98ddb77166a4d7ba6235b20a1328ecb137debb2 (patch)
treed97ef35c5de61ebf86994b2b091ddd7904dc7c80
parent04fec21c06e35b169a83e75a84a015ab4606bf5e (diff)
powerpc/powernv/eeh: Skip finding bus for VF resets
When the PE used in pnv_eeh_reset() is that of a VF, pnv_eeh_reset_vf_pe() is used. Unlike the other reset functions called in pnv_eeh_reset(), the VF reset doesn't require a bus, and if a bus was missing the function would error out before resetting the VF PE. To avoid this, reorder the VF reset function to occur before finding and checking the bus. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/platforms/powernv/eeh-powernv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index cb08e6aaf9bd..68f1a854f97d 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -1090,14 +1090,15 @@ static int pnv_eeh_reset(struct eeh_pe *pe, int option)
1090 } 1090 }
1091 } 1091 }
1092 1092
1093 if (pe->type & EEH_PE_VF)
1094 return pnv_eeh_reset_vf_pe(pe, option);
1095
1093 bus = eeh_pe_bus_get(pe); 1096 bus = eeh_pe_bus_get(pe);
1094 if (!bus) { 1097 if (!bus) {
1095 pr_err("%s: Cannot find PCI bus for PHB#%d-PE#%x\n", 1098 pr_err("%s: Cannot find PCI bus for PHB#%d-PE#%x\n",
1096 __func__, pe->phb->global_number, pe->addr); 1099 __func__, pe->phb->global_number, pe->addr);
1097 return -EIO; 1100 return -EIO;
1098 } 1101 }
1099 if (pe->type & EEH_PE_VF)
1100 return pnv_eeh_reset_vf_pe(pe, option);
1101 1102
1102 if (pci_is_root_bus(bus) || 1103 if (pci_is_root_bus(bus) ||
1103 pci_is_root_bus(bus->parent)) 1104 pci_is_root_bus(bus->parent))