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

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

 



Tejun Heo wrote:
ATA devices in SLEEP mode don't respond to any commands.  SRST is
necessary to wake it up.  Till now, when a command is issued to a
device in SLEEP mode, the command times out, which makes EH reset the
device and retry the command after that, causing a long delay.

This patch makes libata track SLEEP state and issue SRST automatically
if a command is about to be issued to a device in SLEEP.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>
Cc: Bruce Allen <ballen@xxxxxxxxxxxxxxxxxxxx>
Cc: Andrew Paprocki <andrew@xxxxxxxxxxx>
---
This patch is against

 #upstream
 + relocate-and-fix-post-command-processing patch
   (http://article.gmane.org/gmane.linux.ide/24001)

The infinite loop with the previous patch wasn't caused by bug in
sleep state tracking.  It was happening because post-command
processing was being performed for commands which are being retried
from EH, so what happened was.

1. device is flagged SLEEPING

2. SLEEP is issued, as device is sleeping, EH is rescheduled against
   the qc for SLEEP.

3. EH kicks in and wakes up the device and clears SLEEPING.

4. EH finishes up failed qc which triggers post-command processing and
   sets SLEEPING.

5. SCSI command is retried, go back to #2.

relocate-and-fix-post-command-processing patch fixes the original bug
in post-command processing and this patch doesn't cause infinite loop
anymore.

 drivers/ata/libata-core.c |   12 ++++++++++++
 drivers/ata/libata-eh.c   |    4 +++-
 include/linux/ata.h       |    1 +
 include/linux/libata.h    |    1 +
 4 files changed, 17 insertions(+), 1 deletion(-)

applied, both of these changes were nice improvements, as well as fixing problems


-
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