|
@@ -171,6 +171,16 @@ static void *eeh_dev_save_state(void *data, void *userdata)
|
|
if (!edev)
|
|
if (!edev)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We cannot access the config space on some adapters.
|
|
|
|
+ * Otherwise, it will cause fenced PHB. We don't save
|
|
|
|
+ * the content in their config space and will restore
|
|
|
|
+ * from the initial config space saved when the EEH
|
|
|
|
+ * device is created.
|
|
|
|
+ */
|
|
|
|
+ if (edev->pe && (edev->pe->state & EEH_PE_CFG_RESTRICTED))
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
pdev = eeh_dev_to_pci_dev(edev);
|
|
pdev = eeh_dev_to_pci_dev(edev);
|
|
if (!pdev)
|
|
if (!pdev)
|
|
return NULL;
|
|
return NULL;
|
|
@@ -312,6 +322,19 @@ static void *eeh_dev_restore_state(void *data, void *userdata)
|
|
if (!edev)
|
|
if (!edev)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * The content in the config space isn't saved because
|
|
|
|
+ * the blocked config space on some adapters. We have
|
|
|
|
+ * to restore the initial saved config space when the
|
|
|
|
+ * EEH device is created.
|
|
|
|
+ */
|
|
|
|
+ if (edev->pe && (edev->pe->state & EEH_PE_CFG_RESTRICTED)) {
|
|
|
|
+ if (list_is_last(&edev->list, &edev->pe->edevs))
|
|
|
|
+ eeh_pe_restore_bars(edev->pe);
|
|
|
|
+
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
pdev = eeh_dev_to_pci_dev(edev);
|
|
pdev = eeh_dev_to_pci_dev(edev);
|
|
if (!pdev)
|
|
if (!pdev)
|
|
return NULL;
|
|
return NULL;
|