Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: smartpqi: Avoid drive spin-down during suspend

On certain systems (based on PCI IDs), when the OS transitions the system
into the suspend (S3) state, the BMIC flush cache command will indicate a
system RESTART instead of SUSPEND.

This avoids drive spin-down.

Link: https://lore.kernel.org/r/164375211330.440833.7203813692110347698.stgit@brunhilda.pdev.net
Reviewed-by: Kevin Barnett <kevin.barnett@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>

authored by

Sagar Biradar and committed by
Martin K. Petersen
b73357a1 42dc0426

+10 -1
+10 -1
drivers/scsi/smartpqi/smartpqi_init.c
··· 8976 8976 pqi_process_lockup_action_param(); 8977 8977 } 8978 8978 8979 + static inline enum bmic_flush_cache_shutdown_event pqi_get_flush_cache_shutdown_event(struct pci_dev *pci_dev) 8980 + { 8981 + if (pci_dev->subsystem_vendor == PCI_VENDOR_ID_ADAPTEC2 && pci_dev->subsystem_device == 0x1304) 8982 + return RESTART; 8983 + return SUSPEND; 8984 + } 8985 + 8979 8986 static __maybe_unused int pqi_suspend(struct pci_dev *pci_dev, pm_message_t state) 8980 8987 { 8981 8988 struct pqi_ctrl_info *ctrl_info; 8989 + enum bmic_flush_cache_shutdown_event shutdown_event; 8982 8990 8991 + shutdown_event = pqi_get_flush_cache_shutdown_event(pci_dev); 8983 8992 ctrl_info = pci_get_drvdata(pci_dev); 8984 8993 8985 8994 pqi_wait_until_ofa_finished(ctrl_info); ··· 8998 8989 pqi_ctrl_block_device_reset(ctrl_info); 8999 8990 pqi_ctrl_block_requests(ctrl_info); 9000 8991 pqi_ctrl_wait_until_quiesced(ctrl_info); 9001 - pqi_flush_cache(ctrl_info, SUSPEND); 8992 + pqi_flush_cache(ctrl_info, shutdown_event); 9002 8993 pqi_stop_heartbeat_timer(ctrl_info); 9003 8994 9004 8995 pqi_crash_if_pending_command(ctrl_info);