scsi: lpfc: Fix driver release of fw-logging buffers
On driver termination, after the driver stops fw logging by writing a register on the chip, the driver immediately unmaps and frees the logging buffer, without confirming in any way that the chip has received the write and terminated the logging. As termination on the chip is not immediate, the chip may issue a dma request to the now unmapped dma buffer, resulting in a iommu fault. Change the driver to receive a confirmation that logging ahs been terminated. As the driver always issues an SLI reset with the device as part of shutdown, and as part of that is receiving confirmation that the reset is complete - the driver was modified to perform the write to disable fw logging prior to the SLI reset and only free the fw log buffer after the SLI reset is complete. That guarantees use of the fw log buffer is fully terminated when it is unmapped. 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>
This commit is contained in:
committed by
Martin K. Petersen
parent
76558b2573
commit
1165a5c220
@@ -10690,12 +10690,7 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
|
||||
kthread_stop(phba->worker_thread);
|
||||
|
||||
/* Disable FW logging to host memory */
|
||||
writel(LPFC_CTL_PDEV_CTL_DDL_RAS,
|
||||
phba->sli4_hba.conf_regs_memmap_p + LPFC_CTL_PDEV_CTL_OFFSET);
|
||||
|
||||
/* Free RAS DMA memory */
|
||||
if (phba->ras_fwlog.ras_enabled == true)
|
||||
lpfc_sli4_ras_dma_free(phba);
|
||||
lpfc_ras_stop_fwlog(phba);
|
||||
|
||||
/* Unset the queues shared with the hardware then release all
|
||||
* allocated resources.
|
||||
@@ -10706,6 +10701,10 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
|
||||
/* Reset SLI4 HBA FCoE function */
|
||||
lpfc_pci_function_reset(phba);
|
||||
|
||||
/* Free RAS DMA memory */
|
||||
if (phba->ras_fwlog.ras_enabled)
|
||||
lpfc_sli4_ras_dma_free(phba);
|
||||
|
||||
/* Stop the SLI4 device port */
|
||||
phba->pport->work_port_events = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user