]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: lpfc: Fix io lost on host resets
authorJames Smart <jsmart2021@gmail.com>
Tue, 12 Mar 2019 23:30:19 +0000 (16:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:54 +0000 (06:43 -0700)
[ Upstream commit c66a91974634bfdf9d8e8736219d3b27621fa704 ]

If the driver undergoes repeated host resets it starts losing exchange
structures and eventually returns SCSI_MLQUEUE_HOST_BUSY and does not
recover. The offline path is not reclaiming the outstanding ios on the fcp
pring txcmplq before calling lpfc_destroy_multixripool, which causes the
txmcplq to be reinit and the resources lost.

Flush the fcp rings before destroying the multixripools.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_init.c

index 7fcdaed3fa945539a64fc78e349a00387cd41ea2..89a0c2bdb6a1578d989abb1c5c47f9ff8a324666 100644 (file)
@@ -3245,6 +3245,13 @@ void lpfc_destroy_multixri_pools(struct lpfc_hba *phba)
        if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME)
                lpfc_destroy_expedite_pool(phba);
 
+       if (!(phba->pport->load_flag & FC_UNLOADING)) {
+               lpfc_sli_flush_fcp_rings(phba);
+
+               if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME)
+                       lpfc_sli_flush_nvme_rings(phba);
+       }
+
        hwq_count = phba->cfg_hdw_queue;
 
        for (i = 0; i < hwq_count; i++) {