diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2007-05-09 12:38:11 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-10 07:28:13 -0400 |
commit | 17213c3bf67bd532d4d04c286663f9bbf92b9c18 (patch) | |
tree | 835c3bd828ef427749b36a68665513fa0b1b475a /arch | |
parent | 979ee32f7f8e9582a0cadd4ed9a158ddc3036ad1 (diff) |
[POWERPC] Assorted janitorial EEH cleanups
Assorted minor cleanups to EEH code; -- use literals, use
kerneldoc format.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
arch/powerpc/platforms/pseries/eeh.c | 13 ++++++++++---
arch/powerpc/platforms/pseries/eeh_driver.c | 7 ++++---
include/asm-powerpc/ppc-pci.h | 18 +++++++++++++++---
3 files changed, 29 insertions(+), 9 deletions(-)
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 13 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_driver.c | 7 |
2 files changed, 14 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 093438b93bd9..5f3e6d8659fe 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -76,7 +76,7 @@ | |||
76 | */ | 76 | */ |
77 | #define EEH_MAX_FAILS 2100000 | 77 | #define EEH_MAX_FAILS 2100000 |
78 | 78 | ||
79 | /* Time to wait for a PCI slot to retport status, in milliseconds */ | 79 | /* Time to wait for a PCI slot to report status, in milliseconds */ |
80 | #define PCI_BUS_RESET_WAIT_MSEC (60*1000) | 80 | #define PCI_BUS_RESET_WAIT_MSEC (60*1000) |
81 | 81 | ||
82 | /* RTAS tokens */ | 82 | /* RTAS tokens */ |
@@ -95,11 +95,18 @@ EXPORT_SYMBOL(eeh_subsystem_enabled); | |||
95 | /* Lock to avoid races due to multiple reports of an error */ | 95 | /* Lock to avoid races due to multiple reports of an error */ |
96 | static DEFINE_SPINLOCK(confirm_error_lock); | 96 | static DEFINE_SPINLOCK(confirm_error_lock); |
97 | 97 | ||
98 | /* Buffer for reporting slot-error-detail rtas calls */ | 98 | /* Buffer for reporting slot-error-detail rtas calls. Its here |
99 | * in BSS, and not dynamically alloced, so that it ends up in | ||
100 | * RMO where RTAS can access it. | ||
101 | */ | ||
99 | static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX]; | 102 | static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX]; |
100 | static DEFINE_SPINLOCK(slot_errbuf_lock); | 103 | static DEFINE_SPINLOCK(slot_errbuf_lock); |
101 | static int eeh_error_buf_size; | 104 | static int eeh_error_buf_size; |
102 | 105 | ||
106 | /* Buffer for reporting pci register dumps. Its here in BSS, and | ||
107 | * not dynamically alloced, so that it ends up in RMO where RTAS | ||
108 | * can access it. | ||
109 | */ | ||
103 | #define EEH_PCI_REGS_LOG_LEN 4096 | 110 | #define EEH_PCI_REGS_LOG_LEN 4096 |
104 | static unsigned char pci_regs_buf[EEH_PCI_REGS_LOG_LEN]; | 111 | static unsigned char pci_regs_buf[EEH_PCI_REGS_LOG_LEN]; |
105 | 112 | ||
@@ -218,7 +225,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
218 | void eeh_slot_error_detail(struct pci_dn *pdn, int severity) | 225 | void eeh_slot_error_detail(struct pci_dn *pdn, int severity) |
219 | { | 226 | { |
220 | size_t loglen = 0; | 227 | size_t loglen = 0; |
221 | memset(pci_regs_buf, 0, EEH_PCI_REGS_LOG_LEN); | 228 | pci_regs_buf[0] = 0; |
222 | 229 | ||
223 | rtas_pci_enable(pdn, EEH_THAW_MMIO); | 230 | rtas_pci_enable(pdn, EEH_THAW_MMIO); |
224 | loglen = gather_pci_data(pdn, pci_regs_buf, EEH_PCI_REGS_LOG_LEN); | 231 | loglen = gather_pci_data(pdn, pci_regs_buf, EEH_PCI_REGS_LOG_LEN); |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index f07d849cfc84..161a5844ab6c 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -378,8 +378,9 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) | |||
378 | 378 | ||
379 | /* Since rtas may enable MMIO when posting the error log, | 379 | /* Since rtas may enable MMIO when posting the error log, |
380 | * don't post the error log until after all dev drivers | 380 | * don't post the error log until after all dev drivers |
381 | * have been informed. */ | 381 | * have been informed. |
382 | eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */); | 382 | */ |
383 | eeh_slot_error_detail(frozen_pdn, EEH_LOG_TEMP_FAILURE); | ||
383 | 384 | ||
384 | /* If all device drivers were EEH-unaware, then shut | 385 | /* If all device drivers were EEH-unaware, then shut |
385 | * down all of the device drivers, and hope they | 386 | * down all of the device drivers, and hope they |
@@ -470,7 +471,7 @@ hard_fail: | |||
470 | location, drv_str, pci_str); | 471 | location, drv_str, pci_str); |
471 | 472 | ||
472 | perm_error: | 473 | perm_error: |
473 | eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */); | 474 | eeh_slot_error_detail(frozen_pdn, EEH_LOG_PERM_FAILURE); |
474 | 475 | ||
475 | /* Notify all devices that they're about to go down. */ | 476 | /* Notify all devices that they're about to go down. */ |
476 | pci_walk_bus(frozen_bus, eeh_report_failure, NULL); | 477 | pci_walk_bus(frozen_bus, eeh_report_failure, NULL); |