Commit ea714f3dab0484b38fa6040ba45d2be7c4c5b752

Authored by James Smart
Committed by James Bottomley
1 parent a88dbb6a96

[SCSI] lpfc 8.3.39: Fixed system panic during EEH recovery due to midlayer acting on outstanding I/O

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

Showing 2 changed files with 10 additions and 6 deletions Side-by-side Diff

drivers/scsi/lpfc/lpfc_init.c
... ... @@ -9314,15 +9314,15 @@
9314 9314 /* Block all SCSI devices' I/Os on the host */
9315 9315 lpfc_scsi_dev_block(phba);
9316 9316  
  9317 + /* Flush all driver's outstanding SCSI I/Os as we are to reset */
  9318 + lpfc_sli_flush_fcp_rings(phba);
  9319 +
9317 9320 /* stop all timers */
9318 9321 lpfc_stop_hba_timers(phba);
9319 9322  
9320 9323 /* Disable interrupt and pci device */
9321 9324 lpfc_sli_disable_intr(phba);
9322 9325 pci_disable_device(phba->pcidev);
9323   -
9324   - /* Flush all driver's outstanding SCSI I/Os as we are to reset */
9325   - lpfc_sli_flush_fcp_rings(phba);
9326 9326 }
9327 9327  
9328 9328 /**
... ... @@ -10067,6 +10067,9 @@
10067 10067 /* Block all SCSI devices' I/Os on the host */
10068 10068 lpfc_scsi_dev_block(phba);
10069 10069  
  10070 + /* Flush all driver's outstanding SCSI I/Os as we are to reset */
  10071 + lpfc_sli_flush_fcp_rings(phba);
  10072 +
10070 10073 /* stop all timers */
10071 10074 lpfc_stop_hba_timers(phba);
10072 10075  
... ... @@ -10074,9 +10077,6 @@
10074 10077 lpfc_sli4_disable_intr(phba);
10075 10078 lpfc_sli4_queue_destroy(phba);
10076 10079 pci_disable_device(phba->pcidev);
10077   -
10078   - /* Flush all driver's outstanding SCSI I/Os as we are to reset */
10079   - lpfc_sli_flush_fcp_rings(phba);
10080 10080 }
10081 10081  
10082 10082 /**
drivers/scsi/lpfc/lpfc_sli.c
... ... @@ -8453,10 +8453,14 @@
8453 8453  
8454 8454 if ((piocb->iocb_flag & LPFC_IO_FCP) ||
8455 8455 (piocb->iocb_flag & LPFC_USE_FCPWQIDX)) {
  8456 + if (unlikely(!phba->sli4_hba.fcp_wq))
  8457 + return IOCB_ERROR;
8456 8458 if (lpfc_sli4_wq_put(phba->sli4_hba.fcp_wq[piocb->fcp_wqidx],
8457 8459 &wqe))
8458 8460 return IOCB_ERROR;
8459 8461 } else {
  8462 + if (unlikely(!phba->sli4_hba.els_wq))
  8463 + return IOCB_ERROR;
8460 8464 if (lpfc_sli4_wq_put(phba->sli4_hba.els_wq, &wqe))
8461 8465 return IOCB_ERROR;
8462 8466 }