diff options
author | Linas Vepstas <linas@linas.org> | 2005-11-03 19:49:01 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-09 19:33:14 -0500 |
commit | df7242b1156966c3b1aa0fd2bc63e3736099b592 (patch) | |
tree | 4b6777aa3631c1a78775051c8f4ef383ec699468 /arch/ppc64/kernel | |
parent | 177bc9367efe89a642bc9a07351726fd2c31f5ff (diff) |
[PATCH] ppc64: RTAS error reporting restructuring
05-eeh-slot-error-detail.patch
This patch encapsulates a section of code that reports the EEH event.
The new subroutine can be used in several places to report the error.
Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/kernel')
-rw-r--r-- | arch/ppc64/kernel/eeh.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c index 926d3110dfd7..b23159464abb 100644 --- a/arch/ppc64/kernel/eeh.c +++ b/arch/ppc64/kernel/eeh.c | |||
@@ -397,6 +397,28 @@ void __init pci_addr_cache_build(void) | |||
397 | /* --------------------------------------------------------------- */ | 397 | /* --------------------------------------------------------------- */ |
398 | /* Above lies the PCI Address Cache. Below lies the EEH event infrastructure */ | 398 | /* Above lies the PCI Address Cache. Below lies the EEH event infrastructure */ |
399 | 399 | ||
400 | void eeh_slot_error_detail (struct pci_dn *pdn, int severity) | ||
401 | { | ||
402 | unsigned long flags; | ||
403 | int rc; | ||
404 | |||
405 | /* Log the error with the rtas logger */ | ||
406 | spin_lock_irqsave(&slot_errbuf_lock, flags); | ||
407 | memset(slot_errbuf, 0, eeh_error_buf_size); | ||
408 | |||
409 | rc = rtas_call(ibm_slot_error_detail, | ||
410 | 8, 1, NULL, pdn->eeh_config_addr, | ||
411 | BUID_HI(pdn->phb->buid), | ||
412 | BUID_LO(pdn->phb->buid), NULL, 0, | ||
413 | virt_to_phys(slot_errbuf), | ||
414 | eeh_error_buf_size, | ||
415 | severity); | ||
416 | |||
417 | if (rc == 0) | ||
418 | log_error(slot_errbuf, ERR_TYPE_RTAS_LOG, 0); | ||
419 | spin_unlock_irqrestore(&slot_errbuf_lock, flags); | ||
420 | } | ||
421 | |||
400 | /** | 422 | /** |
401 | * eeh_register_notifier - Register to find out about EEH events. | 423 | * eeh_register_notifier - Register to find out about EEH events. |
402 | * @nb: notifier block to callback on events | 424 | * @nb: notifier block to callback on events |
@@ -454,9 +476,12 @@ static void eeh_panic(struct pci_dev *dev, int reset_state) | |||
454 | * Since the panic_on_oops sysctl is used to halt the system | 476 | * Since the panic_on_oops sysctl is used to halt the system |
455 | * in light of potential corruption, we can use it here. | 477 | * in light of potential corruption, we can use it here. |
456 | */ | 478 | */ |
457 | if (panic_on_oops) | 479 | if (panic_on_oops) { |
480 | struct device_node *dn = pci_device_to_OF_node(dev); | ||
481 | eeh_slot_error_detail (PCI_DN(dn), 2 /* Permanent Error */); | ||
458 | panic("EEH: MMIO failure (%d) on device:%s\n", reset_state, | 482 | panic("EEH: MMIO failure (%d) on device:%s\n", reset_state, |
459 | pci_name(dev)); | 483 | pci_name(dev)); |
484 | } | ||
460 | else { | 485 | else { |
461 | __get_cpu_var(ignored_failures)++; | 486 | __get_cpu_var(ignored_failures)++; |
462 | printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s\n", | 487 | printk(KERN_INFO "EEH: Ignored MMIO failure (%d) on device:%s\n", |
@@ -539,7 +564,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) | |||
539 | int ret; | 564 | int ret; |
540 | int rets[3]; | 565 | int rets[3]; |
541 | unsigned long flags; | 566 | unsigned long flags; |
542 | int rc, reset_state; | 567 | int reset_state; |
543 | struct eeh_event *event; | 568 | struct eeh_event *event; |
544 | struct pci_dn *pdn; | 569 | struct pci_dn *pdn; |
545 | 570 | ||
@@ -603,20 +628,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) | |||
603 | 628 | ||
604 | reset_state = rets[0]; | 629 | reset_state = rets[0]; |
605 | 630 | ||
606 | spin_lock_irqsave(&slot_errbuf_lock, flags); | 631 | eeh_slot_error_detail (pdn, 1 /* Temporary Error */); |
607 | memset(slot_errbuf, 0, eeh_error_buf_size); | ||
608 | |||
609 | rc = rtas_call(ibm_slot_error_detail, | ||
610 | 8, 1, NULL, pdn->eeh_config_addr, | ||
611 | BUID_HI(pdn->phb->buid), | ||
612 | BUID_LO(pdn->phb->buid), NULL, 0, | ||
613 | virt_to_phys(slot_errbuf), | ||
614 | eeh_error_buf_size, | ||
615 | 1 /* Temporary Error */); | ||
616 | |||
617 | if (rc == 0) | ||
618 | log_error(slot_errbuf, ERR_TYPE_RTAS_LOG, 0); | ||
619 | spin_unlock_irqrestore(&slot_errbuf_lock, flags); | ||
620 | 632 | ||
621 | printk(KERN_INFO "EEH: MMIO failure (%d) on device: %s %s\n", | 633 | printk(KERN_INFO "EEH: MMIO failure (%d) on device: %s %s\n", |
622 | rets[0], dn->name, dn->full_name); | 634 | rets[0], dn->name, dn->full_name); |
@@ -783,6 +795,8 @@ void __init eeh_init(void) | |||
783 | struct device_node *phb, *np; | 795 | struct device_node *phb, *np; |
784 | struct eeh_early_enable_info info; | 796 | struct eeh_early_enable_info info; |
785 | 797 | ||
798 | spin_lock_init(&slot_errbuf_lock); | ||
799 | |||
786 | np = of_find_node_by_path("/rtas"); | 800 | np = of_find_node_by_path("/rtas"); |
787 | if (np == NULL) | 801 | if (np == NULL) |
788 | return; | 802 | return; |