From: Vaios Papadimitriou Date: Tue, 28 Aug 2012 23:01:10 +0000 (-0700) Subject: scsi/lpfc: Fixed unnecessary SCSI device reset escalation due to LLD handling of... X-Git-Tag: v2.6.39-400.9.0~314^2~7 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2282aa559c260aa9becca8d9f255c6441c8a2d3b;p=users%2Fjedix%2Flinux-maple.git scsi/lpfc: Fixed unnecessary SCSI device reset escalation due to LLD handling of I/O abort commit id: http://marc.info/?l=linux-scsi&m=134496910030010 Signed-off-by: Jerry Snitselaar --- diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 276c22e7432a..9d467bb59ab6 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -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 "