Linux ATA/IDE development
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: Hannes Reinecke <hare@suse.de>,
	"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:15:14 +0100	[thread overview]
Message-ID: <485beb99-d2a1-77d5-7a73-80bc3955f1f9@huawei.com> (raw)
In-Reply-To: <01229332-aa52-0952-5ef5-a223d726a369@opensource.wdc.com>

On 19/10/2022 10:56, Damien Le Moal wrote:
>> The difference really comes down to the controller programming interface.
>>
>> For ahci we have a MMIO interface to issue the software reset command.
>>
>> For my SAS controller of interest, there is no such MMIO interface. To
>> issue the reset we build a h2d fis with a SRST set, and send on the
>> controller ring buffer like any other IO.
>>
>> As I mentioned, we can set the SRST for the h2d fis on the HW interface
>> without issue, and it works fine. The problem for me is that the command
>> comes via libsas/driver, and I would like it to come from libata such
>> that it has a ATA queued command associated. But then we have the
>> problem that the port is frozen at such times that we want to issue this
>> command.
> Yeah, qc is too high level for this to work.

Some more background is that this is all related to the "reserved" 
commands work. The issue is that it is difficult to differentiate 
between this libsas softreset command and normal ATA queued commands - 
the normal check is "is the device associated sata", but that doesn't 
work. If we could always have a ATA queued command, then that would be 
better. But, as you say, it is too high level.

Let me check what else I would do. BTW, I will send an update on that 
work in a day or so.

> But we could probably do
> something generic at TF or FIS level. libata-sata.c has already some
> code in that area, something for a "reset TF/FIS" would fit in that file
> too. libahci could also use that too.
>

yeah, that would seem a good consolidation.

Thanks!

  reply	other threads:[~2022-10-19 13:17 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 [this message]
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

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=485beb99-d2a1-77d5-7a73-80bc3955f1f9@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