mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>,
	hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
	kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: nxp-c45-tja11xx: add interrupt support
Date: Fri, 23 Apr 2021 16:46:08 +0300	[thread overview]
Message-ID: <20210423134608.43tojxbeq36jtip2@skbuf> (raw)
In-Reply-To: <20210423134229.5cgxprkdcxf7kkwy@skbuf>

On Fri, Apr 23, 2021 at 04:42:29PM +0300, Vladimir Oltean wrote:
> 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.

Ah, you mean the driver could be ACKing an event which was not the event
that triggered this IRQ. In that case, the ordering should be reversed,
sorry for the noise.

  reply	other threads:[~2021-04-23 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 12:43 Radu Pirea (NXP OSS)
2021-04-23 13:07 ` Andrew Lunn
2021-04-23 13:42   ` Vladimir Oltean
2021-04-23 13:46     ` Vladimir Oltean [this message]
2021-04-23 13:47       ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210423134608.43tojxbeq36jtip2@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=radu-nicolae.pirea@oss.nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®