diff options
author | Javed Hasan <jhasan@marvell.com> | 2020-04-16 01:43:08 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-04-17 17:55:25 -0400 |
commit | 334b4f988f73dd70b80132933b0866bad0e0e221 (patch) | |
tree | 02c54198f683e5a2121b56e16fdba9b8f8514cc3 /drivers/scsi/qedf | |
parent | b0c4187e2616e9ecb1359f6bce2e93dd9593120b (diff) |
scsi: qedf: Acquire rport_lock for resetting the delay_timestamp
Retry delay timestamp is updated in queuecommand as well as in
qedf_scsi_completion routine. Protect it using lock.
Link: https://lore.kernel.org/r/20200416084314.18851-4-skashyap@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf')
-rw-r--r-- | drivers/scsi/qedf/qedf_io.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index e749a2dcaad7..64c176980752 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -1021,14 +1021,18 @@ qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) atomic_inc(&fcport->ios_to_queue); if (fcport->retry_delay_timestamp) { + /* Take fcport->rport_lock for resetting the delay_timestamp */ + spin_lock_irqsave(&fcport->rport_lock, flags); if (time_after(jiffies, fcport->retry_delay_timestamp)) { fcport->retry_delay_timestamp = 0; } else { + spin_unlock_irqrestore(&fcport->rport_lock, flags); /* If retry_delay timer is active, flow off the ML */ rc = SCSI_MLQUEUE_TARGET_BUSY; atomic_dec(&fcport->ios_to_queue); goto exit_qcmd; } + spin_unlock_irqrestore(&fcport->rport_lock, flags); } io_req = qedf_alloc_cmd(fcport, QEDF_SCSI_CMD); |