netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
Cc: 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 15:07:51 +0200	[thread overview]
Message-ID: <YILGp+LdyxsRhkb2@lunn.ch> (raw)
In-Reply-To: <20210423124329.993850-1-radu-nicolae.pirea@oss.nxp.com>

> +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

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 12:43 [PATCH] phy: nxp-c45-tja11xx: add interrupt support Radu Pirea (NXP OSS)
2021-04-23 13:07 ` Andrew Lunn [this message]
2021-04-23 13:42   ` Vladimir Oltean
2021-04-23 13:46     ` Vladimir Oltean
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=YILGp+LdyxsRhkb2@lunn.ch \
    --to=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;
as well as URLs for NNTP newsgroup(s).