From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: albertcc@tw.ibm.com, liml@rtr.ca, linux-ide@vger.kernel.org
Subject: Re: [PATCH 14/14] ahci: add softreset
Date: Mon, 19 Dec 2005 16:13:38 +0900 [thread overview]
Message-ID: <43A65DA2.2080402@gmail.com> (raw)
In-Reply-To: <43A655C4.10300@pobox.com>
Jeff Garzik wrote:
> Tejun Heo wrote:
>
>> Jeff Garzik wrote:
>>
>>> Tejun Heo wrote:
>>>
>>>> Now that libata is smart enought to handle both soft and hard resets,
>>>> add softreset method.
>>>
>>>
>>>
>>>
>>> I'm a bit skeptical that polling is what should be done here. SATA
>>> is inherently event-driven...
>>>
>>
>> Well, I'm a bit skeptical the other way around. :-)
>>
>> What benefits would making softreset event-driven bring?
>
>
> The underlying operations are inherently event-driven, as I stated
> above. You send a packet, wait for the ACK. Send another packet. Wait
> for the ACK.
>
Okay. Hmmm... I don't really see the point you're trying to make here.
I'll describe AHCI COMRESET sequence in detail to communicate myself
better.
The following is mainly from section 10.4.1 of AHCI spec rev 1.1.
1. clear PxCMD.ST and wait for PxCMD.CR to clear to 0. If PxCMD.CR
doesn't clear within 500msec, the interface might be hung (fall back to
hardreset).
- no interrupt generated on CR clearing, polling required
2. if BSY or DRQ is set, they need to be cleared using PxCMD.CLO if
supported. CLO is performed by setting PxCMD.CLO and waiting for the
controller to clear it. The spec doesn't say how long it may take.
- no interrupt generated on CLO clearing, polling required.
3. set PxCMD.ST
4. issue the first H2D Register FIS (SRST on). This command needs to
have CH[R] (SYNC escaping) and CH[C] (clear BSY on R_OK) set. The CH[C]
is needed because the device won't generate D2H Register FIS after
receiving SRST. The controller clears BSY when the device says it
received the packet okay (R_OK). This won't generate an interrupt.
- no interrupt generated on BSY clearing, polling needed.
5. issue the second H2D Register FIS (SRST off). The device will clear
BSY when reporting signature with D2H FIS. I cannot find whether the
device is supposed to assert INTRQ on completion or not but it seems not.
- (probably) no interrupt generated on signature reporting.
So, AFAICS, most steps need polling and some are rather long, too. Am I
missing something here?
Thanks. :-)
--
tejun
next prev parent reply other threads:[~2005-12-19 7:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-18 13:33 [RFC/PATCHSET] libata: new reset mechanism Tejun Heo
2005-12-18 13:36 ` [PATCH 01/14] libata: modify ata_dev_try_classify Tejun Heo
2005-12-18 13:38 ` [PATCH 02/14] libata: implement new reset mechanism Tejun Heo
2005-12-19 5:31 ` Jeff Garzik
2005-12-19 6:33 ` Tejun Heo
2005-12-18 13:40 ` [PATCH 03/14] libata: implement standard reset methods Tejun Heo
2005-12-18 13:41 ` [PATCH 04/14] libata: export ata_busy_sleep() Tejun Heo
2005-12-18 13:42 ` [PATCH 05/14] sata_sil: convert to new reset mechanism Tejun Heo
2005-12-18 13:43 ` [PATCH 06/14] sata_sil24: " Tejun Heo
2005-12-18 13:44 ` [PATCH 07/14] sata_sil24: add hardreset Tejun Heo
2005-12-18 13:46 ` [PATCH 08/14] ata_piix: convert pata to new reset mechanism Tejun Heo
2005-12-18 13:47 ` [PATCH 09/14] ata_piix: convert sata " Tejun Heo
2005-12-18 13:48 ` [PATCH 10/14] ahci: separate out ahci_stop/start_engine() Tejun Heo
2005-12-19 5:33 ` Jeff Garzik
2005-12-19 6:05 ` Tejun Heo
2005-12-18 13:49 ` [PATCH 11/14] ahci: convert to new reset mechanism Tejun Heo
2005-12-19 5:33 ` Jeff Garzik
2005-12-19 6:07 ` Tejun Heo
2005-12-18 13:50 ` [PATCH 12/14] ahci: separate out ahci_cmd_prep() Tejun Heo
2005-12-19 5:34 ` Jeff Garzik
2005-12-18 13:51 ` [PATCH 13/14] ahci: add constants for SRST Tejun Heo
2005-12-19 5:35 ` Jeff Garzik
2005-12-18 13:51 ` [PATCH 14/14] ahci: add softreset Tejun Heo
2005-12-19 5:36 ` Jeff Garzik
2005-12-19 6:12 ` Tejun Heo
2005-12-19 6:40 ` Jeff Garzik
2005-12-19 7:13 ` Tejun Heo [this message]
2006-01-29 5:11 ` Jeff Garzik
2005-12-19 5:20 ` [RFC/PATCHSET] libata: new reset mechanism Jeff Garzik
2005-12-19 6:03 ` Tejun Heo
2006-01-29 5:20 ` 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=43A65DA2.2080402@gmail.com \
--to=htejun@gmail.com \
--cc=albertcc@tw.ibm.com \
--cc=jgarzik@pobox.com \
--cc=liml@rtr.ca \
--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 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).