net: sfp: rework the RollBall PHY waiting code
authorMarek Behún <kabel@kernel.org>
Tue, 21 Nov 2023 17:20:24 +0000 (18:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Nov 2023 19:17:28 +0000 (19:17 +0000)
commit2f3ce7a56c6e02bc0b258507f3a82b7511f62f9e
tree3896bdd94f2a28dda94703397400ed531144ad01
parent53775da0b4768cd7e603d7ac1ad706c383c6f61e
net: sfp: rework the RollBall PHY waiting code

RollBall SFP modules allow the access to PHY registers only after a
certain time has passed. Until then, the registers read 0xffff.

Currently we have quirks for modules where we need to wait either 25
seconds or 4 seconds, but recently I got hands on another module where
the wait is even shorter.

Instead of hardcoding different wait times, lets rework the code:
- increase the PHY retry count to 25
- when RollBall module is detected, increase the PHY retry time from
  50ms to 1s

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c