diff options
author | Anton Blanchard <anton@samba.org> | 2010-07-13 00:59:29 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 12:53:23 -0400 |
commit | 8f83d7688026729c9d356d865f65a8996f090048 (patch) | |
tree | 26f20f62b5198a048d2b621a1c53247304135a2b | |
parent | 8d88cf3f3b9af4713642caeb221b6d6a42019001 (diff) |
[SCSI] ibmvscsi: Fix oops when an interrupt is pending during probe
A driver needs to be ready to take an interrupt as soon as it registers
an interrupt handler. I noticed the following oops when testing kdump:
ipr: IBM Power RAID SCSI Device Driver version: 2.5.0 (February 11, 2010)
ibmvscsi 30000002: SRP_VERSION: 16.a
ibmvscsi 30000002: SRP_VERSION: 16.a
Unable to handle kernel paging request for data at address 0x00000000
...
pc: c000000004085e34: .tasklet_action+0xf4/0x1dc
...
c000000004086fe4 .__do_softirq+0x16c/0x2c0
c00000000403138c .call_do_softirq+0x14/0x24
c00000000400ee14 .do_softirq+0xa0/0x104
c00000000408690c .irq_exit+0x70/0xd0
c00000000400f190 .do_IRQ+0x214/0x2a8
c000000004004804 hardware_interrupt_entry+0x1c/0x98
--- Exception: 501 (Hardware Interrupt) at c00000000400c544 .raw_local_irq_restore+0x48/0x54
c00000000465d2a8 ._raw_spin_unlock_irqrestore+0x74/0xa0
c0000000040e7f00 .__setup_irq+0x2ec/0x3f0
c0000000040e8198 .request_threaded_irq+0x194/0x22c
c00000000446d854 .rpavscsi_init_crq_queue+0x284/0x3f0
c00000000446c764 .ibmvscsi_probe+0x688/0x710
c00000000402903c .vio_bus_probe+0x37c/0x3e4
c000000004403f10 .driver_probe_device+0xec/0x1b8
c000000004404088 .__driver_attach+0xac/0xf4
c000000004403184 .bus_for_each_dev+0x98/0x104
c000000004403c98 .driver_attach+0x40/0x60
c0000000044026f0 .bus_add_driver+0x154/0x324
c0000000044045d0 .driver_register+0xe8/0x1ac
c00000000402b2a8 .vio_register_driver+0x54/0x74
c000000004933ea4 .ibmvscsi_module_init+0x80/0xc0
c000000004009834 .do_one_initcall+0x98/0x1d8
c0000000049005b4 .kernel_init+0x27c/0x33c
c000000004031550 .kernel_thread+0x54/0x70
srp_task needs to be setup before request_irq. The patch below fixes the oops.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/ibmvscsi/rpa_vscsi.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index a864ccc0a342..989b9a8ba72d 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c | |||
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
277 | goto reg_crq_failed; | 277 | goto reg_crq_failed; |
278 | } | 278 | } |
279 | 279 | ||
280 | queue->cur = 0; | ||
281 | spin_lock_init(&queue->lock); | ||
282 | |||
283 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
284 | (unsigned long)hostdata); | ||
285 | |||
280 | if (request_irq(vdev->irq, | 286 | if (request_irq(vdev->irq, |
281 | rpavscsi_handle_event, | 287 | rpavscsi_handle_event, |
282 | 0, "ibmvscsi", (void *)hostdata) != 0) { | 288 | 0, "ibmvscsi", (void *)hostdata) != 0) { |
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
291 | goto req_irq_failed; | 297 | goto req_irq_failed; |
292 | } | 298 | } |
293 | 299 | ||
294 | queue->cur = 0; | ||
295 | spin_lock_init(&queue->lock); | ||
296 | |||
297 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
298 | (unsigned long)hostdata); | ||
299 | |||
300 | return retrc; | 300 | return retrc; |
301 | 301 | ||
302 | req_irq_failed: | 302 | req_irq_failed: |
303 | tasklet_kill(&hostdata->srp_task); | ||
303 | do { | 304 | do { |
304 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); | 305 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); |
305 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); | 306 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); |