]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi/lpfc: Fixed unnecessary SCSI device reset escalation due to LLD handling of...
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 28 Aug 2012 23:01:10 +0000 (16:01 -0700)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Wed, 5 Sep 2012 19:25:49 +0000 (12:25 -0700)
commit id: http://marc.info/?l=linux-scsi&m=134496910030010

Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 276c22e7432a7a3a4bfb5667764347f4512aea2a..9d467bb59ab6408be3e9241c65a1262bcf45b10a 100644 (file)
@@ -3814,12 +3814,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
        cmd->scsi_done(cmd);
 
        if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
+               spin_lock_irq(&phba->hbalock);
+               lpfc_cmd->pCmd = NULL;
+               spin_unlock_irq(&phba->hbalock);
+
                /*
                 * If there is a thread waiting for command completion
                 * wake up the thread.
                 */
                spin_lock_irqsave(shost->host_lock, flags);
-               lpfc_cmd->pCmd = NULL;
                if (lpfc_cmd->waitq)
                        wake_up(lpfc_cmd->waitq);
                spin_unlock_irqrestore(shost->host_lock, flags);
@@ -3853,12 +3856,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
                }
        }
 
+       spin_lock_irq(&phba->hbalock);
+       lpfc_cmd->pCmd = NULL;
+       spin_unlock_irq(&phba->hbalock);
+
        /*
         * If there is a thread waiting for command completion
         * wake up the thread.
         */
        spin_lock_irqsave(shost->host_lock, flags);
-       lpfc_cmd->pCmd = NULL;
        if (lpfc_cmd->waitq)
                wake_up(lpfc_cmd->waitq);
        spin_unlock_irqrestore(shost->host_lock, flags);
@@ -4398,7 +4404,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
        }
 
        lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
-       if (!lpfc_cmd) {
+       if (!lpfc_cmd || !lpfc_cmd->pCmd) {
                spin_unlock_irq(&phba->hbalock);
                lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
                         "2873 SCSI Layer I/O Abort Request IO CMPL Status "