* [PATCH] qla1280: Drop host_lock while requesting firmware
@ 2010-01-23 18:40 Ben Hutchings
2010-01-23 19:17 ` Rolf Eike Beer
0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2010-01-23 18:40 UTC (permalink / raw)
To: James E.J. Bottomley; +Cc: linux-scsi, 543244
request_firmware() may sleep and it appears to be safe to release the
spinlock here.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org
---
This change was made in Debian kernel packages to address this bug
report: <http://bugs.debian.org/543244>. We have applied it to 2.6.31
and 2.6.32 and there have been no further bug reports on this driver.
Ben.
drivers/scsi/qla1280.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 8371d91..49ac414 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -1640,8 +1640,10 @@ qla1280_load_firmware_pio(struct scsi_qla_host *ha)
uint16_t mb[MAILBOX_REGISTER_COUNT], i;
int 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);
@@ -1699,8 +1701,10 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
return -ENOMEM;
#endif
+ 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);
--
1.6.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qla1280: Drop host_lock while requesting firmware
2010-01-23 18:40 [PATCH] qla1280: Drop host_lock while requesting firmware Ben Hutchings
@ 2010-01-23 19:17 ` Rolf Eike Beer
0 siblings, 0 replies; 2+ messages in thread
From: Rolf Eike Beer @ 2010-01-23 19:17 UTC (permalink / raw)
To: Ben Hutchings; +Cc: James E.J. Bottomley, linux-scsi
[-- Attachment #1: Type: Text/Plain, Size: 1218 bytes --]
Ben Hutchings wrote:
> request_firmware() may sleep and it appears to be safe to release the
> spinlock here.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> Cc: stable@kernel.org
> ---
> This change was made in Debian kernel packages to address this bug
> report: <http://bugs.debian.org/543244>. We have applied it to 2.6.31
> and 2.6.32 and there have been no further bug reports on this driver.
>
> Ben.
>
> drivers/scsi/qla1280.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
> index 8371d91..49ac414 100644
> --- a/drivers/scsi/qla1280.c
> +++ b/drivers/scsi/qla1280.c
> @@ -1640,8 +1640,10 @@ qla1280_load_firmware_pio(struct scsi_qla_host *ha)
I think that those request_firmware stuff together with it's error handling
should be moved from qla1280_load_firmware_pio() and
qla1280_load_firmware_dma() to qla1280_load_firmware().
Although the firmware version in the driver struct is updated before it is
updated, which may still fail. In that case it is not set back to the old
value. I don't know if that is a problem at all, that's just what I saw on a
quick look.
Eike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-23 19:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-23 18:40 [PATCH] qla1280: Drop host_lock while requesting firmware Ben Hutchings
2010-01-23 19:17 ` Rolf Eike Beer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox