aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorMaxim Shchetynin <maxim@de.ibm.com>2007-08-22 13:01:27 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-25 02:58:27 -0400
commitfedcd2c53d838e7a69df699ce2a14e45d34d7f7f (patch)
tree24b1c61d889f836c31103ab67e1ce491fa7b42c9 /arch/powerpc/sysdev
parent3addf55c9415f9da039947b33d064332137e49fe (diff)
[POWERPC] axonram: Module modification for latest firmware API changes
Firmware would not deliver two interrupt numbers in device-tree any more but only one, for correctable ECC, because uncorrectable ECC from now is handled by firmware itself. Changes in the axonram module are necessary because in the old version, if it is not allowed to fetch the second interrupt number from device-tree, it interpretes this as an error case and exits. Signed-off-by: Maximilian <maxim@de.ibm.com> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/axonram.c43
1 files changed, 11 insertions, 32 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 2326d5dc5752..eabbf82fda3a 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -59,8 +59,7 @@
59struct axon_ram_bank { 59struct axon_ram_bank {
60 struct of_device *device; 60 struct of_device *device;
61 struct gendisk *disk; 61 struct gendisk *disk;
62 unsigned int irq_correctable; 62 unsigned int irq_id;
63 unsigned int irq_uncorrectable;
64 unsigned long ph_addr; 63 unsigned long ph_addr;
65 unsigned long io_addr; 64 unsigned long io_addr;
66 unsigned long size; 65 unsigned long size;
@@ -93,16 +92,9 @@ axon_ram_irq_handler(int irq, void *dev)
93 92
94 BUG_ON(!bank); 93 BUG_ON(!bank);
95 94
96 if (irq == bank->irq_correctable) { 95 dev_err(&device->dev, "Correctable memory error occured\n");
97 dev_err(&device->dev, "Correctable memory error occured\n"); 96 bank->ecc_counter++;
98 bank->ecc_counter++; 97 return IRQ_HANDLED;
99 return IRQ_HANDLED;
100 } else if (irq == bank->irq_uncorrectable) {
101 dev_err(&device->dev, "Uncorrectable memory error occured\n");
102 panic("Critical ECC error on %s", device->node->full_name);
103 }
104
105 return IRQ_NONE;
106} 98}
107 99
108/** 100/**
@@ -259,28 +251,18 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
259 blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); 251 blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
260 add_disk(bank->disk); 252 add_disk(bank->disk);
261 253
262 bank->irq_correctable = irq_of_parse_and_map(device->node, 0); 254 bank->irq_id = irq_of_parse_and_map(device->node, 0);
263 bank->irq_uncorrectable = irq_of_parse_and_map(device->node, 1); 255 if (bank->irq_id == NO_IRQ) {
264 if ((bank->irq_correctable <= 0) || (bank->irq_uncorrectable <= 0)) {
265 dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); 256 dev_err(&device->dev, "Cannot access ECC interrupt ID\n");
266 rc = -EFAULT; 257 rc = -EFAULT;
267 goto failed; 258 goto failed;
268 } 259 }
269 260
270 rc = request_irq(bank->irq_correctable, axon_ram_irq_handler, 261 rc = request_irq(bank->irq_id, axon_ram_irq_handler,
271 AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
272 if (rc != 0) {
273 dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
274 bank->irq_correctable = bank->irq_uncorrectable = 0;
275 rc = -EFAULT;
276 goto failed;
277 }
278
279 rc = request_irq(bank->irq_uncorrectable, axon_ram_irq_handler,
280 AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); 262 AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
281 if (rc != 0) { 263 if (rc != 0) {
282 dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); 264 dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
283 bank->irq_uncorrectable = 0; 265 bank->irq_id = NO_IRQ;
284 rc = -EFAULT; 266 rc = -EFAULT;
285 goto failed; 267 goto failed;
286 } 268 }
@@ -296,10 +278,8 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
296 278
297failed: 279failed:
298 if (bank != NULL) { 280 if (bank != NULL) {
299 if (bank->irq_uncorrectable > 0) 281 if (bank->irq_id != NO_IRQ)
300 free_irq(bank->irq_uncorrectable, device); 282 free_irq(bank->irq_id, device);
301 if (bank->irq_correctable > 0)
302 free_irq(bank->irq_correctable, device);
303 if (bank->disk != NULL) { 283 if (bank->disk != NULL) {
304 if (bank->disk->queue != NULL) 284 if (bank->disk->queue != NULL)
305 blk_cleanup_queue(bank->disk->queue); 285 blk_cleanup_queue(bank->disk->queue);
@@ -329,8 +309,7 @@ axon_ram_remove(struct of_device *device)
329 BUG_ON(!bank || !bank->disk); 309 BUG_ON(!bank || !bank->disk);
330 310
331 device_remove_file(&device->dev, &dev_attr_ecc); 311 device_remove_file(&device->dev, &dev_attr_ecc);
332 free_irq(bank->irq_uncorrectable, device); 312 free_irq(bank->irq_id, device);
333 free_irq(bank->irq_correctable, device);
334 blk_cleanup_queue(bank->disk->queue); 313 blk_cleanup_queue(bank->disk->queue);
335 unregister_blkdev(bank->disk->major, bank->disk->disk_name); 314 unregister_blkdev(bank->disk->major, bank->disk->disk_name);
336 del_gendisk(bank->disk); 315 del_gendisk(bank->disk);