Re: [PATCH net v11 2/4] net: usb: smsc95xx: register the PHY interrupt with the MDIO bus
From: Andrew Lunn
Date: Sun Sep 27 2026 - 14:30:49 EST
On Sun, Sep 27, 2026 at 02:50:22AM +0300, Aleksei Sviridkin wrote:
> 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 is about to register, so put the number
> in its table first and let the scan seed the PHY from there. The whole
> table gets it: with an external PHY the address is not known until the
> scan, and with the internal one phy_mask has already left a single
> reachable entry, so a loop costs less than a branch on which case this
> is.
>
> Found going through the drivers that keep a PHY interrupt outside the
> bus table, so that the restore on detach later in this series has a
> number to hand back here as well.
>
> Assisted-by: LLM
> Signed-off-by: Aleksei Sviridkin <f@xxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew