Skip to content

Commit 07f5ab6

Browse files
vaibhav92mpe
authored andcommitted
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: e4f5fc0("cxl: Do not create vPHB if there are no AFU configuration records") Signed-off-by: Vaibhav Jain <[email protected]> Reviewed-by: Matthew R. Ochs <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Acked-by: Frederic Barrat <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 97da385 commit 07f5ab6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/misc/cxl/pci.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,15 +1792,14 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,
17921792

17931793
/* If we're permanently dead, give up. */
17941794
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-
*/
17981795
for (i = 0; i < adapter->slices; i++) {
17991796
afu = adapter->afu[i];
1800-
/* Only participate in EEH if we are on a virtual PHB */
1801-
if (afu->phb == NULL)
1802-
return PCI_ERS_RESULT_NONE;
1803-
cxl_vphb_error_detected(afu, state);
1797+
/*
1798+
* Tell the AFU drivers; but we don't care what they
1799+
* say, we're going away.
1800+
*/
1801+
if (afu->phb != NULL)
1802+
cxl_vphb_error_detected(afu, state);
18041803
}
18051804
return PCI_ERS_RESULT_DISCONNECT;
18061805
}

0 commit comments

Comments
 (0)