Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee62021a authored by James Smart's avatar James Smart Committed by Christoph Hellwig
Browse files

lpfc: Fixed kernel panic in lpfc_abort_handler



Fixed kernel panic in lpfc_abort_handler

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Reviewed-By: default avatarDick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 07eab624
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4664,7 +4664,10 @@ lpfc_reset_hba(struct lpfc_hba *phba)
		phba->link_state = LPFC_HBA_ERROR;
		return;
	}
	if (phba->sli.sli_flag & LPFC_SLI_ACTIVE)
		lpfc_offline_prep(phba, LPFC_MBX_WAIT);
	else
		lpfc_offline_prep(phba, LPFC_MBX_NO_WAIT);
	lpfc_offline(phba);
	lpfc_sli_brdrestart(phba);
	lpfc_online(phba);
+12 −0
Original line number Diff line number Diff line
@@ -4834,6 +4834,14 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)

	BUG_ON(iocb->context1 != lpfc_cmd);

	/* abort issued in recovery is still in progress */
	if (iocb->iocb_flag & LPFC_DRIVER_ABORTED) {
		lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
			 "3389 SCSI Layer I/O Abort Request is pending\n");
		spin_unlock_irqrestore(&phba->hbalock, flags);
		goto wait_for_cmpl;
	}

	abtsiocb = __lpfc_sli_get_iocbq(phba);
	if (abtsiocb == NULL) {
		ret = FAILED;
@@ -4886,12 +4894,16 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
		lpfc_sli_handle_fast_ring_event(phba,
			&phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ);

wait_for_cmpl:
	lpfc_cmd->waitq = &waitq;
	/* Wait for abort to complete */
	wait_event_timeout(waitq,
			  (lpfc_cmd->pCmd != cmnd),
			   msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000));

	spin_lock_irqsave(shost->host_lock, flags);
	lpfc_cmd->waitq = NULL;
	spin_unlock_irqrestore(shost->host_lock, flags);

	if (lpfc_cmd->pCmd == cmnd) {
		ret = FAILED;