diff mbox

[6/6] libata: fake some more commands when drive is sleeping

Message ID eb83c221015ccb11181d94173ad181b7dc89cd87.1384030893.git.psusi@ubuntu.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Phillip Susi Nov. 9, 2013, 9:03 p.m. UTC
The sd driver issues a flush cache when suspending, and this was causing
a sleeping drive to wake up for no reason.  Another sleep or standby
command when the drive is already sleeping obviously should also not cause
the disk to spin up.
---
 drivers/ata/libata-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c53c210..25d141e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5092,7 +5092,11 @@  void ata_qc_issue(struct ata_queued_cmd *qc)
 
 	/* if device is sleeping, schedule reset and abort the link */
 	if (unlikely(qc->dev->flags & ATA_DFLAG_SLEEPING)) {
-		if (unlikely(qc->tf.command == ATA_CMD_CHK_POWER))
+		if (unlikely(qc->tf.command == ATA_CMD_CHK_POWER ||
+			     qc->tf.command == ATA_CMD_SLEEP ||
+			     qc->tf.command == ATA_CMD_FLUSH ||
+			     qc->tf.command == ATA_CMD_FLUSH_EXT ||
+			     qc->tf.command == ATA_CMD_STANDBYNOW1))
 		{
 			/* fake reply to avoid waking drive */
 			qc->flags &= ~ATA_QCFLAG_RESULT_TF;