[PATCH] qla2xxx: correct locking while call starget_for_each_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Removed spin_unlock_irq()/spin_lock_irq() pairs surrounding
starget_for_each_device() calls.
As Matthew W. pointed out, starget_for_each_device() can be called under
a spinlock being held.
The change has been tested and verified on qla2xxx.ko module.
Thanks Matthew W. and Hisashi H. for help.

Signed-off-by: Andrew Vasquez <Andrew.vasquez@xxxxxxxxxx>
Signed-off-by: Seokmann Ju <Seokmann.ju@xxxxxxxxxx>
---
diff --git a/drivers/scsi/qla2xxx/qla_isr.c
b/drivers/scsi/qla2xxx/qla_isr.c index 39fd17b..ba67077 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -654,10 +654,8 @@ qla2x00_ramp_up_queue_depth(scsi_qla_host_t *ha,
srb_t
*sp)
 	    fcport->last_queue_full + ql2xqfullrampup * HZ))
 		return;

-	spin_unlock_irq(&ha->hardware_lock);
 	starget_for_each_device(sdev->sdev_target, fcport,
 	    qla2x00_adjust_sdev_qdepth_up);
-	spin_lock_irq(&ha->hardware_lock);
 }

 /**
@@ -927,10 +925,8 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void
*pkt)

 			/* Adjust queue depth for all luns on the port.
*/
 			fcport->last_queue_full = jiffies;
-			spin_unlock_irq(&ha->hardware_lock);
 			starget_for_each_device(cp->device->sdev_target,
 			    fcport, qla2x00_adjust_sdev_qdepth_down);
-			spin_lock_irq(&ha->hardware_lock);
 			break;
 		}
 		if (lscsi_status != SS_CHECK_CONDITION)
---

Attachment: cor_qfull.diff
Description: cor_qfull.diff


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux