|
@@ -239,20 +239,16 @@ static int ioda_eeh_set_option(struct eeh_pe *pe, int option)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-static void ioda_eeh_phb_diag(struct pci_controller *hose)
|
|
|
+static void ioda_eeh_phb_diag(struct eeh_pe *pe)
|
|
|
{
|
|
|
- struct pnv_phb *phb = hose->private_data;
|
|
|
+ struct pnv_phb *phb = pe->phb->private_data;
|
|
|
long rc;
|
|
|
|
|
|
- rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob,
|
|
|
+ rc = opal_pci_get_phb_diag_data2(phb->opal_id, pe->data,
|
|
|
PNV_PCI_DIAG_BUF_SIZE);
|
|
|
- if (rc != OPAL_SUCCESS) {
|
|
|
+ if (rc != OPAL_SUCCESS)
|
|
|
pr_warn("%s: Failed to get diag-data for PHB#%x (%ld)\n",
|
|
|
- __func__, hose->global_number, rc);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- pnv_pci_dump_phb_diag_data(hose, phb->diag.blob);
|
|
|
+ __func__, pe->phb->global_number, rc);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -323,7 +319,7 @@ static int ioda_eeh_get_state(struct eeh_pe *pe)
|
|
|
result |= EEH_STATE_DMA_ENABLED;
|
|
|
} else if (!(pe->state & EEH_PE_ISOLATED)) {
|
|
|
eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
|
|
|
- ioda_eeh_phb_diag(hose);
|
|
|
+ ioda_eeh_phb_diag(pe);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
@@ -373,7 +369,7 @@ static int ioda_eeh_get_state(struct eeh_pe *pe)
|
|
|
(EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE) &&
|
|
|
!(pe->state & EEH_PE_ISOLATED)) {
|
|
|
eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
|
|
|
- ioda_eeh_phb_diag(hose);
|
|
|
+ ioda_eeh_phb_diag(pe);
|
|
|
}
|
|
|
|
|
|
return result;
|
|
@@ -588,6 +584,24 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * ioda_eeh_get_log - Retrieve error log
|
|
|
+ * @pe: frozen PE
|
|
|
+ * @severity: permanent or temporary error
|
|
|
+ * @drv_log: device driver log
|
|
|
+ * @len: length of device driver log
|
|
|
+ *
|
|
|
+ * Retrieve error log, which contains log from device driver
|
|
|
+ * and firmware.
|
|
|
+ */
|
|
|
+int ioda_eeh_get_log(struct eeh_pe *pe, int severity,
|
|
|
+ char *drv_log, unsigned long len)
|
|
|
+{
|
|
|
+ pnv_pci_dump_phb_diag_data(pe->phb, pe->data);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* ioda_eeh_configure_bridge - Configure the PCI bridges for the indicated PE
|
|
|
* @pe: EEH PE
|
|
@@ -805,7 +819,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
|
|
|
"detected, location: %s\n",
|
|
|
hose->global_number,
|
|
|
eeh_pe_loc_get(phb_pe));
|
|
|
- ioda_eeh_phb_diag(hose);
|
|
|
+ ioda_eeh_phb_diag(phb_pe);
|
|
|
+ pnv_pci_dump_phb_diag_data(hose, phb_pe->data);
|
|
|
ret = EEH_NEXT_ERR_NONE;
|
|
|
}
|
|
|
|
|
@@ -853,7 +868,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
|
|
|
ret == EEH_NEXT_ERR_FENCED_PHB) &&
|
|
|
!((*pe)->state & EEH_PE_ISOLATED)) {
|
|
|
eeh_pe_state_mark(*pe, EEH_PE_ISOLATED);
|
|
|
- ioda_eeh_phb_diag(hose);
|
|
|
+ ioda_eeh_phb_diag(*pe);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -899,6 +914,7 @@ struct pnv_eeh_ops ioda_eeh_ops = {
|
|
|
.set_option = ioda_eeh_set_option,
|
|
|
.get_state = ioda_eeh_get_state,
|
|
|
.reset = ioda_eeh_reset,
|
|
|
+ .get_log = ioda_eeh_get_log,
|
|
|
.configure_bridge = ioda_eeh_configure_bridge,
|
|
|
.next_error = ioda_eeh_next_error
|
|
|
};
|