From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Andrew Lunn <andrew@lunn.ch>
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: Thu, 09 Mar 2023 11:52:06 +0100 [thread overview]
Message-ID: <2156693.PYKUYFuaPT@steina-w> (raw)
In-Reply-To: <Y/4YN+j19SZNEizu@lunn.ch>
Hi Andrew,
thanks for the response.
Am Dienstag, 28. Februar 2023, 16:05:27 CET schrieb Andrew Lunn:
> > +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()?
I was going the same way kszphy_suspend() (micrel.c) is doing. Maybe that was
a bad example and it should be changed as well.
There should be no reason to not call dp83867_config_intr directly.
> > +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?
Yes, your explanation sounds reasonable, unfortunately I can't test this right
now, as there is some other error regarding PMIC power domains.
If your reasoning is true then micrel.c has the same issue.
Best regards,
Alexander
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
next prev parent reply other threads:[~2023-03-09 10:52 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
2023-03-09 10:52 ` Alexander Stein [this message]
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=2156693.PYKUYFuaPT@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=andrew@lunn.ch \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox