diff options
Diffstat (limited to 'arch/powerpc/platforms')
| -rw-r--r-- | arch/powerpc/platforms/powernv/eeh-ioda.c | 32 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powernv/eeh-powernv.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/eeh_pseries.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/pci.c | 22 |
4 files changed, 23 insertions, 35 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index e1e71618b70c..f51474336460 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
| @@ -44,7 +44,8 @@ static int ioda_eeh_event(struct notifier_block *nb, | |||
| 44 | 44 | ||
| 45 | /* We simply send special EEH event */ | 45 | /* We simply send special EEH event */ |
| 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && | 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && |
| 47 | (events & OPAL_EVENT_PCI_ERROR)) | 47 | (events & OPAL_EVENT_PCI_ERROR) && |
| 48 | eeh_enabled()) | ||
| 48 | eeh_send_failure_event(NULL); | 49 | eeh_send_failure_event(NULL); |
| 49 | 50 | ||
| 50 | return 0; | 51 | return 0; |
| @@ -489,8 +490,7 @@ static int ioda_eeh_bridge_reset(struct pci_controller *hose, | |||
| 489 | static int ioda_eeh_reset(struct eeh_pe *pe, int option) | 490 | static int ioda_eeh_reset(struct eeh_pe *pe, int option) |
| 490 | { | 491 | { |
| 491 | struct pci_controller *hose = pe->phb; | 492 | struct pci_controller *hose = pe->phb; |
| 492 | struct eeh_dev *edev; | 493 | struct pci_bus *bus; |
| 493 | struct pci_dev *dev; | ||
| 494 | int ret; | 494 | int ret; |
| 495 | 495 | ||
| 496 | /* | 496 | /* |
| @@ -519,31 +519,11 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option) | |||
| 519 | if (pe->type & EEH_PE_PHB) { | 519 | if (pe->type & EEH_PE_PHB) { |
| 520 | ret = ioda_eeh_phb_reset(hose, option); | 520 | ret = ioda_eeh_phb_reset(hose, option); |
| 521 | } else { | 521 | } else { |
| 522 | if (pe->type & EEH_PE_DEVICE) { | 522 | bus = eeh_pe_bus_get(pe); |
| 523 | /* | 523 | if (pci_is_root_bus(bus)) |
| 524 | * If it's device PE, we didn't refer to the parent | ||
| 525 | * PCI bus yet. So we have to figure it out indirectly. | ||
| 526 | */ | ||
| 527 | edev = list_first_entry(&pe->edevs, | ||
| 528 | struct eeh_dev, list); | ||
| 529 | dev = eeh_dev_to_pci_dev(edev); | ||
| 530 | dev = dev->bus->self; | ||
| 531 | } else { | ||
| 532 | /* | ||
| 533 | * If it's bus PE, the parent PCI bus is already there | ||
| 534 | * and just pick it up. | ||
| 535 | */ | ||
| 536 | dev = pe->bus->self; | ||
| 537 | } | ||
| 538 | |||
| 539 | /* | ||
| 540 | * Do reset based on the fact that the direct upstream bridge | ||
| 541 | * is root bridge (port) or not. | ||
| 542 | */ | ||
| 543 | if (dev->bus->number == 0) | ||
| 544 | ret = ioda_eeh_root_reset(hose, option); | 524 | ret = ioda_eeh_root_reset(hose, option); |
| 545 | else | 525 | else |
| 546 | ret = ioda_eeh_bridge_reset(hose, dev, option); | 526 | ret = ioda_eeh_bridge_reset(hose, bus->self, option); |
| 547 | } | 527 | } |
| 548 | 528 | ||
| 549 | return ret; | 529 | return ret; |
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index a79fddc5e74e..a59788e83b8b 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c | |||
| @@ -145,7 +145,7 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag) | |||
| 145 | * Enable EEH explicitly so that we will do EEH check | 145 | * Enable EEH explicitly so that we will do EEH check |
| 146 | * while accessing I/O stuff | 146 | * while accessing I/O stuff |
| 147 | */ | 147 | */ |
| 148 | eeh_subsystem_enabled = 1; | 148 | eeh_set_enable(true); |
| 149 | 149 | ||
| 150 | /* Save memory bars */ | 150 | /* Save memory bars */ |
| 151 | eeh_save_bars(edev); | 151 | eeh_save_bars(edev); |
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 9ef3cc8ebc11..8a8f0472d98f 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c | |||
| @@ -265,7 +265,7 @@ static void *pseries_eeh_of_probe(struct device_node *dn, void *flag) | |||
| 265 | enable = 1; | 265 | enable = 1; |
| 266 | 266 | ||
| 267 | if (enable) { | 267 | if (enable) { |
| 268 | eeh_subsystem_enabled = 1; | 268 | eeh_set_enable(true); |
| 269 | eeh_add_to_parent_pe(edev); | 269 | eeh_add_to_parent_pe(edev); |
| 270 | 270 | ||
| 271 | pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n", | 271 | pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n", |
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 70670a2d9cf2..c413ec158ff5 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
| @@ -113,7 +113,8 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
| 113 | { | 113 | { |
| 114 | struct device_node *dn, *pdn; | 114 | struct device_node *dn, *pdn; |
| 115 | struct pci_bus *bus; | 115 | struct pci_bus *bus; |
| 116 | const __be32 *pcie_link_speed_stats; | 116 | u32 pcie_link_speed_stats[2]; |
| 117 | int rc; | ||
| 117 | 118 | ||
| 118 | bus = bridge->bus; | 119 | bus = bridge->bus; |
| 119 | 120 | ||
| @@ -122,38 +123,45 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
| 122 | return 0; | 123 | return 0; |
| 123 | 124 | ||
| 124 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { | 125 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { |
| 125 | pcie_link_speed_stats = of_get_property(pdn, | 126 | rc = of_property_read_u32_array(pdn, |
| 126 | "ibm,pcie-link-speed-stats", NULL); | 127 | "ibm,pcie-link-speed-stats", |
| 127 | if (pcie_link_speed_stats) | 128 | &pcie_link_speed_stats[0], 2); |
| 129 | if (!rc) | ||
| 128 | break; | 130 | break; |
| 129 | } | 131 | } |
| 130 | 132 | ||
| 131 | of_node_put(pdn); | 133 | of_node_put(pdn); |
| 132 | 134 | ||
| 133 | if (!pcie_link_speed_stats) { | 135 | if (rc) { |
| 134 | pr_err("no ibm,pcie-link-speed-stats property\n"); | 136 | pr_err("no ibm,pcie-link-speed-stats property\n"); |
| 135 | return 0; | 137 | return 0; |
| 136 | } | 138 | } |
| 137 | 139 | ||
| 138 | switch (be32_to_cpup(pcie_link_speed_stats)) { | 140 | switch (pcie_link_speed_stats[0]) { |
| 139 | case 0x01: | 141 | case 0x01: |
| 140 | bus->max_bus_speed = PCIE_SPEED_2_5GT; | 142 | bus->max_bus_speed = PCIE_SPEED_2_5GT; |
| 141 | break; | 143 | break; |
| 142 | case 0x02: | 144 | case 0x02: |
| 143 | bus->max_bus_speed = PCIE_SPEED_5_0GT; | 145 | bus->max_bus_speed = PCIE_SPEED_5_0GT; |
| 144 | break; | 146 | break; |
| 147 | case 0x04: | ||
| 148 | bus->max_bus_speed = PCIE_SPEED_8_0GT; | ||
| 149 | break; | ||
| 145 | default: | 150 | default: |
| 146 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; | 151 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; |
| 147 | break; | 152 | break; |
| 148 | } | 153 | } |
| 149 | 154 | ||
| 150 | switch (be32_to_cpup(pcie_link_speed_stats)) { | 155 | switch (pcie_link_speed_stats[1]) { |
| 151 | case 0x01: | 156 | case 0x01: |
| 152 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; | 157 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; |
| 153 | break; | 158 | break; |
| 154 | case 0x02: | 159 | case 0x02: |
| 155 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; | 160 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; |
| 156 | break; | 161 | break; |
| 162 | case 0x04: | ||
| 163 | bus->cur_bus_speed = PCIE_SPEED_8_0GT; | ||
| 164 | break; | ||
| 157 | default: | 165 | default: |
| 158 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; | 166 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; |
| 159 | break; | 167 | break; |
