Thread (20 messages) 20 messages, 2 authors, 2022-02-11
STALE1602d LANDED: 3 (0M)
Revisions (19)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v1 [diff vs current]
  7. v2 [diff vs current]
  8. v3 [diff vs current]
  9. v1 [diff vs current]
  10. v2 [diff vs current]
  11. v1 current
  12. v2 [diff vs current]
  13. v1 [diff vs current]
  14. v1 [diff vs current]
  15. v2 [diff vs current]
  16. v1 [diff vs current]
  17. v1 [diff vs current]
  18. v1 [diff vs current]
  19. v1 [diff vs current]

[PATCH 04/18] smartpqi: eliminate drive spin down on warm boot

From: Don Brace <don.brace@microchip.com>
Date: 2022-02-01 21:48:10
Subsystem: microsemi smart array smartpqi driver (smartpqi), scsi subsystem, the rest · Maintainers: Don Brace, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

From: Sagar Biradar <redacted>

Avoid drive spin down during a warm boot on Linux.

Call the BMIC Flush Cache command (0xc2) to indicate the reason for
the flush cache (shutdown, hibernate, suspend, or restart).

Reviewed-by: Mike McGowen <redacted>
Reviewed-by: Scott Benesh <redacted>
Reviewed-by: Scott Teel <redacted>
Signed-off-by: Sagar Biradar <redacted>
Signed-off-by: Don Brace <don.brace@microchip.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
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");

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help