diff options
Diffstat (limited to 'arch/powerpc/platforms/powernv/eeh-powernv.c')
| -rw-r--r-- | arch/powerpc/platforms/powernv/eeh-powernv.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 8864065eba22..4650fb294e7a 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c | |||
| @@ -41,7 +41,6 @@ | |||
| 41 | #include "powernv.h" | 41 | #include "powernv.h" |
| 42 | #include "pci.h" | 42 | #include "pci.h" |
| 43 | 43 | ||
| 44 | static bool pnv_eeh_nb_init = false; | ||
| 45 | static int eeh_event_irq = -EINVAL; | 44 | static int eeh_event_irq = -EINVAL; |
| 46 | 45 | ||
| 47 | static int pnv_eeh_init(void) | 46 | static int pnv_eeh_init(void) |
| @@ -197,31 +196,31 @@ PNV_EEH_DBGFS_ENTRY(inbB, 0xE10); | |||
| 197 | * been built. If the I/O cache staff has been built, EEH is | 196 | * been built. If the I/O cache staff has been built, EEH is |
| 198 | * ready to supply service. | 197 | * ready to supply service. |
| 199 | */ | 198 | */ |
| 200 | static int pnv_eeh_post_init(void) | 199 | int pnv_eeh_post_init(void) |
| 201 | { | 200 | { |
| 202 | struct pci_controller *hose; | 201 | struct pci_controller *hose; |
| 203 | struct pnv_phb *phb; | 202 | struct pnv_phb *phb; |
| 204 | int ret = 0; | 203 | int ret = 0; |
| 205 | 204 | ||
| 206 | /* Register OPAL event notifier */ | 205 | /* Probe devices & build address cache */ |
| 207 | if (!pnv_eeh_nb_init) { | 206 | eeh_probe_devices(); |
| 208 | eeh_event_irq = opal_event_request(ilog2(OPAL_EVENT_PCI_ERROR)); | 207 | eeh_addr_cache_build(); |
| 209 | if (eeh_event_irq < 0) { | ||
| 210 | pr_err("%s: Can't register OPAL event interrupt (%d)\n", | ||
| 211 | __func__, eeh_event_irq); | ||
| 212 | return eeh_event_irq; | ||
| 213 | } | ||
| 214 | 208 | ||
| 215 | ret = request_irq(eeh_event_irq, pnv_eeh_event, | 209 | /* Register OPAL event notifier */ |
| 216 | IRQ_TYPE_LEVEL_HIGH, "opal-eeh", NULL); | 210 | eeh_event_irq = opal_event_request(ilog2(OPAL_EVENT_PCI_ERROR)); |
| 217 | if (ret < 0) { | 211 | if (eeh_event_irq < 0) { |
| 218 | irq_dispose_mapping(eeh_event_irq); | 212 | pr_err("%s: Can't register OPAL event interrupt (%d)\n", |
| 219 | pr_err("%s: Can't request OPAL event interrupt (%d)\n", | 213 | __func__, eeh_event_irq); |
| 220 | __func__, eeh_event_irq); | 214 | return eeh_event_irq; |
| 221 | return ret; | 215 | } |
| 222 | } | ||
| 223 | 216 | ||
| 224 | pnv_eeh_nb_init = true; | 217 | ret = request_irq(eeh_event_irq, pnv_eeh_event, |
| 218 | IRQ_TYPE_LEVEL_HIGH, "opal-eeh", NULL); | ||
| 219 | if (ret < 0) { | ||
| 220 | irq_dispose_mapping(eeh_event_irq); | ||
| 221 | pr_err("%s: Can't request OPAL event interrupt (%d)\n", | ||
| 222 | __func__, eeh_event_irq); | ||
| 223 | return ret; | ||
| 225 | } | 224 | } |
| 226 | 225 | ||
| 227 | if (!eeh_enabled()) | 226 | if (!eeh_enabled()) |
| @@ -367,6 +366,10 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data) | |||
| 367 | if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA) | 366 | if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA) |
| 368 | return NULL; | 367 | return NULL; |
| 369 | 368 | ||
| 369 | /* Skip if we haven't probed yet */ | ||
| 370 | if (phb->ioda.pe_rmap[config_addr] == IODA_INVALID_PE) | ||
| 371 | return NULL; | ||
| 372 | |||
| 370 | /* Initialize eeh device */ | 373 | /* Initialize eeh device */ |
| 371 | edev->class_code = pdn->class_code; | 374 | edev->class_code = pdn->class_code; |
| 372 | edev->mode &= 0xFFFFFF00; | 375 | edev->mode &= 0xFFFFFF00; |
| @@ -1731,7 +1734,6 @@ static int pnv_eeh_restore_config(struct pci_dn *pdn) | |||
| 1731 | static struct eeh_ops pnv_eeh_ops = { | 1734 | static struct eeh_ops pnv_eeh_ops = { |
| 1732 | .name = "powernv", | 1735 | .name = "powernv", |
| 1733 | .init = pnv_eeh_init, | 1736 | .init = pnv_eeh_init, |
| 1734 | .post_init = pnv_eeh_post_init, | ||
| 1735 | .probe = pnv_eeh_probe, | 1737 | .probe = pnv_eeh_probe, |
| 1736 | .set_option = pnv_eeh_set_option, | 1738 | .set_option = pnv_eeh_set_option, |
| 1737 | .get_pe_addr = pnv_eeh_get_pe_addr, | 1739 | .get_pe_addr = pnv_eeh_get_pe_addr, |
