diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-02-27 15:04:02 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-08 19:11:20 -0500 |
commit | 29f8bf1b7f79f689f33e9c4679d182a68b6a5b2c (patch) | |
tree | bd5d334db6efc3993315b437d7944a221ee3cb78 /arch | |
parent | 1823fbf119e434dd3fb8eb7482613994c09d8527 (diff) |
powerpc/pseries: Cleanup comments in EEH aux components
There're several EEH aux components and the patch does some cleanup
for them so that they look more clean.
* Duplicated comments have been removed from the header file.
* Comments have been reorganized so that it looks more clean.
* The leading comments of functions are adjusted for a little
bit so that the result of "make pdfdocs" would be more
unified.
* Function calls "xxx ()" has been replaced by "xxx()".
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/eeh_event.h | 34 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_cache.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_driver.c | 136 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_event.c | 23 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_sysfs.c | 2 |
5 files changed, 107 insertions, 97 deletions
diff --git a/arch/powerpc/include/asm/eeh_event.h b/arch/powerpc/include/asm/eeh_event.h index cc3cb04539ac..25ebf6a5aa57 100644 --- a/arch/powerpc/include/asm/eeh_event.h +++ b/arch/powerpc/include/asm/eeh_event.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * eeh_event.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 2 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 3 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or | 4 | * the Free Software Foundation; either version 2 of the License, or |
@@ -22,32 +20,20 @@ | |||
22 | #define ASM_POWERPC_EEH_EVENT_H | 20 | #define ASM_POWERPC_EEH_EVENT_H |
23 | #ifdef __KERNEL__ | 21 | #ifdef __KERNEL__ |
24 | 22 | ||
25 | /** EEH event -- structure holding pci controller data that describes | 23 | /* |
26 | * a change in the isolation status of a PCI slot. A pointer | 24 | * structure holding pci controller data that describes a |
27 | * to this struct is passed as the data pointer in a notify callback. | 25 | * change in the isolation status of a PCI slot. A pointer |
26 | * to this struct is passed as the data pointer in a notify | ||
27 | * callback. | ||
28 | */ | 28 | */ |
29 | struct eeh_event { | 29 | struct eeh_event { |
30 | struct list_head list; | 30 | struct list_head list; /* to form event queue */ |
31 | struct device_node *dn; /* struct device node */ | 31 | struct device_node *dn; /* struct device node */ |
32 | struct pci_dev *dev; /* affected device */ | 32 | struct pci_dev *dev; /* affected device */ |
33 | }; | 33 | }; |
34 | 34 | ||
35 | /** | 35 | int eeh_send_failure_event(struct device_node *dn, struct pci_dev *dev); |
36 | * eeh_send_failure_event - generate a PCI error event | 36 | struct pci_dn *handle_eeh_events(struct eeh_event *); |
37 | * @dev pci device | ||
38 | * | ||
39 | * This routine builds a PCI error event which will be delivered | ||
40 | * to all listeners on the eeh_notifier_chain. | ||
41 | * | ||
42 | * This routine can be called within an interrupt context; | ||
43 | * the actual event will be delivered in a normal context | ||
44 | * (from a workqueue). | ||
45 | */ | ||
46 | int eeh_send_failure_event (struct device_node *dn, | ||
47 | struct pci_dev *dev); | ||
48 | |||
49 | /* Main recovery function */ | ||
50 | struct pci_dn * handle_eeh_events (struct eeh_event *); | ||
51 | 37 | ||
52 | #endif /* __KERNEL__ */ | 38 | #endif /* __KERNEL__ */ |
53 | #endif /* ASM_POWERPC_EEH_EVENT_H */ | 39 | #endif /* ASM_POWERPC_EEH_EVENT_H */ |
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c index fc5ae767989e..850c00c166d6 100644 --- a/arch/powerpc/platforms/pseries/eeh_cache.c +++ b/arch/powerpc/platforms/pseries/eeh_cache.c | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * eeh_cache.c | ||
3 | * PCI address cache; allows the lookup of PCI devices based on I/O address | 2 | * PCI address cache; allows the lookup of PCI devices based on I/O address |
4 | * | 3 | * |
5 | * Copyright IBM Corporation 2004 | 4 | * Copyright IBM Corporation 2004 |
@@ -47,8 +46,7 @@ | |||
47 | * than any hash algo I could think of for this problem, even | 46 | * than any hash algo I could think of for this problem, even |
48 | * with the penalty of slow pointer chases for d-cache misses). | 47 | * with the penalty of slow pointer chases for d-cache misses). |
49 | */ | 48 | */ |
50 | struct pci_io_addr_range | 49 | struct pci_io_addr_range { |
51 | { | ||
52 | struct rb_node rb_node; | 50 | struct rb_node rb_node; |
53 | unsigned long addr_lo; | 51 | unsigned long addr_lo; |
54 | unsigned long addr_hi; | 52 | unsigned long addr_hi; |
@@ -56,8 +54,7 @@ struct pci_io_addr_range | |||
56 | unsigned int flags; | 54 | unsigned int flags; |
57 | }; | 55 | }; |
58 | 56 | ||
59 | static struct pci_io_addr_cache | 57 | static struct pci_io_addr_cache { |
60 | { | ||
61 | struct rb_root rb_root; | 58 | struct rb_root rb_root; |
62 | spinlock_t piar_lock; | 59 | spinlock_t piar_lock; |
63 | } pci_io_addr_cache_root; | 60 | } pci_io_addr_cache_root; |
@@ -166,7 +163,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo, | |||
166 | 163 | ||
167 | #ifdef DEBUG | 164 | #ifdef DEBUG |
168 | printk(KERN_DEBUG "PIAR: insert range=[%lx:%lx] dev=%s\n", | 165 | printk(KERN_DEBUG "PIAR: insert range=[%lx:%lx] dev=%s\n", |
169 | alo, ahi, pci_name (dev)); | 166 | alo, ahi, pci_name(dev)); |
170 | #endif | 167 | #endif |
171 | 168 | ||
172 | rb_link_node(&piar->rb_node, parent, p); | 169 | rb_link_node(&piar->rb_node, parent, p); |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index 61450e1b3f7d..3f25fab741e2 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -33,8 +33,14 @@ | |||
33 | #include <asm/prom.h> | 33 | #include <asm/prom.h> |
34 | #include <asm/rtas.h> | 34 | #include <asm/rtas.h> |
35 | 35 | ||
36 | 36 | /** | |
37 | static inline const char * pcid_name (struct pci_dev *pdev) | 37 | * eeh_pcid_name - Retrieve name of PCI device driver |
38 | * @pdev: PCI device | ||
39 | * | ||
40 | * This routine is used to retrieve the name of PCI device driver | ||
41 | * if that's valid. | ||
42 | */ | ||
43 | static inline const char *pcid_name(struct pci_dev *pdev) | ||
38 | { | 44 | { |
39 | if (pdev && pdev->dev.driver) | 45 | if (pdev && pdev->dev.driver) |
40 | return pdev->dev.driver->name; | 46 | return pdev->dev.driver->name; |
@@ -64,7 +70,14 @@ static void print_device_node_tree(struct pci_dn *pdn, int dent) | |||
64 | #endif | 70 | #endif |
65 | 71 | ||
66 | /** | 72 | /** |
67 | * eeh_disable_irq - disable interrupt for the recovering device | 73 | * eeh_disable_irq - Disable interrupt for the recovering device |
74 | * @dev: PCI device | ||
75 | * | ||
76 | * This routine must be called when reporting temporary or permanent | ||
77 | * error to the particular PCI device to disable interrupt of that | ||
78 | * device. If the device has enabled MSI or MSI-X interrupt, we needn't | ||
79 | * do real work because EEH should freeze DMA transfers for those PCI | ||
80 | * devices encountering EEH errors, which includes MSI or MSI-X. | ||
68 | */ | 81 | */ |
69 | static void eeh_disable_irq(struct pci_dev *dev) | 82 | static void eeh_disable_irq(struct pci_dev *dev) |
70 | { | 83 | { |
@@ -73,7 +86,7 @@ static void eeh_disable_irq(struct pci_dev *dev) | |||
73 | /* Don't disable MSI and MSI-X interrupts. They are | 86 | /* Don't disable MSI and MSI-X interrupts. They are |
74 | * effectively disabled by the DMA Stopped state | 87 | * effectively disabled by the DMA Stopped state |
75 | * when an EEH error occurs. | 88 | * when an EEH error occurs. |
76 | */ | 89 | */ |
77 | if (dev->msi_enabled || dev->msix_enabled) | 90 | if (dev->msi_enabled || dev->msix_enabled) |
78 | return; | 91 | return; |
79 | 92 | ||
@@ -85,7 +98,11 @@ static void eeh_disable_irq(struct pci_dev *dev) | |||
85 | } | 98 | } |
86 | 99 | ||
87 | /** | 100 | /** |
88 | * eeh_enable_irq - enable interrupt for the recovering device | 101 | * eeh_enable_irq - Enable interrupt for the recovering device |
102 | * @dev: PCI device | ||
103 | * | ||
104 | * This routine must be called to enable interrupt while failed | ||
105 | * device could be resumed. | ||
89 | */ | 106 | */ |
90 | static void eeh_enable_irq(struct pci_dev *dev) | 107 | static void eeh_enable_irq(struct pci_dev *dev) |
91 | { | 108 | { |
@@ -97,15 +114,15 @@ static void eeh_enable_irq(struct pci_dev *dev) | |||
97 | } | 114 | } |
98 | } | 115 | } |
99 | 116 | ||
100 | /* ------------------------------------------------------- */ | ||
101 | /** | 117 | /** |
102 | * eeh_report_error - report pci error to each device driver | 118 | * eeh_report_error - Report pci error to each device driver |
119 | * @dev: PCI device | ||
120 | * @userdata: return value | ||
103 | * | 121 | * |
104 | * Report an EEH error to each device driver, collect up and | 122 | * Report an EEH error to each device driver, collect up and |
105 | * merge the device driver responses. Cumulative response | 123 | * merge the device driver responses. Cumulative response |
106 | * passed back in "userdata". | 124 | * passed back in "userdata". |
107 | */ | 125 | */ |
108 | |||
109 | static int eeh_report_error(struct pci_dev *dev, void *userdata) | 126 | static int eeh_report_error(struct pci_dev *dev, void *userdata) |
110 | { | 127 | { |
111 | enum pci_ers_result rc, *res = userdata; | 128 | enum pci_ers_result rc, *res = userdata; |
@@ -122,7 +139,7 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata) | |||
122 | !driver->err_handler->error_detected) | 139 | !driver->err_handler->error_detected) |
123 | return 0; | 140 | return 0; |
124 | 141 | ||
125 | rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen); | 142 | rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen); |
126 | 143 | ||
127 | /* A driver that needs a reset trumps all others */ | 144 | /* A driver that needs a reset trumps all others */ |
128 | if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; | 145 | if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; |
@@ -132,13 +149,14 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata) | |||
132 | } | 149 | } |
133 | 150 | ||
134 | /** | 151 | /** |
135 | * eeh_report_mmio_enabled - tell drivers that MMIO has been enabled | 152 | * eeh_report_mmio_enabled - Tell drivers that MMIO has been enabled |
153 | * @dev: PCI device | ||
154 | * @userdata: return value | ||
136 | * | 155 | * |
137 | * Tells each device driver that IO ports, MMIO and config space I/O | 156 | * Tells each device driver that IO ports, MMIO and config space I/O |
138 | * are now enabled. Collects up and merges the device driver responses. | 157 | * are now enabled. Collects up and merges the device driver responses. |
139 | * Cumulative response passed back in "userdata". | 158 | * Cumulative response passed back in "userdata". |
140 | */ | 159 | */ |
141 | |||
142 | static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) | 160 | static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) |
143 | { | 161 | { |
144 | enum pci_ers_result rc, *res = userdata; | 162 | enum pci_ers_result rc, *res = userdata; |
@@ -149,7 +167,7 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) | |||
149 | !driver->err_handler->mmio_enabled) | 167 | !driver->err_handler->mmio_enabled) |
150 | return 0; | 168 | return 0; |
151 | 169 | ||
152 | rc = driver->err_handler->mmio_enabled (dev); | 170 | rc = driver->err_handler->mmio_enabled(dev); |
153 | 171 | ||
154 | /* A driver that needs a reset trumps all others */ | 172 | /* A driver that needs a reset trumps all others */ |
155 | if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; | 173 | if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; |
@@ -159,9 +177,15 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) | |||
159 | } | 177 | } |
160 | 178 | ||
161 | /** | 179 | /** |
162 | * eeh_report_reset - tell device that slot has been reset | 180 | * eeh_report_reset - Tell device that slot has been reset |
181 | * @dev: PCI device | ||
182 | * @userdata: return value | ||
183 | * | ||
184 | * This routine must be called while EEH tries to reset particular | ||
185 | * PCI device so that the associated PCI device driver could take | ||
186 | * some actions, usually to save data the driver needs so that the | ||
187 | * driver can work again while the device is recovered. | ||
163 | */ | 188 | */ |
164 | |||
165 | static int eeh_report_reset(struct pci_dev *dev, void *userdata) | 189 | static int eeh_report_reset(struct pci_dev *dev, void *userdata) |
166 | { | 190 | { |
167 | enum pci_ers_result rc, *res = userdata; | 191 | enum pci_ers_result rc, *res = userdata; |
@@ -188,9 +212,14 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata) | |||
188 | } | 212 | } |
189 | 213 | ||
190 | /** | 214 | /** |
191 | * eeh_report_resume - tell device to resume normal operations | 215 | * eeh_report_resume - Tell device to resume normal operations |
216 | * @dev: PCI device | ||
217 | * @userdata: return value | ||
218 | * | ||
219 | * This routine must be called to notify the device driver that it | ||
220 | * could resume so that the device driver can do some initialization | ||
221 | * to make the recovered device work again. | ||
192 | */ | 222 | */ |
193 | |||
194 | static int eeh_report_resume(struct pci_dev *dev, void *userdata) | 223 | static int eeh_report_resume(struct pci_dev *dev, void *userdata) |
195 | { | 224 | { |
196 | struct pci_driver *driver = dev->driver; | 225 | struct pci_driver *driver = dev->driver; |
@@ -212,12 +241,13 @@ static int eeh_report_resume(struct pci_dev *dev, void *userdata) | |||
212 | } | 241 | } |
213 | 242 | ||
214 | /** | 243 | /** |
215 | * eeh_report_failure - tell device driver that device is dead. | 244 | * eeh_report_failure - Tell device driver that device is dead. |
245 | * @dev: PCI device | ||
246 | * @userdata: return value | ||
216 | * | 247 | * |
217 | * This informs the device driver that the device is permanently | 248 | * This informs the device driver that the device is permanently |
218 | * dead, and that no further recovery attempts will be made on it. | 249 | * dead, and that no further recovery attempts will be made on it. |
219 | */ | 250 | */ |
220 | |||
221 | static int eeh_report_failure(struct pci_dev *dev, void *userdata) | 251 | static int eeh_report_failure(struct pci_dev *dev, void *userdata) |
222 | { | 252 | { |
223 | struct pci_driver *driver = dev->driver; | 253 | struct pci_driver *driver = dev->driver; |
@@ -238,37 +268,16 @@ static int eeh_report_failure(struct pci_dev *dev, void *userdata) | |||
238 | return 0; | 268 | return 0; |
239 | } | 269 | } |
240 | 270 | ||
241 | /* ------------------------------------------------------- */ | ||
242 | /** | 271 | /** |
243 | * handle_eeh_events -- reset a PCI device after hard lockup. | 272 | * eeh_reset_device - Perform actual reset of a pci slot |
244 | * | 273 | * @pe_dn: PE associated device node |
245 | * pSeries systems will isolate a PCI slot if the PCI-Host | 274 | * @bus: PCI bus corresponding to the isolcated slot |
246 | * bridge detects address or data parity errors, DMA's | ||
247 | * occurring to wild addresses (which usually happen due to | ||
248 | * bugs in device drivers or in PCI adapter firmware). | ||
249 | * Slot isolations also occur if #SERR, #PERR or other misc | ||
250 | * PCI-related errors are detected. | ||
251 | * | 275 | * |
252 | * Recovery process consists of unplugging the device driver | 276 | * This routine must be called to do reset on the indicated PE. |
253 | * (which generated hotplug events to userspace), then issuing | 277 | * During the reset, udev might be invoked because those affected |
254 | * a PCI #RST to the device, then reconfiguring the PCI config | 278 | * PCI devices will be removed and then added. |
255 | * space for all bridges & devices under this slot, and then | ||
256 | * finally restarting the device drivers (which cause a second | ||
257 | * set of hotplug events to go out to userspace). | ||
258 | */ | 279 | */ |
259 | 280 | static int eeh_reset_device(struct pci_dn *pe_dn, struct pci_bus *bus) | |
260 | /** | ||
261 | * eeh_reset_device() -- perform actual reset of a pci slot | ||
262 | * @bus: pointer to the pci bus structure corresponding | ||
263 | * to the isolated slot. A non-null value will | ||
264 | * cause all devices under the bus to be removed | ||
265 | * and then re-added. | ||
266 | * @pe_dn: pointer to a "Partionable Endpoint" device node. | ||
267 | * This is the top-level structure on which pci | ||
268 | * bus resets can be performed. | ||
269 | */ | ||
270 | |||
271 | static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus) | ||
272 | { | 281 | { |
273 | struct device_node *dn; | 282 | struct device_node *dn; |
274 | int cnt, rc; | 283 | int cnt, rc; |
@@ -281,12 +290,13 @@ static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus) | |||
281 | 290 | ||
282 | /* Reset the pci controller. (Asserts RST#; resets config space). | 291 | /* Reset the pci controller. (Asserts RST#; resets config space). |
283 | * Reconfigure bridges and devices. Don't try to bring the system | 292 | * Reconfigure bridges and devices. Don't try to bring the system |
284 | * up if the reset failed for some reason. */ | 293 | * up if the reset failed for some reason. |
294 | */ | ||
285 | rc = eeh_reset_pe(pe_dn); | 295 | rc = eeh_reset_pe(pe_dn); |
286 | if (rc) | 296 | if (rc) |
287 | return rc; | 297 | return rc; |
288 | 298 | ||
289 | /* Walk over all functions on this device. */ | 299 | /* Walk over all functions on this device. */ |
290 | dn = pe_dn->node; | 300 | dn = pe_dn->node; |
291 | if (!pcibios_find_pci_bus(dn) && PCI_DN(dn->parent)) | 301 | if (!pcibios_find_pci_bus(dn) && PCI_DN(dn->parent)) |
292 | dn = dn->parent->child; | 302 | dn = dn->parent->child; |
@@ -308,7 +318,7 @@ static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus) | |||
308 | * potentially weird things happen. | 318 | * potentially weird things happen. |
309 | */ | 319 | */ |
310 | if (bus) { | 320 | if (bus) { |
311 | ssleep (5); | 321 | ssleep(5); |
312 | pcibios_add_pci_devices(bus); | 322 | pcibios_add_pci_devices(bus); |
313 | } | 323 | } |
314 | pe_dn->eeh_freeze_count = cnt; | 324 | pe_dn->eeh_freeze_count = cnt; |
@@ -321,7 +331,24 @@ static int eeh_reset_device (struct pci_dn *pe_dn, struct pci_bus *bus) | |||
321 | */ | 331 | */ |
322 | #define MAX_WAIT_FOR_RECOVERY 150 | 332 | #define MAX_WAIT_FOR_RECOVERY 150 |
323 | 333 | ||
324 | struct pci_dn * handle_eeh_events (struct eeh_event *event) | 334 | /** |
335 | * eeh_handle_event - Reset a PCI device after hard lockup. | ||
336 | * @event: EEH event | ||
337 | * | ||
338 | * While PHB detects address or data parity errors on particular PCI | ||
339 | * slot, the associated PE will be frozen. Besides, DMA's occurring | ||
340 | * to wild addresses (which usually happen due to bugs in device | ||
341 | * drivers or in PCI adapter firmware) can cause EEH error. #SERR, | ||
342 | * #PERR or other misc PCI-related errors also can trigger EEH errors. | ||
343 | * | ||
344 | * Recovery process consists of unplugging the device driver (which | ||
345 | * generated hotplug events to userspace), then issuing a PCI #RST to | ||
346 | * the device, then reconfiguring the PCI config space for all bridges | ||
347 | * & devices under this slot, and then finally restarting the device | ||
348 | * drivers (which cause a second set of hotplug events to go out to | ||
349 | * userspace). | ||
350 | */ | ||
351 | struct pci_dn *handle_eeh_events(struct eeh_event *event) | ||
325 | { | 352 | { |
326 | struct device_node *frozen_dn; | 353 | struct device_node *frozen_dn; |
327 | struct pci_dn *frozen_pdn; | 354 | struct pci_dn *frozen_pdn; |
@@ -350,9 +377,10 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) | |||
350 | * which was always an EADS pci bridge. In the new style, | 377 | * which was always an EADS pci bridge. In the new style, |
351 | * there might not be any EADS bridges, and even when there are, | 378 | * there might not be any EADS bridges, and even when there are, |
352 | * the firmware marks them as "EEH incapable". So another | 379 | * the firmware marks them as "EEH incapable". So another |
353 | * two-step is needed to find the pci bus.. */ | 380 | * two-step is needed to find the pci bus.. |
381 | */ | ||
354 | if (!frozen_bus) | 382 | if (!frozen_bus) |
355 | frozen_bus = pcibios_find_pci_bus (frozen_dn->parent); | 383 | frozen_bus = pcibios_find_pci_bus(frozen_dn->parent); |
356 | 384 | ||
357 | if (!frozen_bus) { | 385 | if (!frozen_bus) { |
358 | printk(KERN_ERR "EEH: Cannot find PCI bus " | 386 | printk(KERN_ERR "EEH: Cannot find PCI bus " |
@@ -395,7 +423,8 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event) | |||
395 | pci_walk_bus(frozen_bus, eeh_report_error, &result); | 423 | pci_walk_bus(frozen_bus, eeh_report_error, &result); |
396 | 424 | ||
397 | /* Get the current PCI slot state. This can take a long time, | 425 | /* Get the current PCI slot state. This can take a long time, |
398 | * sometimes over 3 seconds for certain systems. */ | 426 | * sometimes over 3 seconds for certain systems. |
427 | */ | ||
399 | rc = eeh_ops->wait_state(frozen_pdn->node, MAX_WAIT_FOR_RECOVERY*1000); | 428 | rc = eeh_ops->wait_state(frozen_pdn->node, MAX_WAIT_FOR_RECOVERY*1000); |
400 | if (rc < 0 || rc == EEH_STATE_NOT_SUPPORT) { | 429 | if (rc < 0 || rc == EEH_STATE_NOT_SUPPORT) { |
401 | printk(KERN_WARNING "EEH: Permanent failure\n"); | 430 | printk(KERN_WARNING "EEH: Permanent failure\n"); |
@@ -508,4 +537,3 @@ perm_error: | |||
508 | return NULL; | 537 | return NULL; |
509 | } | 538 | } |
510 | 539 | ||
511 | /* ---------- end of file ---------- */ | ||
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index d2383cfb6dfd..e98347cb9cc0 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * eeh_event.c | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 2 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 3 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or | 4 | * the Free Software Foundation; either version 2 of the License, or |
@@ -46,7 +44,7 @@ DECLARE_WORK(eeh_event_wq, eeh_thread_launcher); | |||
46 | DEFINE_MUTEX(eeh_event_mutex); | 44 | DEFINE_MUTEX(eeh_event_mutex); |
47 | 45 | ||
48 | /** | 46 | /** |
49 | * eeh_event_handler - dispatch EEH events. | 47 | * eeh_event_handler - Dispatch EEH events. |
50 | * @dummy - unused | 48 | * @dummy - unused |
51 | * | 49 | * |
52 | * The detection of a frozen slot can occur inside an interrupt, | 50 | * The detection of a frozen slot can occur inside an interrupt, |
@@ -61,7 +59,7 @@ static int eeh_event_handler(void * dummy) | |||
61 | struct eeh_event *event; | 59 | struct eeh_event *event; |
62 | struct pci_dn *pdn; | 60 | struct pci_dn *pdn; |
63 | 61 | ||
64 | daemonize ("eehd"); | 62 | daemonize("eehd"); |
65 | set_current_state(TASK_INTERRUPTIBLE); | 63 | set_current_state(TASK_INTERRUPTIBLE); |
66 | 64 | ||
67 | spin_lock_irqsave(&eeh_eventlist_lock, flags); | 65 | spin_lock_irqsave(&eeh_eventlist_lock, flags); |
@@ -93,7 +91,7 @@ static int eeh_event_handler(void * dummy) | |||
93 | 91 | ||
94 | /* If there are no new errors after an hour, clear the counter. */ | 92 | /* If there are no new errors after an hour, clear the counter. */ |
95 | if (pdn && pdn->eeh_freeze_count>0) { | 93 | if (pdn && pdn->eeh_freeze_count>0) { |
96 | msleep_interruptible (3600*1000); | 94 | msleep_interruptible(3600*1000); |
97 | if (pdn->eeh_freeze_count>0) | 95 | if (pdn->eeh_freeze_count>0) |
98 | pdn->eeh_freeze_count--; | 96 | pdn->eeh_freeze_count--; |
99 | } | 97 | } |
@@ -102,8 +100,11 @@ static int eeh_event_handler(void * dummy) | |||
102 | } | 100 | } |
103 | 101 | ||
104 | /** | 102 | /** |
105 | * eeh_thread_launcher | 103 | * eeh_thread_launcher - Start kernel thread to handle EEH events |
106 | * @dummy - unused | 104 | * @dummy - unused |
105 | * | ||
106 | * This routine is called to start the kernel thread for processing | ||
107 | * EEH event. | ||
107 | */ | 108 | */ |
108 | static void eeh_thread_launcher(struct work_struct *dummy) | 109 | static void eeh_thread_launcher(struct work_struct *dummy) |
109 | { | 110 | { |
@@ -112,14 +113,14 @@ static void eeh_thread_launcher(struct work_struct *dummy) | |||
112 | } | 113 | } |
113 | 114 | ||
114 | /** | 115 | /** |
115 | * eeh_send_failure_event - generate a PCI error event | 116 | * eeh_send_failure_event - Generate a PCI error event |
116 | * @dev pci device | 117 | * @dev: pci device |
117 | * | 118 | * |
118 | * This routine can be called within an interrupt context; | 119 | * This routine can be called within an interrupt context; |
119 | * the actual event will be delivered in a normal context | 120 | * the actual event will be delivered in a normal context |
120 | * (from a workqueue). | 121 | * (from a workqueue). |
121 | */ | 122 | */ |
122 | int eeh_send_failure_event (struct device_node *dn, | 123 | int eeh_send_failure_event(struct device_node *dn, |
123 | struct pci_dev *dev) | 124 | struct pci_dev *dev) |
124 | { | 125 | { |
125 | unsigned long flags; | 126 | unsigned long flags; |
@@ -135,7 +136,7 @@ int eeh_send_failure_event (struct device_node *dn, | |||
135 | } | 136 | } |
136 | event = kmalloc(sizeof(*event), GFP_ATOMIC); | 137 | event = kmalloc(sizeof(*event), GFP_ATOMIC); |
137 | if (event == NULL) { | 138 | if (event == NULL) { |
138 | printk (KERN_ERR "EEH: out of memory, event not handled\n"); | 139 | printk(KERN_ERR "EEH: out of memory, event not handled\n"); |
139 | return 1; | 140 | return 1; |
140 | } | 141 | } |
141 | 142 | ||
@@ -154,5 +155,3 @@ int eeh_send_failure_event (struct device_node *dn, | |||
154 | 155 | ||
155 | return 0; | 156 | return 0; |
156 | } | 157 | } |
157 | |||
158 | /********************** END OF FILE ******************************/ | ||
diff --git a/arch/powerpc/platforms/pseries/eeh_sysfs.c b/arch/powerpc/platforms/pseries/eeh_sysfs.c index eb744ee234da..5e4eab1f4441 100644 --- a/arch/powerpc/platforms/pseries/eeh_sysfs.c +++ b/arch/powerpc/platforms/pseries/eeh_sysfs.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <asm/pci-bridge.h> | 28 | #include <asm/pci-bridge.h> |
29 | 29 | ||
30 | /** | 30 | /** |
31 | * EEH_SHOW_ATTR -- create sysfs entry for eeh statistic | 31 | * EEH_SHOW_ATTR -- Create sysfs entry for eeh statistic |
32 | * @_name: name of file in sysfs directory | 32 | * @_name: name of file in sysfs directory |
33 | * @_memb: name of member in struct pci_dn to access | 33 | * @_memb: name of member in struct pci_dn to access |
34 | * @_format: printf format for display | 34 | * @_format: printf format for display |