Re: [PATCH] phy: nxp-c45-tja11xx: add interrupt support

From: Andrew Lunn
Date: Fri Apr 23 2021 - 09:08:12 EST


> +static irqreturn_t nxp_c45_handle_interrupt(struct phy_device *phydev)
> +{
> + irqreturn_t ret = IRQ_NONE;
> + int irq;
> +
> + irq = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_PHY_IRQ_STATUS);
> + if (irq & PHY_IRQ_LINK_EVENT) {
> + phy_trigger_machine(phydev);
> + phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_PHY_IRQ_ACK,
> + PHY_IRQ_LINK_EVENT);

The ordering here is interesting. Could phy_trigger_machine() cause a
second interrupt? Which you then clear without acting upon before
exiting the interrupt handler? I think you should ACK the interrupt
before calling phy_trigger_machine().

Andrew