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 <redacted>
Reviewed-by: Matthew R. Ochs <redacted>
Reviewed-by: Andrew Donnellan <redacted>
---
Resend: Rephrased the patch description as suggested by Matthew and Andrew
---
drivers/misc/cxl/pci.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
@@ -1780,15 +1780,13 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,/* If we're permanently dead, give up. */if(state==pci_channel_io_perm_failure){-/* Tell the AFU drivers; but we don't care what they-*say,we'regoingaway.-*/for(i=0;i<adapter->slices;i++){afu=adapter->afu[i];-/* Only participate in EEH if we are on a virtual PHB */-if(afu->phb==NULL)-returnPCI_ERS_RESULT_NONE;-cxl_vphb_error_detected(afu,state);+/* Tell the AFU drivers; but we don't care what they+*say,we'regoingaway.+*/+if(afu->phb!=NULL)+cxl_vphb_error_detected(afu,state);}returnPCI_ERS_RESULT_DISCONNECT;}
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 <redacted>
Reviewed-by: Matthew R. Ochs <redacted>
Reviewed-by: Andrew Donnellan <redacted>
---
From: Michael Ellerman <hidden> Date: 2017-03-21 11:33:13
On Thu, 2017-02-23 at 03:27:26 UTC, Vaibhav Jain wrote:
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 <redacted>
Reviewed-by: Matthew R. Ochs <redacted>
Reviewed-by: Andrew Donnellan <redacted>
Acked-by: Frederic Barrat <redacted>