From: John Garry <john.garry@huawei.com>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Niklas Cassel <Niklas.Cassel@wdc.com>,
Hannes Reinecke <hare@suse.de>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
Xiang Chen <chenxiang66@hisilicon.com>
Subject: Re: libata and software reset
Date: Wed, 19 Oct 2022 11:34:02 +0100 [thread overview]
Message-ID: <3963334b-6c76-474f-0003-28da53d0ca76@huawei.com> (raw)
In-Reply-To: <399805b2-d632-997b-5f90-c5e98357d53a@opensource.wdc.com>
On 19/10/2022 11:15, Damien Le Moal wrote:
>> For hisi_sas, maybe ATA_CMD_DEV_RESET is silently ignored when issued
>> for a SATA disk, but having SRST set/unset still takes effect (and that
>> is how it still works). I need to check on that.
> Checked SATA-IO v3.5a. Software reset is explained in "11.4
> Software reset protocol" and involves 2 things for the host to do:
>
> DSR0: Software_reset_asserted, this state is entered if a Register Host
> to Device FIS is received with the C bit in the FIS cleared to zero and
> the SRST bit set to one in the Device Control register.
> If in this state, the device begins its initialization and diagnostics
> processing and awaits the clearing of the SRST bit.
>
> DSR1: Execute_diagnostics, this state is entered if a Register Host to
> Device FIS is received with the C bit in the FIS cleared to zero and the
> SRST bit cleared to zero in the Device Control register.
> If in this state, the device completes initialization and processing of
> its diagnostics.
>
> Which confirms what libahci is doing: essentially zeroing a tf with
> ata_tf_init() and setting + resetting the SRST bit, sending the tf each
> time.
Ah, so since the C bit is not set in hisi_sas_fill_ata_reset_cmd(), I
think that the command field is just ignored. Indeed, the spec says that
setting C and SRST together is invalid.
Thanks,
John
prev parent reply other threads:[~2022-10-19 13:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 13:24 libata and software reset John Garry
2022-10-18 15:04 ` Niklas Cassel
2022-10-19 9:32 ` John Garry
2022-10-19 9:56 ` Damien Le Moal
2022-10-19 10:15 ` John Garry
2022-10-19 5:03 ` Damien Le Moal
2022-10-19 5:04 ` Damien Le Moal
2022-10-19 9:42 ` John Garry
2022-10-19 9:53 ` Damien Le Moal
2022-10-19 10:15 ` Damien Le Moal
2022-10-19 10:34 ` John Garry [this message]
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=3963334b-6c76-474f-0003-28da53d0ca76@huawei.com \
--to=john.garry@huawei.com \
--cc=Niklas.Cassel@wdc.com \
--cc=chenxiang66@hisilicon.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@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