aboutsummaryrefslogtreecommitdiff
path: root/core/pci-opal.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-10-02 16:30:11 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-10-08 14:07:46 +1100
commit4bb318eeeb67d40071020de87dedbf5a04538b48 (patch)
tree857b5c0a039952041651de01c960dede95ea975e /core/pci-opal.c
parent38de7930a078da0b69e5803ef7003fe809bf67b1 (diff)
downloadskiboot-4bb318eeeb67d40071020de87dedbf5a04538b48.zip
skiboot-4bb318eeeb67d40071020de87dedbf5a04538b48.tar.gz
skiboot-4bb318eeeb67d40071020de87dedbf5a04538b48.tar.bz2
PCI: Refactor error injection
The patch refactors the code we had for PCI error injection. It doesn't change the logic: * Rename names of error types and functions according to the comments given by Michael Ellerman when reviewing the kernel counterpart. * Split The backend of error injection for PHB3 and P7IOC to multiple functions to improve code readability. Some logics are simplified without affecting their original functionality. * Misc cleanup like renaming variables and functions. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'core/pci-opal.c')
-rw-r--r--core/pci-opal.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/pci-opal.c b/core/pci-opal.c
index 47c9377..bb6bb70 100644
--- a/core/pci-opal.c
+++ b/core/pci-opal.c
@@ -112,31 +112,30 @@ static int64_t opal_pci_eeh_freeze_set(uint64_t phb_id, uint64_t pe_number,
}
opal_call(OPAL_PCI_EEH_FREEZE_SET, opal_pci_eeh_freeze_set, 3);
-static int64_t opal_pci_err_injct(uint64_t phb_id, uint32_t pe_no,
- uint32_t type, uint32_t function,
- uint64_t addr, uint64_t mask)
+static int64_t opal_pci_err_inject(uint64_t phb_id, uint32_t pe_no,
+ uint32_t type, uint32_t func,
+ uint64_t addr, uint64_t mask)
{
struct phb *phb = pci_get_phb(phb_id);
int64_t rc;
if (!phb)
return OPAL_PARAMETER;
- if (!phb->ops || !phb->ops->err_injct)
+ if (!phb->ops || !phb->ops->err_inject)
return OPAL_UNSUPPORTED;
- if (type != OpalErrinjctTypeIoaBusError &&
- type != OpalErrinjctTypeIoaBusError64)
+ if (type != OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR &&
+ type != OPAL_ERR_INJECT_TYPE_IOA_BUS_ERR64)
return OPAL_PARAMETER;
phb->ops->lock(phb);
- rc = phb->ops->err_injct(phb, pe_no, type,
- function, addr, mask);
+ rc = phb->ops->err_inject(phb, pe_no, type, func, addr, mask);
phb->ops->unlock(phb);
pci_put_phb(phb);
return rc;
}
-opal_call(OPAL_PCI_ERR_INJCT, opal_pci_err_injct, 6);
+opal_call(OPAL_PCI_ERR_INJECT, opal_pci_err_inject, 6);
static int64_t opal_pci_phb_mmio_enable(uint64_t phb_id, uint16_t window_type,
uint16_t window_num, uint16_t enable)