Re: [PATCH] ata: libata-sata: retry hardreset when device detected but PHY not established

From: Niklas Cassel

Date: Thu Apr 30 2026 - 05:28:24 EST


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