]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: fnic: Avoid sending reset to firmware when another reset is in progress
authorSatish Kharat <satishkh@cisco.com>
Tue, 7 Mar 2017 13:39:02 +0000 (05:39 -0800)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Thu, 18 May 2017 18:04:08 +0000 (11:04 -0700)
Orabug: 25638880

The fix avoids calling an internal firmware reset when a fw reset
is already in progress.

Signed-off-by: Satish Kharat <satishkh@cisco.com>
[ Upstream commit 9698b6f473555a722bf81a3371998427d5d27bde ]
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/fnic/fnic.h
drivers/scsi/fnic/fnic_scsi.c

index e4e22f1d71215095ead7ec1169c4bc30caa30032..4c3ffc752a3d37edf8adca95c95fc9aebc5da53b 100644 (file)
@@ -248,6 +248,7 @@ struct fnic {
        struct completion *remove_wait; /* device remove thread blocks */
 
        atomic_t in_flight;             /* io counter */
+       bool internal_reset_progress;
        u32 _reserved;                  /* fill hole */
        unsigned long state_flags;      /* protected by host lock */
        enum fnic_state state;
index 146da6ec19d5b9ef35f39fdb4862ade191acdc13..559a46e70aef9f06d535d551037ff4d5eeb3ea31 100644 (file)
@@ -1790,8 +1790,6 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
                "Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n",
                rport->port_id, sc->device->lun, tag, CMD_FLAGS(sc));
 
-       CMD_FLAGS(sc) = FNIC_NO_FLAGS;
-
        if (lp->state != LPORT_ST_READY || !(lp->link_up)) {
                ret = FAILED;
                goto fnic_abort_cmd_end;
@@ -2559,6 +2557,21 @@ int fnic_host_reset(struct scsi_cmnd *sc)
        unsigned long wait_host_tmo;
        struct Scsi_Host *shost = sc->device->host;
        struct fc_lport *lp = shost_priv(shost);
+       struct fnic *fnic = lport_priv(lp);
+       unsigned long flags;
+
+       spin_lock_irqsave(&fnic->fnic_lock, flags);
+       if (fnic->internal_reset_progress == 0) {
+               fnic->internal_reset_progress = 1;
+       } else {
+               spin_unlock_irqrestore(&fnic->fnic_lock, flags);
+               FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
+                       "Another reset in progress skipping another host reset\n");
+               return SUCCESS;
+       }
+       spin_unlock_irqrestore(&fnic->fnic_lock, flags);
+
+
 
        /*
         * If fnic_reset is successful, wait for fabric login to complete