Re: [net-next,v6,3/3] w5100: detect carrier state using link status bit and optional interrupt

From: Arthur Crepin Leblond

Date: Thu Sep 03 2026 - 12:17:18 EST


On Thu, Sep 03, 2026 at 03:08:24PM +0200, Arthur Crepin Leblond wrote:
On Thu, Sep 03, 2026 at 12:56:04AM +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
Since || short-circuits, w5100_get_link() is not called at all when link_irq
is negative and the carrier is unconditionally turned on. The ethtool
callback added just above, however, keys on the chip id rather than on
link_irq:

if (priv->ops->chip_id == W5500)
return w5500_get_phycfgr_lnk(ndev);


Again, good catch! One could setup the w5500 without the link IRQ but
still use the PHCFGR register for the carrier state.

One more time about this one, if we use w5500 without an interrupt the
carrier state will be the one read from PHYCFGR bit and will never
change.

w5100_open:
w5100_get_link -> 0
netif_carrier_off // stays off forever?

There is probably no good solution, the user can only get the real
state with .get_link.

I think netif_carrier_on should initially be called if there
is no interrupt configured, that way the state stays on like on
w5100/w5200.

Arthur