summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/smartpqi
diff options
context:
space:
mode:
authorSagar Biradar <sagar.biradar@microchip.com>2022-02-01 15:48:08 -0600
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-07 23:38:34 -0500
commit70ba20be4bb1f560bba7288bd12fbb918823e576 (patch)
tree12232a2f9c0d9095639cc9d03d3d349ad7664711 /drivers/scsi/smartpqi
parent2a47834d9452812f68c8894994e95adad56e4b60 (diff)
downloadlinux-stable-70ba20be4bb1f560bba7288bd12fbb918823e576.tar.gz
linux-stable-70ba20be4bb1f560bba7288bd12fbb918823e576.tar.bz2
linux-stable-70ba20be4bb1f560bba7288bd12fbb918823e576.zip
scsi: smartpqi: Eliminate drive spin down on warm boot
Avoid drive spin down during a warm boot. Call the BMIC Flush Cache command (0xc2) to indicate the reason for the flush cache (shutdown, hibernate, suspend, or restart). Link: https://lore.kernel.org/r/164375208810.440833.11254644025650871435.stgit@brunhilda.pdev.net Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Signed-off-by: Sagar Biradar <sagar.biradar@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/smartpqi')
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index ad9fa1628a69..f51605cd098c 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -8902,6 +8902,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
{
int rc;
struct pqi_ctrl_info *ctrl_info;
+ enum bmic_flush_cache_shutdown_event shutdown_event;
ctrl_info = pci_get_drvdata(pci_dev);
if (!ctrl_info) {
@@ -8917,11 +8918,16 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
pqi_ctrl_block_requests(ctrl_info);
pqi_ctrl_wait_until_quiesced(ctrl_info);
+ if (system_state == SYSTEM_RESTART)
+ shutdown_event = RESTART;
+ else
+ shutdown_event = SHUTDOWN;
+
/*
* Write all data in the controller's battery-backed cache to
* storage.
*/
- rc = pqi_flush_cache(ctrl_info, SHUTDOWN);
+ rc = pqi_flush_cache(ctrl_info, shutdown_event);
if (rc)
dev_err(&pci_dev->dev,
"unable to flush controller cache\n");