aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVaibhav Jain <vaibhav@linux.vnet.ibm.com>2017-02-22 22:27:26 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2017-03-20 05:19:36 -0400
commit07f5ab6002a4f0b633f3495157166f9f6180871b (patch)
tree06dabfd6c40e6e786269674611ce12d2cb13669c /drivers
parent97da3854c526d3a6ee05c849c96e48d21527606c (diff)
cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
Fix a boundary condition where in some cases an eeh event with state == pci_channel_io_perm_failure wont be passed on to a driver attached to the virtual PCI device associated with a slice. This will happen in case the slice just before (n-1) doesn't have any vPHB bus associated with it, that results in an early return from cxl_pci_error_detected() callback. With state == pci_channel_io_perm_failure, the adapter will be removed irrespective of the return value of cxl_vphb_error_detected(). So we now always return PCI_ERS_RESULT_DISCONNECTED for this case i.e even if the AFU isn't using a vPHB (currently returns PCI_ERS_RESULT_NONE). Fixes: e4f5fc001a6("cxl: Do not create vPHB if there are no AFU configuration records") Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/cxl/pci.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 91f645992c94..b27ea98b781f 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1792,15 +1792,14 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,
1792 1792
1793 /* If we're permanently dead, give up. */ 1793 /* If we're permanently dead, give up. */
1794 if (state == pci_channel_io_perm_failure) { 1794 if (state == pci_channel_io_perm_failure) {
1795 /* Tell the AFU drivers; but we don't care what they
1796 * say, we're going away.
1797 */
1798 for (i = 0; i < adapter->slices; i++) { 1795 for (i = 0; i < adapter->slices; i++) {
1799 afu = adapter->afu[i]; 1796 afu = adapter->afu[i];
1800 /* Only participate in EEH if we are on a virtual PHB */ 1797 /*
1801 if (afu->phb == NULL) 1798 * Tell the AFU drivers; but we don't care what they
1802 return PCI_ERS_RESULT_NONE; 1799 * say, we're going away.
1803 cxl_vphb_error_detected(afu, state); 1800 */
1801 if (afu->phb != NULL)
1802 cxl_vphb_error_detected(afu, state);
1804 } 1803 }
1805 return PCI_ERS_RESULT_DISCONNECT; 1804 return PCI_ERS_RESULT_DISCONNECT;
1806 } 1805 }