All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrew Paprocki" <andrew@ishiboo.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>,
	linux-ide@vger.kernel.org,
	Bruce Allen <ballen@gravity.phys.uwm.edu>
Subject: Re: [PATCH #upstream 2/2] libata: track SLEEP state and issue SRST to wake it up
Date: Sat, 13 Oct 2007 21:02:09 -0400	[thread overview]
Message-ID: <76366b180710131802s2f4e8b58g68fc5d15cd20d507@mail.gmail.com> (raw)
In-Reply-To: <4710CE58.9060903@gmail.com>

Tejun,

This patch applied on top of your set works for me. It clears the
error mask and completes any ATA_CMD_SLEEP when the drive is already
sleeping. I tried `hdparm -Y` twice and it didn't loop like before.

Thanks,
-Andrew

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 45b781b..7e0627f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5763,6 +5763,16 @@ void ata_qc_issue(struct ata_queued_cmd *qc)

        /* if device is sleeping, schedule softreset and abort the link */
        if (unlikely(qc->dev->flags & ATA_DFLAG_SLEEPING)) {
+               if (unlikely(qc->tf.command == ATA_CMD_SLEEP)) {
+                       /* to prevent a loop, do not wake up if sleeping
+                        * and a sleep cmd is sent. instead, simply clear
+                        * the error mask and complete as if it was
+                        * successful.
+                        */
+                       qc->err_mask = 0;
+                       ata_qc_complete(qc);
+                       return;
+               }
                link->eh_info.action |= ATA_EH_SOFTRESET;
                ata_ehi_push_desc(&link->eh_info, "waking up from sleep");
                ata_link_abort(link);

On 10/13/07, Tejun Heo <htejun@gmail.com> wrote:
> Jeff, please forget about this patchset.  I'll re-post updated version.

  reply	other threads:[~2007-10-14  1:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12 11:56 [PATCH #upstream 1/2] libata: move command post processing to __ata_qc_complete() Tejun Heo
2007-10-12 11:56 ` [PATCH #upstream 2/2] libata: track SLEEP state and issue SRST to wake it up Tejun Heo
2007-10-13  4:57   ` Andrew Paprocki
2007-10-13 13:55     ` Tejun Heo
2007-10-14  1:02       ` Andrew Paprocki [this message]
2007-10-12 12:13 ` [PATCH #upstream 1/2] libata: move command post processing to __ata_qc_complete() Jeff Garzik
2007-10-13 13:09   ` Tejun Heo
2007-10-18  1:23     ` Jeff Garzik
2007-10-18  3:55       ` Bruce Allen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76366b180710131802s2f4e8b58g68fc5d15cd20d507@mail.gmail.com \
    --to=andrew@ishiboo.com \
    --cc=ballen@gravity.phys.uwm.edu \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.