Lines Matching full:pe
70 struct eeh_pe *pe; in pnv_eeh_ei_write() local
90 /* Retrieve PE */ in pnv_eeh_ei_write()
91 pe = eeh_pe_get(hose, pe_no); in pnv_eeh_ei_write()
92 if (!pe) in pnv_eeh_ei_write()
96 ret = eeh_ops->err_inject(pe, type, func, addr, mask); in pnv_eeh_ei_write()
156 * to clear frozen PE during PCI config access. in pnv_eeh_enable_phbs()
301 /* for VFs we use the PF's PE as the upstream PE */ in pnv_eeh_get_upstream_pe()
306 /* otherwise use the PE of our parent bridge */ in pnv_eeh_get_upstream_pe()
339 if (!edev || edev->pe) in pnv_eeh_probe()
379 /* Create PE */ in pnv_eeh_probe()
382 eeh_edev_warn(edev, "Failed to add device to PE (code %d)\n", ret); in pnv_eeh_probe()
387 * If the PE contains any one of following adapters, the in pnv_eeh_probe()
391 * should be blocked until PE reset. MMIO access is dropped in pnv_eeh_probe()
394 * will be checked in the backend for PE state retrieval. If in pnv_eeh_probe()
395 * the PE becomes frozen for the first time and the flag has in pnv_eeh_probe()
396 * been set for the PE, we will set EEH_PE_CFG_BLOCKED for in pnv_eeh_probe()
397 * that PE to block its config space. in pnv_eeh_probe()
412 edev->pe->state |= EEH_PE_CFG_RESTRICTED; in pnv_eeh_probe()
415 * Cache the PE primary bus, which can't be fetched when in pnv_eeh_probe()
417 * PCI devices of the PE are expected to be removed prior in pnv_eeh_probe()
418 * to PE reset. in pnv_eeh_probe()
420 if (!(edev->pe->state & EEH_PE_PRI_BUS)) { in pnv_eeh_probe()
421 edev->pe->bus = pci_find_bus(hose->global_number, in pnv_eeh_probe()
423 if (edev->pe->bus) in pnv_eeh_probe()
424 edev->pe->state |= EEH_PE_PRI_BUS; in pnv_eeh_probe()
447 * @pe: EEH PE
454 static int pnv_eeh_set_option(struct eeh_pe *pe, int option) in pnv_eeh_set_option() argument
456 struct pci_controller *hose = pe->phb; in pnv_eeh_set_option()
485 phb->freeze_pe(phb, pe->addr); in pnv_eeh_set_option()
489 rc = opal_pci_eeh_freeze_set(phb->opal_id, pe->addr, opt); in pnv_eeh_set_option()
491 pr_warn("%s: Failure %lld freezing PHB#%x-PE#%x\n", in pnv_eeh_set_option()
493 pe->addr); in pnv_eeh_set_option()
502 return phb->unfreeze_pe(phb, pe->addr, opt); in pnv_eeh_set_option()
504 rc = opal_pci_eeh_freeze_clear(phb->opal_id, pe->addr, opt); in pnv_eeh_set_option()
506 pr_warn("%s: Failure %lld enable %d for PHB#%x-PE#%x\n", in pnv_eeh_set_option()
508 pe->addr); in pnv_eeh_set_option()
515 static void pnv_eeh_get_phb_diag(struct eeh_pe *pe) in pnv_eeh_get_phb_diag() argument
517 struct pnv_phb *phb = pe->phb->private_data; in pnv_eeh_get_phb_diag()
520 rc = opal_pci_get_phb_diag_data2(phb->opal_id, pe->data, in pnv_eeh_get_phb_diag()
524 __func__, rc, pe->phb->global_number); in pnv_eeh_get_phb_diag()
527 static int pnv_eeh_get_phb_state(struct eeh_pe *pe) in pnv_eeh_get_phb_state() argument
529 struct pnv_phb *phb = pe->phb->private_data; in pnv_eeh_get_phb_state()
536 pe->addr, in pnv_eeh_get_phb_state()
555 } else if (!(pe->state & EEH_PE_ISOLATED)) { in pnv_eeh_get_phb_state()
556 eeh_pe_mark_isolated(pe); in pnv_eeh_get_phb_state()
557 pnv_eeh_get_phb_diag(pe); in pnv_eeh_get_phb_state()
560 pnv_pci_dump_phb_diag_data(pe->phb, pe->data); in pnv_eeh_get_phb_state()
566 static int pnv_eeh_get_pe_state(struct eeh_pe *pe) in pnv_eeh_get_pe_state() argument
568 struct pnv_phb *phb = pe->phb->private_data; in pnv_eeh_get_pe_state()
575 * We don't clobber hardware frozen state until PE in pnv_eeh_get_pe_state()
578 * state during PE reset. in pnv_eeh_get_pe_state()
580 if (pe->state & EEH_PE_RESET) { in pnv_eeh_get_pe_state()
589 * Fetch PE state from hardware. If the PHB in pnv_eeh_get_pe_state()
590 * supports compound PE, let it handle that. in pnv_eeh_get_pe_state()
593 fstate = phb->get_pe_state(phb, pe->addr); in pnv_eeh_get_pe_state()
596 pe->addr, in pnv_eeh_get_pe_state()
601 pr_warn("%s: Failure %lld getting PHB#%x-PE%x state\n", in pnv_eeh_get_pe_state()
603 pe->addr); in pnv_eeh_get_pe_state()
638 pr_warn("%s: Invalid PHB#%x-PE#%x state %x\n", in pnv_eeh_get_pe_state()
640 pe->addr, fstate); in pnv_eeh_get_pe_state()
644 * If PHB supports compound PE, to freeze all in pnv_eeh_get_pe_state()
647 * If the PE is switching to frozen state for the in pnv_eeh_get_pe_state()
654 !(pe->state & EEH_PE_ISOLATED)) { in pnv_eeh_get_pe_state()
656 phb->freeze_pe(phb, pe->addr); in pnv_eeh_get_pe_state()
658 eeh_pe_mark_isolated(pe); in pnv_eeh_get_pe_state()
659 pnv_eeh_get_phb_diag(pe); in pnv_eeh_get_pe_state()
662 pnv_pci_dump_phb_diag_data(pe->phb, pe->data); in pnv_eeh_get_pe_state()
669 * pnv_eeh_get_state - Retrieve PE state
670 * @pe: EEH PE
671 * @delay: delay while PE state is temporarily unavailable
673 * Retrieve the state of the specified PE. For IODA-compitable
678 static int pnv_eeh_get_state(struct eeh_pe *pe, int *delay) in pnv_eeh_get_state() argument
682 if (pe->type & EEH_PE_PHB) in pnv_eeh_get_state()
683 ret = pnv_eeh_get_phb_state(pe); in pnv_eeh_get_state()
685 ret = pnv_eeh_get_pe_state(pe); in pnv_eeh_get_state()
691 * If the PE state is temporarily unavailable, in pnv_eeh_get_state()
1004 static int pnv_eeh_reset_vf_pe(struct eeh_pe *pe, int option) in pnv_eeh_reset_vf_pe() argument
1010 /* The VF PE should have only one child device */ in pnv_eeh_reset_vf_pe()
1011 edev = list_first_entry_or_null(&pe->edevs, struct eeh_dev, entry); in pnv_eeh_reset_vf_pe()
1024 * pnv_eeh_reset - Reset the specified PE
1025 * @pe: EEH PE
1028 * Do reset on the indicated PE. For PCI bus sensitive PE,
1031 * PCI device sensitive PE, we will try to reset the device
1035 static int pnv_eeh_reset(struct eeh_pe *pe, int option) in pnv_eeh_reset() argument
1037 struct pci_controller *hose = pe->phb; in pnv_eeh_reset()
1046 * For other PEs, we always have hot reset on the PE primary bus. in pnv_eeh_reset()
1049 * frozen state during PE reset. However, the good idea here from in pnv_eeh_reset()
1050 * benh is to keep frozen state before we get PE reset done completely in pnv_eeh_reset()
1052 * or MMIO access, which can incur recursive frozen PE during PE in pnv_eeh_reset()
1056 if (pe->type & EEH_PE_PHB) in pnv_eeh_reset()
1060 * The frozen PE might be caused by PAPR error injection in pnv_eeh_reset()
1062 * frozen PE as stated in the hardware spec. Unfortunately, in pnv_eeh_reset()
1080 if (pe->type & EEH_PE_VF) in pnv_eeh_reset()
1081 return pnv_eeh_reset_vf_pe(pe, option); in pnv_eeh_reset()
1083 bus = eeh_pe_bus_get(pe); in pnv_eeh_reset()
1085 pr_err("%s: Cannot find PCI bus for PHB#%x-PE#%x\n", in pnv_eeh_reset()
1086 __func__, pe->phb->global_number, pe->addr); in pnv_eeh_reset()
1126 * @pe: EEH PE
1131 * Retrieve the temporary or permanent error from the PE.
1133 static int pnv_eeh_get_log(struct eeh_pe *pe, int severity, in pnv_eeh_get_log() argument
1137 pnv_pci_dump_phb_diag_data(pe->phb, pe->data); in pnv_eeh_get_log()
1143 * pnv_eeh_configure_bridge - Configure PCI bridges in the indicated PE
1144 * @pe: EEH PE
1147 * in the specified PE so that the mulfunctional PE would be recovered
1150 static int pnv_eeh_configure_bridge(struct eeh_pe *pe) in pnv_eeh_configure_bridge() argument
1156 * pnv_pe_err_inject - Inject specified error to the indicated PE
1157 * @pe: the indicated PE
1164 * determined by @type and @func, to the indicated PE for
1167 static int pnv_eeh_err_inject(struct eeh_pe *pe, int type, int func, in pnv_eeh_err_inject() argument
1170 struct pci_controller *hose = pe->phb; in pnv_eeh_err_inject()
1196 rc = opal_pci_err_inject(phb->opal_id, pe->addr, in pnv_eeh_err_inject()
1200 "%d-%d to PHB#%x-PE#%x\n", in pnv_eeh_err_inject()
1202 hose->global_number, pe->addr); in pnv_eeh_err_inject()
1213 if (!edev || !edev->pe) in pnv_eeh_cfg_blocked()
1218 * in VF PE. It relies on the EEH PCI config accessors. So we in pnv_eeh_cfg_blocked()
1221 if (edev->physfn && (edev->pe->state & EEH_PE_RESET)) in pnv_eeh_cfg_blocked()
1224 if (edev->pe->state & EEH_PE_CFG_BLOCKED) in pnv_eeh_cfg_blocked()
1342 u16 pe_no, struct eeh_pe **pe) in pnv_eeh_get_pe() argument
1349 * If PHB supports compound PE, to fetch in pnv_eeh_get_pe()
1350 * the master PE because slave PE is invisible in pnv_eeh_get_pe()
1361 /* Find the PE according to PE# */ in pnv_eeh_get_pe()
1366 /* Freeze the (compound) PE */ in pnv_eeh_get_pe()
1367 *pe = dev_pe; in pnv_eeh_get_pe()
1372 * At this point, we're sure the (compound) PE should in pnv_eeh_get_pe()
1374 * hitting the frozen PE on top level. in pnv_eeh_get_pe()
1385 /* Frozen parent PE */ in pnv_eeh_get_pe()
1386 *pe = dev_pe; in pnv_eeh_get_pe()
1399 * @pe: Affected PE
1402 * special EEH event (without binding PE). The function calls to
1405 * fenced PHB and frozen PE should be handled by EEH core eventually.
1407 static int pnv_eeh_next_error(struct eeh_pe **pe) in pnv_eeh_next_error() argument
1475 *pe = phb_pe; in pnv_eeh_next_error()
1483 *pe = phb_pe; in pnv_eeh_next_error()
1502 * If we can't find the corresponding PE, we in pnv_eeh_next_error()
1506 be64_to_cpu(frozen_pe_no), pe)) { in pnv_eeh_next_error()
1507 pr_info("EEH: Clear non-existing PHB#%x-PE#%llx\n", in pnv_eeh_next_error()
1524 } else if ((*pe)->state & EEH_PE_ISOLATED || in pnv_eeh_next_error()
1525 eeh_pe_passed(*pe)) { in pnv_eeh_next_error()
1528 pr_err("EEH: Frozen PE#%x " in pnv_eeh_next_error()
1530 (*pe)->addr, in pnv_eeh_next_error()
1531 (*pe)->phb->global_number); in pnv_eeh_next_error()
1532 pr_err("EEH: PE location: %s, " in pnv_eeh_next_error()
1534 eeh_pe_loc_get(*pe), in pnv_eeh_next_error()
1547 * frozen PE. In the time for frozen PE, EEH core in pnv_eeh_next_error()
1554 !((*pe)->state & EEH_PE_ISOLATED)) { in pnv_eeh_next_error()
1555 eeh_pe_mark_isolated(*pe); in pnv_eeh_next_error()
1556 pnv_eeh_get_phb_diag(*pe); in pnv_eeh_next_error()
1559 pnv_pci_dump_phb_diag_data((*pe)->phb, in pnv_eeh_next_error()
1560 (*pe)->data); in pnv_eeh_next_error()
1564 * We probably have the frozen parent PE out there and in pnv_eeh_next_error()
1565 * we need have to handle frozen parent PE firstly. in pnv_eeh_next_error()
1568 parent_pe = (*pe)->parent; in pnv_eeh_next_error()
1574 /* Frozen parent PE ? */ in pnv_eeh_next_error()
1577 *pe = parent_pe; in pnv_eeh_next_error()
1583 /* We possibly migrate to another PE */ in pnv_eeh_next_error()
1584 eeh_pe_mark_isolated(*pe); in pnv_eeh_next_error()
1666 * P7IOC blocks PCI config access to frozen PE, but PHB3 in eeh_powernv_init()