[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2156693.PYKUYFuaPT@steina-w>
Date: Thu, 09 Mar 2023 11:52:06 +0100
From: Alexander Stein <alexander.stein@...tq-group.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 1/1] net: phy: dp83867: Disable IRQs on suspend
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/
Powered by blists - more mailing lists