Commit fedcd2c5 authored by Maxim Shchetynin's avatar Maxim Shchetynin Committed by Paul Mackerras

[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: default avatarMaximilian <maxim@de.ibm.com>
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 3addf55c
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
struct axon_ram_bank { struct axon_ram_bank {
struct of_device *device; struct of_device *device;
struct gendisk *disk; struct gendisk *disk;
unsigned int irq_correctable; unsigned int irq_id;
unsigned int irq_uncorrectable;
unsigned long ph_addr; unsigned long ph_addr;
unsigned long io_addr; unsigned long io_addr;
unsigned long size; unsigned long size;
...@@ -93,16 +92,9 @@ axon_ram_irq_handler(int irq, void *dev) ...@@ -93,16 +92,9 @@ axon_ram_irq_handler(int irq, void *dev)
BUG_ON(!bank); BUG_ON(!bank);
if (irq == bank->irq_correctable) {
dev_err(&device->dev, "Correctable memory error occured\n"); dev_err(&device->dev, "Correctable memory error occured\n");
bank->ecc_counter++; bank->ecc_counter++;
return IRQ_HANDLED; return IRQ_HANDLED;
} else if (irq == bank->irq_uncorrectable) {
dev_err(&device->dev, "Uncorrectable memory error occured\n");
panic("Critical ECC error on %s", device->node->full_name);
}
return IRQ_NONE;
} }
/** /**
...@@ -259,28 +251,18 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id) ...@@ -259,28 +251,18 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
add_disk(bank->disk); add_disk(bank->disk);
bank->irq_correctable = irq_of_parse_and_map(device->node, 0); bank->irq_id = irq_of_parse_and_map(device->node, 0);
bank->irq_uncorrectable = irq_of_parse_and_map(device->node, 1); if (bank->irq_id == NO_IRQ) {
if ((bank->irq_correctable <= 0) || (bank->irq_uncorrectable <= 0)) {
dev_err(&device->dev, "Cannot access ECC interrupt ID\n"); dev_err(&device->dev, "Cannot access ECC interrupt ID\n");
rc = -EFAULT; rc = -EFAULT;
goto failed; goto failed;
} }
rc = request_irq(bank->irq_correctable, axon_ram_irq_handler, rc = request_irq(bank->irq_id, axon_ram_irq_handler,
AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
if (rc != 0) {
dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
bank->irq_correctable = bank->irq_uncorrectable = 0;
rc = -EFAULT;
goto failed;
}
rc = request_irq(bank->irq_uncorrectable, axon_ram_irq_handler,
AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device); AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
if (rc != 0) { if (rc != 0) {
dev_err(&device->dev, "Cannot register ECC interrupt handler\n"); dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
bank->irq_uncorrectable = 0; bank->irq_id = NO_IRQ;
rc = -EFAULT; rc = -EFAULT;
goto failed; goto failed;
} }
...@@ -296,10 +278,8 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id) ...@@ -296,10 +278,8 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
failed: failed:
if (bank != NULL) { if (bank != NULL) {
if (bank->irq_uncorrectable > 0) if (bank->irq_id != NO_IRQ)
free_irq(bank->irq_uncorrectable, device); free_irq(bank->irq_id, device);
if (bank->irq_correctable > 0)
free_irq(bank->irq_correctable, device);
if (bank->disk != NULL) { if (bank->disk != NULL) {
if (bank->disk->queue != NULL) if (bank->disk->queue != NULL)
blk_cleanup_queue(bank->disk->queue); blk_cleanup_queue(bank->disk->queue);
...@@ -329,8 +309,7 @@ axon_ram_remove(struct of_device *device) ...@@ -329,8 +309,7 @@ axon_ram_remove(struct of_device *device)
BUG_ON(!bank || !bank->disk); BUG_ON(!bank || !bank->disk);
device_remove_file(&device->dev, &dev_attr_ecc); device_remove_file(&device->dev, &dev_attr_ecc);
free_irq(bank->irq_uncorrectable, device); free_irq(bank->irq_id, device);
free_irq(bank->irq_correctable, device);
blk_cleanup_queue(bank->disk->queue); blk_cleanup_queue(bank->disk->queue);
unregister_blkdev(bank->disk->major, bank->disk->disk_name); unregister_blkdev(bank->disk->major, bank->disk->disk_name);
del_gendisk(bank->disk); del_gendisk(bank->disk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment