mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v13 0/4] net: phy: keep a PHY interrupt across a generic bind cycle
@ 2026-10-01 13:02 Aleksei Sviridkin
  2026-10-01 13:02 ` [PATCH net v13 1/4] net: usb: lan78xx: register the PHY interrupt with the MDIO bus Aleksei Sviridkin
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Aleksei Sviridkin @ 2026-10-01 13:02 UTC (permalink / raw)
  To: netdev
  Cc: andrew, andrew+netdev, hkallweit1, linux, davem, edumazet, kuba,
	pabeni, horms, olteanv, Thangaraj.S, UNGLinuxDriver,
	steve.glendinning, f.fainelli, linux-usb, linux-kernel,
	Aleksei Sviridkin

On a Keenetic KN-1012 the EN8811H PHY behind lan4 has its driver as a
module on the root filesystem, so it binds to the generic driver first.
phy_probe() replaces its interrupt with PHY_POLL, and nothing puts it
back when the real driver takes over, so the PHY is polled for the rest
of the uptime.

Patches 1 and 2 put the lan78xx and smsc95xx PHY interrupts into the
MDIO bus table entry of the PHY each driver uses, so there is a number
to restore for them too. Patch 3 restores the interrupt from that table
in phy_detach(). Patch 4 restores it when the generic bind fails inside
phy_attach_direct().

Not covered: a driver without interrupt support that is bound or
unbound through sysfs still leaves PHY_POLL behind. Removing the
substitution from phy_probe() would fix that too, and belongs in
net-next.

Patches 1 and 2 are compile-tested only; a Tested-by from someone with
a LAN78xx or LAN95xx device would help. Patch 4 touches lines that
patch 2 of the attach guard series [3] also changes, so whichever lands
second needs a trivial rebase.

Other drivers that write phydev->irq outside the bus table, checked
against net/main:
 - ixp4xx_eth, ax88796c and emac-mac force PHY_POLL themselves, and
   none of them attaches again after a detach without forcing it again.
 - stmmac and mlxbf_gige already write mdiobus->irq[] as well.
 - bcmasp for an internal PHY, genet for an internal PHY before v5,
   and tsnep set PHY_MAC_INTERRUPT again after each connect, so a
   restore does not last. icplus sets it on every status read of a
   switch port.
 - sxgbe does it only from probed_phy_irq, which nothing in tree sets.
 - ucc_geth only reads the field.

Changes in v13 (since v12) [1]:
 - Patches 1 and 2 write only the table entry of the PHY the driver
   uses. v12 filled every entry, which gave the one interrupt to every
   PHY on a LAN7801 bus. Andrew's Reviewed-by is dropped from both.
 - Patches 3 and 4 touch only the PHY being detached or attached, and
   keep their code. Patch 4 stays separate: its Fixes: tag differs, and
   with patch 3 alone the failed bind behaves as it did before the
   series.

Older changelogs are in the v12 cover [1] and the v11 cover [2].

[1] https://lore.kernel.org/r/20260927235733.2619081-1-f@lex.la/
[2] https://lore.kernel.org/r/20260926235024.705646-1-f@lex.la/
[3] https://lore.kernel.org/r/20260924215951.2127682-1-f@lex.la/

Aleksei Sviridkin (4):
  net: usb: lan78xx: register the PHY interrupt with the MDIO bus
  net: usb: smsc95xx: register the PHY interrupt with the MDIO bus
  net: phy: take the interrupt back from the bus on detach
  net: phy: restore the interrupt when the generic bind cycle fails

 drivers/net/phy/phy_device.c | 4 ++++
 drivers/net/usb/lan78xx.c    | 1 +
 drivers/net/usb/smsc95xx.c   | 1 +
 3 files changed, 6 insertions(+)


base-commit: a7bfaba4823e3c165bb2004c74eff7c096672bc7
-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-05 16:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 13:02 [PATCH net v13 0/4] net: phy: keep a PHY interrupt across a generic bind cycle Aleksei Sviridkin
2026-10-01 13:02 ` [PATCH net v13 1/4] net: usb: lan78xx: register the PHY interrupt with the MDIO bus Aleksei Sviridkin
2026-10-05 16:52   ` Andrew Lunn
2026-10-01 13:02 ` [PATCH net v13 2/4] net: usb: smsc95xx: " Aleksei Sviridkin
2026-10-05 16:53   ` Andrew Lunn
2026-10-01 13:02 ` [PATCH net v13 3/4] net: phy: take the interrupt back from the bus on detach Aleksei Sviridkin
2026-10-05 13:26   ` netdev-bot+sashiko
2026-10-05 16:55   ` Andrew Lunn
2026-10-01 13:02 ` [PATCH net v13 4/4] net: phy: restore the interrupt when the generic bind cycle fails Aleksei Sviridkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®