From: netdev-bot+sashiko@kernel.org
To: iav@iav.lv
Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, tglx@kernel.org, linux-pm@vger.kernel.org,
maxime.chevallier@bootlin.com, lukas@wunner.de,
rafael.j.wysocki@intel.com, wei.fang@nxp.com,
niklas.soderlund@ragnatech.se, paul@pbarker.dev,
florian.fainelli@broadcom.com, opendmb@gmail.com,
Thangaraj.S@microchip.com, shenwei.wang@nxp.com,
Haoning.CHENG@cn.bosch.com, willemb@google.com,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v10 4/5] net: phy: run a postponed PHY interrupt handler directly on resume
Date: Thu, 03 Dec 2026 20:31:16 +0000 [thread overview]
Message-ID: <179632987638.3146.11819698658112682145@kernel.org> (raw)
In-Reply-To: <20261202-b4-phylib-mac-pm-irq-v3-v10-4-2f938d473f17@iav.lv>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In mdio_bus_phy_resume_irq() (drivers/net/phy/phy_device.c), the
comment "A nested threaded line has no thread; we run the handler"…
--
net: phy: run a postponed PHY interrupt handler directly on resume
When a PHY interrupt was postponed during suspend, the resume path used to
rerun it with irq_wake_thread(). This patch replaces that with a direct
call to the PHY driver's handle_interrupt() from mdio_bus_phy_resume_irq(),
made only when the PHY still has its interrupt requested. A new
irq_requested flag, protected by irq_pm_lock, tracks whether the interrupt
is requested.
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 2d2058c29f300..16b398794486f 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -355,12 +355,19 @@ static __maybe_unused void mdio_bus_phy_resume_irq(struct phy_device *phydev)
[ ... ]
> if (phydev->irq_rerun) {
> phydev->irq_rerun = false;
> enable_irq(phydev->irq_rerun_line);
> - if (phydev->irq == phydev->irq_rerun_line)
> - irq_wake_thread(phydev->irq, phydev);
> + /* A nested threaded line has no thread; we run the handler */
> + if (phydev->irq == phydev->irq_rerun_line &&
> + phydev->irq_requested) {
> + mutex_lock(&phydev->lock);
> + phydev->drv->handle_interrupt(phydev);
> + mutex_unlock(&phydev->lock);
> + }
[Severity: Low]
This isn't a bug, but could this comment be reworded? It reads as if
the direct call only happens for nested threaded lines. The only
conditions are:
phydev->irq == phydev->irq_rerun_line && phydev->irq_requested
so irq_wake_thread() is now dropped for every line type. A normal
threaded PHY line, which used to rerun in its IRQ thread, now also
runs handle_interrupt() inline in the PM resume callback. It does so
with irq_pm_lock and phydev->lock held, and the irqreturn_t is
discarded.
The commit message covers the general change. The worry is that a
reader or backporter takes the in-code comment as the condition for
the call, when it is really the reason the thread wake was dropped.
Something like "Run the handler directly, since a nested threaded
line has no thread to wake" might be clearer.
One related side effect: on a level-triggered line that is still
asserted, enable_irq() can wake the IRQ thread while this direct
call also runs. Both paths take phydev->lock, so the second run
should just find no pending status and return IRQ_NONE.
> }
> mutex_unlock(&phydev->irq_pm_lock);
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-b4-phylib-mac-pm-irq-v3-v10-0-2f938d473f17%40iav.lv
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-12-03 20:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 20:16 [PATCH net v10 0/5] net: phy: postpone PHY interrupts during sleep with MAC-managed PM Igor Velkov via B4 Relay
2026-12-02 20:16 ` [PATCH net v10 1/5] net: phy: move irq_suspended and irq_rerun out of the bitfield Igor Velkov via B4 Relay
2026-12-02 20:16 ` [PATCH net v10 2/5] net: phy: fix three paths that unbalance a postponed PHY interrupt line Igor Velkov via B4 Relay
2026-12-03 20:31 ` netdev-bot+sashiko
2026-12-02 20:16 ` [PATCH net v10 3/5] net: phy: stop postponing PHY interrupts when phy_suspend() fails Igor Velkov via B4 Relay
2026-12-02 20:16 ` [PATCH net v10 4/5] net: phy: run a postponed PHY interrupt handler directly on resume Igor Velkov via B4 Relay
2026-12-03 20:31 ` netdev-bot+sashiko [this message]
2026-12-02 20:16 ` [PATCH net v10 5/5] net: phy: postpone PHY interrupts during sleep with MAC-managed PM Igor Velkov via B4 Relay
2026-12-03 20:31 ` netdev-bot+sashiko
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=179632987638.3146.11819698658112682145@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=Haoning.CHENG@cn.bosch.com \
--cc=Thangaraj.S@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=hkallweit1@gmail.com \
--cc=iav@iav.lv \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=lukas@wunner.de \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.com \
--cc=paul@pbarker.dev \
--cc=rafael.j.wysocki@intel.com \
--cc=shenwei.wang@nxp.com \
--cc=tglx@kernel.org \
--cc=wei.fang@nxp.com \
--cc=willemb@google.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