All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: yangxingui <yangxingui@huawei.com>
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, 30 Apr 2026 11:28:00 +0200	[thread overview]
Message-ID: <afMgoFBFPWR0f4gK@ryzen> (raw)
In-Reply-To: <afMW2scJrBSI_jLo@ryzen>

On Thu, Apr 30, 2026 at 10:46:22AM +0200, Niklas Cassel wrote:
> 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.

I see now that max_tries is just set to 1.

I think I would prefer another hardreset (with a larger timeout) over
a follow-up softreset after the hardreset...

If -EAGAIN is reserved for "do an follow up SRST after the COMRESET",
because certain Port Multipliers need it.

Perhaps introduce another error code, which means, device detected,
overload max_tries to 3 and goto retry.

That way we will retry using COMRESET, with increasing timeouts, since:
deadline = ata_deadline(jiffies, ata_eh_reset_timeouts[try++]);


Kind regards,
Niklas

  reply	other threads:[~2026-04-30  9:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25  6:04 [PATCH] ata: libata-sata: retry hardreset when device detected but PHY not established 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 [this message]
2026-05-06  2:23                 ` 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=afMgoFBFPWR0f4gK@ryzen \
    --to=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 \
    --cc=yangxingui@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.