scsi: smartpqi: Add controller cache flush during rmmod

Add in a call to flush the controller cache during driver removal.

Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Mike Mcgowan <mike.mcgowan@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Gilbert Wu <Gilbert.Wu@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Link: https://lore.kernel.org/r/166793532388.322537.878022136408270892.stgit@brunhilda
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Gilbert Wu 2022-11-08 13:22:03 -06:00 committed by Martin K. Petersen
parent cc9befcbbb
commit 14063fb625

View File

@ -9040,6 +9040,7 @@ static void pqi_pci_remove(struct pci_dev *pci_dev)
{
struct pqi_ctrl_info *ctrl_info;
u16 vendor_id;
int rc;
ctrl_info = pci_get_drvdata(pci_dev);
if (!ctrl_info)
@ -9051,6 +9052,13 @@ static void pqi_pci_remove(struct pci_dev *pci_dev)
else
ctrl_info->ctrl_removal_state = PQI_CTRL_GRACEFUL_REMOVAL;
if (ctrl_info->ctrl_removal_state == PQI_CTRL_GRACEFUL_REMOVAL) {
rc = pqi_flush_cache(ctrl_info, RESTART);
if (rc)
dev_err(&pci_dev->dev,
"unable to flush controller cache during remove\n");
}
pqi_remove_ctrl(ctrl_info);
}