diff options
author | James Smart <james.smart@emulex.com> | 2012-08-14 14:26:28 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-14 12:59:25 -0400 |
commit | 92e3af663ab6ef7db888f3d3ffb7568fab870127 (patch) | |
tree | 855bc0466d0ca239335a6ff08ed91e9ed83c556e /drivers/scsi/lpfc | |
parent | 1c13bf664894b34ace55fce49cc49598267787b7 (diff) |
[SCSI] lpfc 8.3.34: Correct lock handling to eliminate reset escalation on I/O abort
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 5ab21f7dc3fc..64013f3097ad 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -3829,12 +3829,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
3829 | cmd->scsi_done(cmd); | 3829 | cmd->scsi_done(cmd); |
3830 | 3830 | ||
3831 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { | 3831 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { |
3832 | spin_lock_irq(&phba->hbalock); | ||
3833 | lpfc_cmd->pCmd = NULL; | ||
3834 | spin_unlock_irq(&phba->hbalock); | ||
3835 | |||
3832 | /* | 3836 | /* |
3833 | * If there is a thread waiting for command completion | 3837 | * If there is a thread waiting for command completion |
3834 | * wake up the thread. | 3838 | * wake up the thread. |
3835 | */ | 3839 | */ |
3836 | spin_lock_irqsave(shost->host_lock, flags); | 3840 | spin_lock_irqsave(shost->host_lock, flags); |
3837 | lpfc_cmd->pCmd = NULL; | ||
3838 | if (lpfc_cmd->waitq) | 3841 | if (lpfc_cmd->waitq) |
3839 | wake_up(lpfc_cmd->waitq); | 3842 | wake_up(lpfc_cmd->waitq); |
3840 | spin_unlock_irqrestore(shost->host_lock, flags); | 3843 | spin_unlock_irqrestore(shost->host_lock, flags); |
@@ -3868,12 +3871,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
3868 | } | 3871 | } |
3869 | } | 3872 | } |
3870 | 3873 | ||
3874 | spin_lock_irq(&phba->hbalock); | ||
3875 | lpfc_cmd->pCmd = NULL; | ||
3876 | spin_unlock_irq(&phba->hbalock); | ||
3877 | |||
3871 | /* | 3878 | /* |
3872 | * If there is a thread waiting for command completion | 3879 | * If there is a thread waiting for command completion |
3873 | * wake up the thread. | 3880 | * wake up the thread. |
3874 | */ | 3881 | */ |
3875 | spin_lock_irqsave(shost->host_lock, flags); | 3882 | spin_lock_irqsave(shost->host_lock, flags); |
3876 | lpfc_cmd->pCmd = NULL; | ||
3877 | if (lpfc_cmd->waitq) | 3883 | if (lpfc_cmd->waitq) |
3878 | wake_up(lpfc_cmd->waitq); | 3884 | wake_up(lpfc_cmd->waitq); |
3879 | spin_unlock_irqrestore(shost->host_lock, flags); | 3885 | spin_unlock_irqrestore(shost->host_lock, flags); |
@@ -4409,7 +4415,7 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4409 | } | 4415 | } |
4410 | 4416 | ||
4411 | lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; | 4417 | lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; |
4412 | if (!lpfc_cmd) { | 4418 | if (!lpfc_cmd || !lpfc_cmd->pCmd) { |
4413 | spin_unlock_irq(&phba->hbalock); | 4419 | spin_unlock_irq(&phba->hbalock); |
4414 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, | 4420 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, |
4415 | "2873 SCSI Layer I/O Abort Request IO CMPL Status " | 4421 | "2873 SCSI Layer I/O Abort Request IO CMPL Status " |