Commit 70ba20be authored by Sagar Biradar's avatar Sagar Biradar Committed by Martin K. Petersen

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.netReviewed-by: default avatarMike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: default avatarScott Benesh <scott.benesh@microchip.com>
Reviewed-by: default avatarScott Teel <scott.teel@microchip.com>
Signed-off-by: default avatarSagar Biradar <sagar.biradar@microchip.com>
Signed-off-by: default avatarDon Brace <don.brace@microchip.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2a47834d
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment