All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] net: phy: dp83867: Disable IRQs on suspend
Date: Tue, 28 Feb 2023 16:05:27 +0100	[thread overview]
Message-ID: <Y/4YN+j19SZNEizu@lunn.ch> (raw)
In-Reply-To: <20230228133412.7662-1-alexander.stein@ew.tq-group.com>

> +static int dp83867_suspend(struct phy_device *phydev)
> +{
> +	/* Disable PHY Interrupts */
> +	if (phy_interrupt_is_valid(phydev)) {
> +		phydev->interrupts = PHY_INTERRUPT_DISABLED;
> +		if (phydev->drv->config_intr)
> +			phydev->drv->config_intr(phydev);

It seems odd going via phydev->drv inside the driver to call functions
which are also inside the driver. Why do you not directly call dp83867_config_intr()?

> +static int dp83867_resume(struct phy_device *phydev)
> +{
> +	genphy_resume(phydev);
> +
> +	/* Enable PHY Interrupts */
> +	if (phy_interrupt_is_valid(phydev)) {
> +		phydev->interrupts = PHY_INTERRUPT_ENABLED;
> +		if (phydev->drv->config_intr)
> +			phydev->drv->config_intr(phydev);
> +	}

Is there a race here? Say the PHY is in a fixed mode, not
autoneg. Could it be, that as soon as you clear the power down bit in
genphy_resume() it signals a link up interrupt? dp83867_config_intr()
then acknowledged and clears that interrupt, before enabling the
interrupt, so the link up event never gets passed to phylib? Maybe the
order needs reversing here?

	   Andrew

  reply	other threads:[~2023-02-28 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 13:34 [PATCH 1/1] net: phy: dp83867: Disable IRQs on suspend Alexander Stein
2023-02-28 15:05 ` Andrew Lunn [this message]
2023-03-09 10:52   ` Alexander Stein
2023-03-01  6:29 ` Heiner Kallweit
2023-03-09 10:34   ` Alexander Stein

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=Y/4YN+j19SZNEizu@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.