diff options
author | Christoph Hellwig <hch@lst.de> | 2005-11-29 21:36:16 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-29 13:03:01 -0800 |
commit | 238f9b063dcc9f23493a0d3fecca29fe332d4905 (patch) | |
tree | a2ddb44e978ade378774290a4fb697a232a890b6 /drivers/scsi/megaraid.c | |
parent | 238f58d898df941aa9d1cb390fb27ff4febe8965 (diff) |
[PATCH] fix megaraid.c locking
This fixes locking in megaraid.c, namely:
(1) make sure megaraid_queue release the adapter lock by changing the
code to have a single return
(2) remove the errornous scsi_assign_lock call
Testing by Burton Windle.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Burton Windle <bwindle@fint.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r-- | drivers/scsi/megaraid.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index dfea346b00a5..f9792528e33f 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -380,23 +380,23 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) spin_lock_irqsave(&adapter->lock, flags); scb = mega_build_cmd(adapter, scmd, &busy); + if (!scb) + goto out; - if(scb) { - scb->state |= SCB_PENDQ; - list_add_tail(&scb->list, &adapter->pending_list); + scb->state |= SCB_PENDQ; + list_add_tail(&scb->list, &adapter->pending_list); - /* - * Check if the HBA is in quiescent state, e.g., during a - * delete logical drive opertion. If it is, don't run - * the pending_list. - */ - if(atomic_read(&adapter->quiescent) == 0) { - mega_runpendq(adapter); - } - return 0; - } - spin_unlock_irqrestore(&adapter->lock, flags); + /* + * Check if the HBA is in quiescent state, e.g., during a + * delete logical drive opertion. If it is, don't run + * the pending_list. + */ + if (atomic_read(&adapter->quiescent) == 0) + mega_runpendq(adapter); + busy = 0; + out: + spin_unlock_irqrestore(&adapter->lock, flags); return busy; } @@ -4677,7 +4677,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) adapter->flag = flag; spin_lock_init(&adapter->lock); - scsi_assign_lock(host, &adapter->lock); host->cmd_per_lun = max_cmd_per_lun; host->max_sectors = max_sectors_per_io; |