[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aMxmrnmDEqn0Nvx1@shell.armlinux.org.uk>
Date: Thu, 18 Sep 2025 21:08:14 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
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,
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 Thu, Sep 18, 2025 at 09:48:33PM +0200, Andrew Lunn wrote:
> > How about a minimal change instead: conditionally call
> > phy_queue_state_machine() from lan87xx_config_aneg()? That would trigger
> > a poll in the broken mode without touching phydev->irq or core teardown
> > paths. Seems less intrusive than rewriting IRQ handling.
>
> It is currently a static function, so that would have to change.
>
> Or it might be better to add phy_trigger_machine_soon(), using the
> default 1 second delay? And i would document it as only to be used by
> broken PHYs, to try to stop it being abused. Anybody using it needs to
> acknowledge their PHY is broken.
Couldn't this be even simpler? If the problem is the interrupt
isn't raised, then how about the following.
(This assumes there is no issue with calling phy_trigger_machine()
from IRQ context.)
When lan87xx_config_aneg() detects that we're configuring into the
broken mode, start a timer (which has been pre-initialised at probe
time.) When the timer fires, call phy_trigger_machine(), and modify
the timer for the next poll interval.
When lan87xx_config_aneg() detects that we aren't in the broken
mode, delete the timer synchronously. Also delete the timer when
the PHY is suspended or unbound.
This requires no changes necessary to the core phylib code, and no
fiddling with fragile state either. Does it matter if the
interrupt does fire? Not really.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists