Re: [PATCH #upstream 2/2] libata: track SLEEP state and issue SRST to wake it up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> wrote:
> Jeff, please forget about this patchset.  I'll re-post updated version.
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux