diff options
author | James Smart <james.smart@emulex.com> | 2014-04-04 13:51:53 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-06-02 12:28:43 -0400 |
commit | ee62021a11320e972e0218ab73a5a5196b6aa499 (patch) | |
tree | 4cbdf19748b1a5cdec6862e6dfbe60dcdf41bdd7 | |
parent | 07eab624e5cf471450ed7b8c4ba8521e910dc9cf (diff) |
lpfc: Fixed kernel panic in lpfc_abort_handler
Fixed kernel panic in lpfc_abort_handler
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-By: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 5 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 512f91ed5d25..9f3efdb9e833 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -4664,7 +4664,10 @@ lpfc_reset_hba(struct lpfc_hba *phba) | |||
4664 | phba->link_state = LPFC_HBA_ERROR; | 4664 | phba->link_state = LPFC_HBA_ERROR; |
4665 | return; | 4665 | return; |
4666 | } | 4666 | } |
4667 | lpfc_offline_prep(phba, LPFC_MBX_WAIT); | 4667 | if (phba->sli.sli_flag & LPFC_SLI_ACTIVE) |
4668 | lpfc_offline_prep(phba, LPFC_MBX_WAIT); | ||
4669 | else | ||
4670 | lpfc_offline_prep(phba, LPFC_MBX_NO_WAIT); | ||
4668 | lpfc_offline(phba); | 4671 | lpfc_offline(phba); |
4669 | lpfc_sli_brdrestart(phba); | 4672 | lpfc_sli_brdrestart(phba); |
4670 | lpfc_online(phba); | 4673 | lpfc_online(phba); |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 4adeb21f15b5..576a0602b101 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -4834,6 +4834,14 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4834 | 4834 | ||
4835 | BUG_ON(iocb->context1 != lpfc_cmd); | 4835 | BUG_ON(iocb->context1 != lpfc_cmd); |
4836 | 4836 | ||
4837 | /* abort issued in recovery is still in progress */ | ||
4838 | if (iocb->iocb_flag & LPFC_DRIVER_ABORTED) { | ||
4839 | lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, | ||
4840 | "3389 SCSI Layer I/O Abort Request is pending\n"); | ||
4841 | spin_unlock_irqrestore(&phba->hbalock, flags); | ||
4842 | goto wait_for_cmpl; | ||
4843 | } | ||
4844 | |||
4837 | abtsiocb = __lpfc_sli_get_iocbq(phba); | 4845 | abtsiocb = __lpfc_sli_get_iocbq(phba); |
4838 | if (abtsiocb == NULL) { | 4846 | if (abtsiocb == NULL) { |
4839 | ret = FAILED; | 4847 | ret = FAILED; |
@@ -4886,12 +4894,16 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) | |||
4886 | lpfc_sli_handle_fast_ring_event(phba, | 4894 | lpfc_sli_handle_fast_ring_event(phba, |
4887 | &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ); | 4895 | &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ); |
4888 | 4896 | ||
4897 | wait_for_cmpl: | ||
4889 | lpfc_cmd->waitq = &waitq; | 4898 | lpfc_cmd->waitq = &waitq; |
4890 | /* Wait for abort to complete */ | 4899 | /* Wait for abort to complete */ |
4891 | wait_event_timeout(waitq, | 4900 | wait_event_timeout(waitq, |
4892 | (lpfc_cmd->pCmd != cmnd), | 4901 | (lpfc_cmd->pCmd != cmnd), |
4893 | msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000)); | 4902 | msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000)); |
4903 | |||
4904 | spin_lock_irqsave(shost->host_lock, flags); | ||
4894 | lpfc_cmd->waitq = NULL; | 4905 | lpfc_cmd->waitq = NULL; |
4906 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
4895 | 4907 | ||
4896 | if (lpfc_cmd->pCmd == cmnd) { | 4908 | if (lpfc_cmd->pCmd == cmnd) { |
4897 | ret = FAILED; | 4909 | ret = FAILED; |