diff options
Diffstat (limited to 'drivers/misc/cxl/pci.c')
-rw-r--r-- | drivers/misc/cxl/pci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 0c6c17a1c59e..ba2f6d1d7db7 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c | |||
@@ -1329,6 +1329,9 @@ static pci_ers_result_t cxl_vphb_error_detected(struct cxl_afu *afu, | |||
1329 | /* There should only be one entry, but go through the list | 1329 | /* There should only be one entry, but go through the list |
1330 | * anyway | 1330 | * anyway |
1331 | */ | 1331 | */ |
1332 | if (afu->phb == NULL) | ||
1333 | return result; | ||
1334 | |||
1332 | list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { | 1335 | list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { |
1333 | if (!afu_dev->driver) | 1336 | if (!afu_dev->driver) |
1334 | continue; | 1337 | continue; |
@@ -1369,6 +1372,10 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev, | |||
1369 | */ | 1372 | */ |
1370 | for (i = 0; i < adapter->slices; i++) { | 1373 | for (i = 0; i < adapter->slices; i++) { |
1371 | afu = adapter->afu[i]; | 1374 | afu = adapter->afu[i]; |
1375 | /* | ||
1376 | * Tell the AFU drivers; but we don't care what they | ||
1377 | * say, we're going away. | ||
1378 | */ | ||
1372 | cxl_vphb_error_detected(afu, state); | 1379 | cxl_vphb_error_detected(afu, state); |
1373 | } | 1380 | } |
1374 | return PCI_ERS_RESULT_DISCONNECT; | 1381 | return PCI_ERS_RESULT_DISCONNECT; |
@@ -1492,6 +1499,9 @@ static pci_ers_result_t cxl_pci_slot_reset(struct pci_dev *pdev) | |||
1492 | if (cxl_afu_select_best_mode(afu)) | 1499 | if (cxl_afu_select_best_mode(afu)) |
1493 | goto err; | 1500 | goto err; |
1494 | 1501 | ||
1502 | if (afu->phb == NULL) | ||
1503 | continue; | ||
1504 | |||
1495 | cxl_pci_vphb_reconfigure(afu); | 1505 | cxl_pci_vphb_reconfigure(afu); |
1496 | 1506 | ||
1497 | list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { | 1507 | list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { |
@@ -1556,6 +1566,9 @@ static void cxl_pci_resume(struct pci_dev *pdev) | |||
1556 | for (i = 0; i < adapter->slices; i++) { | 1566 | for (i = 0; i < adapter->slices; i++) { |
1557 | afu = adapter->afu[i]; | 1567 | afu = adapter->afu[i]; |
1558 | 1568 | ||
1569 | if (afu->phb == NULL) | ||
1570 | continue; | ||
1571 | |||
1559 | list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { | 1572 | list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { |
1560 | if (afu_dev->driver && afu_dev->driver->err_handler && | 1573 | if (afu_dev->driver && afu_dev->driver->err_handler && |
1561 | afu_dev->driver->err_handler->resume) | 1574 | afu_dev->driver->err_handler->resume) |