Re: [PATCH net-next v8 01/16] net: dsa: vsc73xx: use read_poll_timeout instead delay loop
From: Vladimir Oltean
Date: Fri Apr 05 2024 - 10:32:55 EST
On Wed, Apr 03, 2024 at 12:37:17PM +0200, Pawel Dembicki wrote:
> Switch the delay loop during the Arbiter empty check from
> vsc73xx_adjust_link() to use read_poll_timeout(). Functionally,
> one msleep() call is eliminated at the end of the loop in the timeout
> case.
>
> As Russell King suggested:
>
> "This [change] avoids the issue that on the last iteration, the code reads
> the register, tests it, finds the condition that's being waiting for is
> false, _then_ waits and end up printing the error message - that last
> wait is rather useless, and as the arbiter state isn't checked after
> waiting, it could be that we had success during the last wait."
>
> Suggested-by: Russell King <linux@xxxxxxxxxxxxxxx>
> Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
> Signed-off-by: Pawel Dembicki <paweldembicki@xxxxxxxxx>
> ---
Reviewed-by: Vladimir Oltean <olteanv@xxxxxxxxx>