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

From: yangxingui

Date: Tue May 05 2026 - 22:24:00 EST




On 2026/4/30 17:28, Niklas Cassel wrote:
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++]);

Increasing the deadline of the debound does not solve the problem. Additionally, we do not have a customer environment locally, so we are not sure whether retry a hardreset can completely resolve the issue. However, in this scenario, the SATA hard disk manufacturer has added a mechanism to attempt to proactively trigger COMINIT for re-establishing the link after an abnormal link establishment. Feedback from pressure testing indicates that the issue has been resolved. ^-^

Thanks,
Xingui
.