Re: [PATCH net-next v2 3/3] net: phy: dp83tg720: switch to adaptive polling and remove random delays
From: Andrew Lunn
Date: Thu Jun 12 2025 - 11:45:58 EST
On Thu, Jun 12, 2025 at 12:41:57PM +0200, Oleksij Rempel wrote:
> From: David Jander <david@xxxxxxxxxxx>
>
> Now that the PHY reset logic includes a role-specific asymmetric delay
> to avoid synchronized reset deadlocks, the previously used randomized
> polling intervals are no longer necessary.
>
> This patch removes the get_random_u32_below()-based logic and introduces
> an adaptive polling strategy:
> - Fast polling for a short time after link-down
> - Slow polling if the link remains down
> - Slower polling when the link is up
>
> This balances CPU usage and responsiveness while avoiding reset
> collisions. Additionally, the driver still relies on polling for
> all link state changes, as interrupt support is not implemented,
> and link-up events are not reliably signaled by the PHY.
>
> The polling parameters are now documented in the updated top-of-file
> comment.
>
> Co-developed-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> Signed-off-by: David Jander <david@xxxxxxxxxxx>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew