lkml.org 
[lkml]   [2021]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] phy: nxp-c45-tja11xx: add interrupt support
On Fri, Apr 23, 2021 at 03:07:51PM +0200, Andrew Lunn wrote:
> > +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().

I thought that the irqchip driver keeps the interrupt line disabled
until the handler finishes, and that recursive interrupts aren't a thing
in Linux? Even with threaded interrupts, I thought this is what
IRQF_ONESHOT deals with.

\
 
 \ /
  Last update: 2021-04-23 15:43    [W:0.056 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site