diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2007-10-01 10:33:54 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:25:58 -0400 |
commit | 32f6fff47df65d25d3dedbd2953508c05225b726 (patch) | |
tree | 261c1f176f7d0ab59c009f54e58f20ddff1d2f73 | |
parent | 4a24d8610df542b6599a65b100d438df144574de (diff) |
Sysace: Move IRQ handler registration to occur after FSM is initialized
The FSM needs to be initialized before it is safe to call the ISR
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | drivers/block/xsysace.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 10bb4e54f685..296d5674a3c1 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -949,15 +949,6 @@ static int __devinit ace_setup(struct ace_device *ace) | |||
949 | if (!ace->baseaddr) | 949 | if (!ace->baseaddr) |
950 | goto err_ioremap; | 950 | goto err_ioremap; |
951 | 951 | ||
952 | if (ace->irq != NO_IRQ) { | ||
953 | rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace); | ||
954 | if (rc) { | ||
955 | /* Failure - fall back to polled mode */ | ||
956 | dev_err(ace->dev, "request_irq failed\n"); | ||
957 | ace->irq = NO_IRQ; | ||
958 | } | ||
959 | } | ||
960 | |||
961 | /* | 952 | /* |
962 | * Initialize the state machine tasklet and stall timer | 953 | * Initialize the state machine tasklet and stall timer |
963 | */ | 954 | */ |
@@ -1015,6 +1006,16 @@ static int __devinit ace_setup(struct ace_device *ace) | |||
1015 | val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ; | 1006 | val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ; |
1016 | ace_out(ace, ACE_CTRL, val); | 1007 | ace_out(ace, ACE_CTRL, val); |
1017 | 1008 | ||
1009 | /* Now we can hook up the irq handler */ | ||
1010 | if (ace->irq != NO_IRQ) { | ||
1011 | rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace); | ||
1012 | if (rc) { | ||
1013 | /* Failure - fall back to polled mode */ | ||
1014 | dev_err(ace->dev, "request_irq failed\n"); | ||
1015 | ace->irq = NO_IRQ; | ||
1016 | } | ||
1017 | } | ||
1018 | |||
1018 | /* Print the identification */ | 1019 | /* Print the identification */ |
1019 | dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n", | 1020 | dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n", |
1020 | (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff); | 1021 | (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff); |
@@ -1035,8 +1036,6 @@ static int __devinit ace_setup(struct ace_device *ace) | |||
1035 | blk_cleanup_queue(ace->queue); | 1036 | blk_cleanup_queue(ace->queue); |
1036 | err_blk_initq: | 1037 | err_blk_initq: |
1037 | iounmap(ace->baseaddr); | 1038 | iounmap(ace->baseaddr); |
1038 | if (ace->irq != NO_IRQ) | ||
1039 | free_irq(ace->irq, ace); | ||
1040 | err_ioremap: | 1039 | err_ioremap: |
1041 | dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n", | 1040 | dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n", |
1042 | ace->physaddr); | 1041 | ace->physaddr); |