Re: [PATCH net v11 1/4] net: usb: lan78xx: register the PHY interrupt with the MDIO bus

From: Andrew Lunn

Date: Sun Sep 27 2026 - 14:30:03 EST


On Sun, Sep 27, 2026 at 02:50:21AM +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.
>
> Put it in the table before the bus is registered, so that the PHY the
> scan creates is born with the number, and drop the write to phydev->irq
> that phylib then makes by itself. Fill the whole table rather than one
> entry: for 7801 the address is not known until the scan, and for the
> other two phy_mask leaves only address 1 readable, so a loop costs less
> than a second switch on the chip id. A devicetree PHY node that
> describes an interrupt now overrides that, where the driver's number
> used to win.
>
> 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