[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <657997b5-1c20-4008-8b70-dc7a7f56c352@lunn.ch>
Date: Fri, 18 Jul 2025 15:58:56 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
kernel@...gutronix.de, linux-kernel@...r.kernel.org,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
Andre Edich <andre.edich@...rochip.com>,
Lukas Wunner <lukas@...ner.de>
Subject: Re: [PATCH net v4 0/3] net: phy: smsc: use IRQ + relaxed polling to
fix missed link-up
On Mon, Jul 14, 2025 at 11:52:37AM +0200, Oleksij Rempel wrote:
> This series makes the SMSC LAN8700 (as used in LAN9512 and similar USB
> adapters) reliable again in configurations where it is forced to 10 Mb/s
> and the link partner still advertises autonegotiation.
I've seen a comment from another Maintainer that thinks this is rather
hackish. I tend to agree, you are adding complexity to the core to
handle one broken PHY, and a corner case in that PHY. It would be
better to hide as much of this in the PHY driver.
I'm wondering if there is a much simpler solution, which does not need
the core changing. Have the driver dynamically flip between interrupts
and polling, depending on the link mode.
Start up in the usual way. If the platform supports interrupts, let
the core get the interrupt, install the handler and use
interrupts. Otherwise do polling.
If .config_aneg() puts the PHY into the broken state, forced to 10
Mb/s, and interrupts are used, set phydev->irq = PHY_POLL, and call
phy_trigger_machine() to kick off polling.
If .config_aneg() is called to take it out of the broken state,
restore phydev->irq. An additional poll up to one second later should
not cause any issues.
I don't think this needs any core code changes.
Maybe there is an issue with phy_free_interrupt() being called while
irq has been set to polling? You might be able to use the
phy_driver.remove() to handle that?
Andrew
Powered by blists - more mailing lists