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

From: Parthiban Veerasooran

Date: Thu Sep 03 2026 - 10:01:53 EST


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.

Am I misunderstanding your suggestion? Happy to rework if there's a cleaner way.

Best regards,
Parthiban V

Andrew