diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-09-07 18:44:18 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-09 19:35:42 -0400 |
commit | 120dc496617eb7105d577c6041cbc052ffb1d8c7 (patch) | |
tree | 929f9741af32d753fb6ae71b41f1fbcd4787bfa7 /arch/powerpc/platforms/pseries | |
parent | c270a24c59bd9a4ac7dbcbd964cbd14270b3a361 (diff) |
powerpc/eeh: Make EEH handler PE sensitive
Once eeh error is found, eeh event will be created and put it into
the global linked list. At the mean while, kernel thread will be
started to process it. The handler for the kernel thread originally
was eeh device sensitive.
The patch reworks the handler of the kernel thread so that it's PE
sensitive.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_event.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index 7f89f1e3fe2b..ba7005a5e2fe 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c | |||
@@ -57,7 +57,7 @@ static int eeh_event_handler(void * dummy) | |||
57 | { | 57 | { |
58 | unsigned long flags; | 58 | unsigned long flags; |
59 | struct eeh_event *event; | 59 | struct eeh_event *event; |
60 | struct eeh_dev *edev; | 60 | struct eeh_pe *pe; |
61 | 61 | ||
62 | set_task_comm(current, "eehd"); | 62 | set_task_comm(current, "eehd"); |
63 | 63 | ||
@@ -76,28 +76,23 @@ static int eeh_event_handler(void * dummy) | |||
76 | 76 | ||
77 | /* Serialize processing of EEH events */ | 77 | /* Serialize processing of EEH events */ |
78 | mutex_lock(&eeh_event_mutex); | 78 | mutex_lock(&eeh_event_mutex); |
79 | edev = event->edev; | 79 | pe = event->pe; |
80 | eeh_mark_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); | 80 | eeh_pe_state_mark(pe, EEH_PE_RECOVERING); |
81 | 81 | pr_info("EEH: Detected PCI bus error on PHB#%d-PE#%x\n", | |
82 | printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", | 82 | pe->phb->global_number, pe->addr); |
83 | eeh_pci_name(edev->pdev)); | ||
84 | 83 | ||
85 | set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */ | 84 | set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */ |
86 | edev = handle_eeh_events(event); | 85 | handle_eeh_events(event); |
87 | 86 | eeh_pe_state_clear(pe, EEH_PE_RECOVERING); | |
88 | if (edev) { | ||
89 | eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); | ||
90 | pci_dev_put(edev->pdev); | ||
91 | } | ||
92 | 87 | ||
93 | kfree(event); | 88 | kfree(event); |
94 | mutex_unlock(&eeh_event_mutex); | 89 | mutex_unlock(&eeh_event_mutex); |
95 | 90 | ||
96 | /* If there are no new errors after an hour, clear the counter. */ | 91 | /* If there are no new errors after an hour, clear the counter. */ |
97 | if (edev && edev->freeze_count>0) { | 92 | if (pe && pe->freeze_count > 0) { |
98 | msleep_interruptible(3600*1000); | 93 | msleep_interruptible(3600*1000); |
99 | if (edev->freeze_count>0) | 94 | if (pe->freeze_count > 0) |
100 | edev->freeze_count--; | 95 | pe->freeze_count--; |
101 | 96 | ||
102 | } | 97 | } |
103 | 98 | ||