From: Tejun Heo <htejun@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Gregor Jasny <gjasny@googlemail.com>,
Jeff Garzik <jgarzik@pobox.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-ide@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Linux v2.6.22-rc3
Date: Fri, 01 Jun 2007 09:58:48 +0900 [thread overview]
Message-ID: <465F6F48.8080804@gmail.com> (raw)
In-Reply-To: <alpine.LFD.0.98.0705290924350.26602@woody.linux-foundation.org>
Hello, Linus. Sorry about late response. I'm still recovering from jet
lag.
Linus Torvalds wrote:
> On Tue, 29 May 2007, Tejun Heo wrote:
>> Aieee, so the drive doesn't like the new SRST sequence.
>
> It would appear that the old code largely ignored the SRST error entirely,
> no?
Yes, we used to ignore some error conditions, which sometimes led to
very long timeout sequence after hotplugging under certain circumstances
- a few 30sec timeouts for the reset and another 30sec for the following
IDENTIFY (because reset didn't fail after the timeouts).
> If we *used* to do (in ata_bus_post_reset()):
>
> if (dev0)
> ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
>
> and you changed that to actually care about the return value:
>
> if (dev0) {
> rc = ata_wait_ready(ap, deadline);
> if (rc && rc != -ENODEV)
> return rc;
> }
>
> (in _two_ places). That change also changed the same "post_reset" handling
> in a totally _different_ way: it used to do ata_busy_sleep() twice, now it
> still does it twice, but it does it with the same "timeout" value, so if
> the first one times out, then the second one won't be given any timeout AT
> ALL!
>
> And to make matters worse: the first timeout seems to be for ANOTHER PORT
> ENTIRELY! So you seem to break port 1 even if the timeout happened on port
> 0, as far as I can read that sequence.
Yes, the whole operation uses single timeout. If the given time runs
out, it fails for both devices on the channel. This is because reset
timeout is channel wide. After SRST, both devices are required to
respond in certain time (30secs max per spec). If anyone of the device
doesn't respond, it isn't clear what we can or can't do with the bus -
reset protocol itself requires responding master, cable detection needs
both devices working, etc...
> So I think your ata_bus_post_reset() changes are rather suspect. The fact
> that you don't change the timeout, and use the same deadline for two
> different ports (and for multiple commands to the same port, afaik), seems
> rather suspect. The old code also didn't care about failures in certain
> phases of the reset sequence, and it appears that it did so for good
> reason.
Gregor's cdrom has broken SRST support which is extremely rare and
broken. The reason why it works flawlessly with the ide driver is
because the ide driver doesn't issue SRST during probing and libata
worked after 30sec timeout before reset-seq change because libata didn't
use to check reset failures in some cases and the device just worked
when issued commands even when it didn't report ready status after reset.
I'll try to add some code in the reset path and see where the device
fails reset protocol. Hopefully, we can work around it. If it doesn't,
maybe we'll need to issue IDENTIFY and see whether that works after
reset timeout. :-(
Thanks.
--
tejun
next prev parent reply other threads:[~2007-06-01 0:59 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <alpine.LFD.0.98.0705252008210.26602@woody.linux-foundation.org>
2007-05-27 15:01 ` Linux v2.6.22-rc3 Gregor Jasny
2007-05-27 15:06 ` Jeff Garzik
2007-05-27 16:07 ` Gregor Jasny
2007-05-27 16:24 ` Linus Torvalds
2007-05-27 20:15 ` Gregor Jasny
2007-05-28 9:47 ` Tejun Heo
2007-05-28 14:07 ` Gregor Jasny
2007-05-29 9:28 ` Tejun Heo
2007-05-29 15:19 ` Gregor Jasny
2007-05-29 16:44 ` Linus Torvalds
2007-06-01 0:58 ` Tejun Heo [this message]
2007-06-01 1:37 ` Linus Torvalds
2007-06-01 2:19 ` Tejun Heo
2007-06-01 16:50 ` Jeff Garzik
2007-06-01 17:04 ` Linus Torvalds
2007-06-01 17:35 ` Jeff Garzik
2007-06-01 17:59 ` Linus Torvalds
2007-06-01 18:20 ` Dave Jones
2007-06-01 18:30 ` Linus Torvalds
2007-06-01 18:46 ` Dave Jones
2007-06-01 18:41 ` Jeff Garzik
2007-06-01 18:48 ` Jeff Garzik
2007-06-02 7:50 ` Tejun Heo
2007-05-28 21:50 ` Bill Davidsen
2007-06-02 16:11 ` [PATCH] " Jeff Garzik
2007-06-03 17:46 ` Gregor Jasny
2007-06-06 8:46 ` Tejun Heo
2007-06-07 6:22 ` Gregor Jasny
2007-06-07 7:27 ` Tejun Heo
2007-06-07 20:37 ` Gregor Jasny
2007-06-07 20:56 ` Linus Torvalds
2007-06-07 22:39 ` Alan Cox
2007-06-07 22:47 ` Jeff Garzik
2007-06-08 8:02 ` Tejun Heo
2007-06-08 11:27 ` Alan Cox
2007-06-08 11:32 ` Tejun Heo
2007-06-08 11:40 ` Alan Cox
2007-06-08 14:28 ` Jeff Garzik
2007-06-08 15:36 ` Alan Cox
2007-06-08 15:32 ` Jeff Garzik
2007-06-08 15:46 ` Alan Cox
2007-06-08 15:49 ` Jeff Garzik
2007-06-08 15:59 ` Alan Cox
2007-06-08 14:31 ` Jeff Garzik
2007-06-08 15:38 ` Alan Cox
2007-06-08 15:35 ` Jeff Garzik
2007-06-08 15:44 ` Alan Cox
2007-06-09 18:12 ` Linus Torvalds
2007-06-09 19:03 ` Jeff Garzik
2007-06-10 5:26 ` [PATCH] libata: limit post SRST nsect/lbal wait to ~100ms Tejun Heo
2007-06-10 16:23 ` Jeff Garzik
2007-06-11 4:59 ` Jeff Garzik
2007-06-08 15:55 ` [PATCH] Re: Linux v2.6.22-rc3 Jeff Garzik
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=465F6F48.8080804@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gjasny@googlemail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).