From: yangxingui <yangxingui@huawei.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: Damien Le Moal <dlemoal@kernel.org>,
<linux-kernel@vger.kernel.org>, <liuyonglong@huawei.com>,
<kangfenglong@huawei.com>, <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] ata: libata-sata: retry hardreset when device detected but PHY not established
Date: Thu, 28 May 2026 15:01:39 +0800 [thread overview]
Message-ID: <b241ef3f-d476-12f2-2862-ca95ff509046@huawei.com> (raw)
In-Reply-To: <afMW2scJrBSI_jLo@ryzen>
On 2026/4/30 16:46, Niklas Cassel wrote:
> On Wed, Apr 29, 2026 at 03:01:48PM +0800, yangxingui wrote:
>>>>>>> This is preceeded by a call to sata_link_resume(), which calls
>>>>>>> sata_link_debounce() and that function makes sure that DET is stable. So if
>>>>>>> after that DET still shows that their is no PHY, there is likely a big problem
>>>>>>> with it and it is super slow to be established.
>
> I agree with Damien, sata_link_debounce() is supposed to make sure that
> DET is stable.
>
>
> sata_link_debounce() will not explicitly wait for SStatus.DET to turn 0x3.
>
> If value is stable, and SStatus.DET == 1, and time is before "deadline",
> sata_link_debounce() will continue looping.
>
> Else, if value is stable, and has been stable for "duration" amount of time,
> it will return.
>
> Since your print shows that SStatus == 1, that most likely means that the
> deadline expired in sata_link_debounce().
>
> I suggest that you try to increase the deadline, perhaps start off by simply
> multiplying it by some factor in sata_link_debounce().
>
>
> It would also be helpful if your commit message explained why returning
> -EAGAIN makes a difference, because from what I can see, if the deadline
> expires, sata_link_debounce() returns 0, which should cause sata_link_resume()
> to return 0, which should cause sata_link_hardreset() to
> return 0, with online == false.
>
> If that is the case ata_do_reset() would return 0, and
> ata_eh_followup_srst_needed() (returns true only if -EAGAIN) would return false.
>
> Which should eventually cause us to retry another hard reset, as long as
> tries <= max_tries.
>
>
> By making sata_link_hardreset() return -EAGAIN, the difference I see is that
> we will for a software reset followed by the hardreset, but you commit message
> did not mention that.
>
> So, my question is, why is it not sufficient to retry another
> hardreset/COMRESET?
>
> Does it work to only do a hardreset (without if a follow up softreset) if you
> increase the deadline?
Latest update: The issue we are currently facing is that the SATA host
side is continuously waiting for the disk to return the COMWAKE
primitive. From the SATA analyzer, it can be seen that the disk has
already returned the COMWAKE primitive. This may be related to poor
COMWAKE signal quality, causing the host to fail to recognize it.
Performing a hard reset might be able to fix the issue.
Thanks
Xingui
next prev parent reply other threads:[~2026-05-28 7:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 6:04 Xingui Yang
2026-04-25 22:53 ` Damien Le Moal
2026-04-27 1:51 ` yangxingui
2026-04-27 4:45 ` Damien Le Moal
2026-04-29 1:14 ` yangxingui
2026-04-29 1:36 ` Damien Le Moal
2026-04-29 7:01 ` yangxingui
2026-04-30 8:46 ` Niklas Cassel
2026-04-30 9:28 ` Niklas Cassel
2026-05-06 2:23 ` yangxingui
2026-05-28 7:01 ` yangxingui [this message]
2026-05-28 7:09 ` Niklas Cassel
2026-05-29 1:21 ` yangxingui
2026-04-27 13:17 ` Niklas Cassel
2026-04-29 1:06 ` yangxingui
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=b241ef3f-d476-12f2-2862-ca95ff509046@huawei.com \
--to=yangxingui@huawei.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=kangfenglong@huawei.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
/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
all inboxes | Powered by JetHome®