Re: [PATCH net-next 2/3] net: ethernet: oa_tc6: deliver the PHY interrupt to phylib

From: Andrew Lunn

Date: Thu Sep 03 2026 - 11:40:51 EST



On Thu, Sep 03, 2026 at 06:53:40PM +0530, Parthiban Veerasooran wrote:
> Hi Andrew,
>
> On 02/09/26 6:00 am, Andrew Lunn wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >
> > > @@ -600,6 +642,16 @@ static int oa_tc6_phy_init(struct oa_tc6 *tc6)
> > > return -ENODEV;
> > > }
> > >
> > > + ret = oa_tc6_phy_irq_setup(tc6);
> > > + if (ret) {
> > > + oa_tc6_mdiobus_unregister(tc6);
> > > + return ret;
> > > + }
> > > +
> > > + /* Deliver the PHY interrupt through the nested virtual IRQ. Set before
> > > + * phy_connect_direct() so phylib enters interrupt mode.
> > > + */
> > > + tc6->phydev->irq = tc6->phy_virq;
> >
> > I don't know how messy it will be, but it is better to set
> > mii_bus->irq[] to the interrupt number. phy_device_create() will then
> > copy it into phydev->irq.

> Thanks for the suggestion. To use mii_bus->irq[] so that phy_device_create()
> picks it up, we would need to set mii_bus->irq[addr] with created virtual
> irq number before mdiobus_register(). However, the PHY MDIO address is not
> known until phy_find_first() returns, so we cannot pre-populate
> mii_bus->irq[addr] before the bus scan runs.

This is why i made the comment, i did not know how messy it would be.

Where it becomes interesting is the recent patch:

https://patchwork.kernel.org/project/netdevbpf/patch/20260902080511.2211261-3-f@xxxxxx/

It just seems a bit brittle, phydev->irq says one thing, mii_bus->irq[]
says something else.

Maybe set all member of mii_bus->irq[]?

Andrew