From: Heiner Kallweit <hkallweit1@gmail.com>
To: Laurent Badel <laurentbadel@eaton.com>,
netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-kernel@vger.kernel.org,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Pavel Machek <pavel@ucw.cz>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH net 0/1] net: phy: Fix interrupt mask loss on resume from hibernation
Date: Fri, 22 Jan 2021 16:19:51 +0100 [thread overview]
Message-ID: <32cbb60d-67f3-765a-d51e-48d74c0785d6@gmail.com> (raw)
In-Reply-To: <20210122143524.14516-1-laurentbadel@eaton.com>
On 22.01.2021 15:35, Laurent Badel wrote:
> Some PHYs such as SMSC LAN87xx clear the interrupt mask register on
> software reset. Since mdio_bus_phy_restore() calls phy_init_hw() which
> does a software reset of the PHY, these PHYs will lose their interrupt
> mask configuration on resuming from hibernation.
The (optional) software reset is done via soft_reset callback.
So if the PHY in question needs special treatment after a soft reset,
why not add it to the soft_reset callback?
>
> I initially reconfigured only the PHY interrupt mask using
> phydev->config_intr(), which worked fine with PM_DEBUG/test_resume, but
> there seems to be an issue when resuming from a real hibernation, by which
> the interrupt type is not set appropriately (in this case
> IRQ_TYPE_LEVEL_LOW). Calling irq_set_irq_type() directly from sysfs
This sounds to me like a lower level driver (e.g. for GPIO / interrupt
controller) not resuming properly from hibernation. Supposedly things
like edge/level high/low/both are stored per interrupt line in a register
of the interrupt controller, and the controller would have to restore
the register value on resume from hibernation. You may want to have
a look at that driver.
> restored the PHY functionality immediately suggesting that everything is
> otherwise well configured. Therefore this patch suggests freeing and
> re-requesting the interrupt, to guarantee proper interrupt configuration.
>
> Laurent Badel (1):
> net: phy: Reconfigure PHY interrupt in mdio_bus_phy_restore()
>
> drivers/net/phy/phy_device.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
next prev parent reply other threads:[~2021-01-22 15:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-22 14:35 [PATCH net 0/1] net: phy: Fix interrupt mask loss on resume from hibernation Laurent Badel
2021-01-22 14:35 ` [PATCH net 1/1] net: phy: Reconfigure PHY interrupt in mdio_bus_phy_restore() Laurent Badel
2021-01-22 15:19 ` Heiner Kallweit [this message]
2021-01-22 16:12 ` [EXTERNAL] Re: [PATCH net 0/1] net: phy: Fix interrupt mask loss on resume from hibernation Badel, Laurent
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=32cbb60d-67f3-765a-d51e-48d74c0785d6@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=laurentbadel@eaton.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@rjwysocki.net \
/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).