Skip to contentSkip to conversation

qla1280: Drop host_lock while requesting firmware

PATCH In review Ben Hutchings 2 participants 2 messages Aug 23, 2009 – Aug 24, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 qla1280: Drop host_lock while requesting firmware

request_firmware() may sleep and it appears to be safe to release the spinlock here.

---
Scott Bailey <[email protected]> tested this change to the two separate functions qla1280_load_firmware_{pio,dma}() in 2.6.30. I'm not adding Tested-by since he didn't test this exact code.

Ben.

 drivers/scsi/qla1280.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/qla1280.c +2 -0
index 4951344..492492d 100644
@@ -1803,8 +1803,10 @@ qla1280_load_firmware(struct scsi_qla_host *ha)
 	if (err)
 		return err;
 
+	spin_unlock_irq(ha->host->host_lock);
 	err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
 			       &ha->pdev->dev);
+	spin_lock_irq(ha->host->host_lock);
 	if (err) {
 		printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
 		       ql1280_board_tbl[ha->devnum].fwname, err);
Signature · 1 line
1.6.3.3
#1 lore raw

Thanks, Ben.

Seems good to me.
--
JSR

Quoted 30 lines · Ben Hutchings

request_firmware() may sleep and it appears to be safe to release the spinlock here.

---
Scott Bailey <[email protected]> tested this change to the two separate functions qla1280_load_firmware_{pio,dma}() in 2.6.30.  I'm not adding Tested-by since he didn't test this exact code.

Ben.

 drivers/scsi/qla1280.c |    2 ++

 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/scsi/qla1280.c +2 -1
index 4951344..492492d 100644
@@ -1803,8 +1803,10 @@ qla1280_load_firmware(struct scsi_qla_host *ha)
        if (err)
                return err;
 
+       spin_unlock_irq(ha->host->host_lock);
        err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
                               &ha->pdev->dev);
+       spin_lock_irq(ha->host->host_lock);
        if (err) {
                printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
                       ql1280_board_tbl[ha->devnum].fwname, err);
--
Quoted 3 lines

1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html