summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/snic/snic_scsi.c
diff options
context:
space:
mode:
authorNarsimhulu Musini <nmusini@cisco.com>2016-03-17 00:51:15 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2016-04-11 16:57:09 -0400
commit0da8519b2b1f08113cda65af88a4c9e35157dd53 (patch)
treed5f7c8416191b86837c800460e4972a3e5d28a72 /drivers/scsi/snic/snic_scsi.c
parentc9747821f9bbff6c07fa36087b003d89d05245c8 (diff)
downloadtalos-obmc-linux-0da8519b2b1f08113cda65af88a4c9e35157dd53.tar.gz
talos-obmc-linux-0da8519b2b1f08113cda65af88a4c9e35157dd53.zip
snic: Fixing race in the hba reset and IO/TM completion
While HBA reset is in progress, if IO/TM completion is received for the same IO then IO/TM completion path releases the driver private resources associated with IO. This fix prevents releasing the resources in IO and TM completion path if HBA reset is in progress. Signed-off-by: Narsimhulu Musini <nmusini@cisco.com> Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/snic/snic_scsi.c')
-rw-r--r--drivers/scsi/snic/snic_scsi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index 5a709ebdb282..abada16b375b 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -601,6 +601,12 @@ snic_icmnd_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq)
sc->device->lun, sc, sc->cmnd[0], snic_cmd_tag(sc),
CMD_FLAGS(sc), rqi);
+ if (CMD_FLAGS(sc) & SNIC_HOST_RESET_CMD_TERM) {
+ spin_unlock_irqrestore(io_lock, flags);
+
+ return;
+ }
+
SNIC_BUG_ON(rqi != (struct snic_req_info *)ctx);
WARN_ON_ONCE(req);
if (!rqi) {
@@ -782,6 +788,11 @@ snic_process_itmf_cmpl(struct snic *snic,
io_lock = snic_io_lock_hash(snic, sc);
spin_lock_irqsave(io_lock, flags);
+ if (CMD_FLAGS(sc) & SNIC_HOST_RESET_CMD_TERM) {
+ spin_unlock_irqrestore(io_lock, flags);
+
+ return ret;
+ }
rqi = (struct snic_req_info *) CMD_SP(sc);
WARN_ON_ONCE(!rqi);
OpenPOWER on IntegriCloud