[PATCH net v8 2/4] net: usb: smsc95xx: register the PHY interrupt with the MDIO bus
From: Aleksei Sviridkin
Date: Thu Sep 17 2026 - 22:04:49 EST
The interrupt this driver maps for its PHY is written only into
phydev->irq, while the bus table mdiobus->irq[] keeps reading PHY_POLL
for the same address. That table is where phylib records what the bus
described - phy_device_create() seeds phydev->irq from it - so the
number lives only as long as nothing else writes that one field.
The bus is the one this function registered a few lines earlier, so
record the number there as well.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@xxxxxx>
---
Notes:
Compile-tested only; I have no LAN95xx device.
No Fixes: tag, for the same reason as patch 1: the write has no reader until
patch 3 lands.
Teardown order keeps the number live for as long as it is read:
smsc95xx_unbind() disconnects the PHY before it disposes the interrupt
mapping.
drivers/net/usb/smsc95xx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 42e4048b574b..130a460c1f54 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1252,6 +1252,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
goto unregister_mdio;
}
+ pdata->mdiobus->irq[pdata->phydev->mdio.addr] = phy_irq;
pdata->phydev->irq = phy_irq;
pdata->phydev->is_internal = pdata->is_internal_phy;
--
2.53.0