From: netdev-bot+sashiko@kernel.org
To: parthiban.veerasooran@microchip.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, hkallweit1@gmail.com,
linux@armlinux.org.uk, netdev@vger.kernel.org,
UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next RESEND v4 3/4] microchip: lan865x: enable PHY interrupt via virtual IRQ
Date: Wed, 25 Nov 2026 13:05:28 +0000 [thread overview]
Message-ID: <179561192833.3135.495365531706227788@kernel.org> (raw)
In-Reply-To: <20261124124930.485323-4-parthiban.veerasooran@microchip.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 (1) · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] Setting OA_TC6_PHY_INT moves the LAN865X PHY from polling to
interrupt mode.
- [Low] Tagging and backport problem.
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but
lan865x_remove() calls cancel_work_sync(&priv->multicast_work) before…
--
microchip: lan865x: enable PHY interrupt via virtual IRQ
This patch makes lan865x_probe() pass the OA_TC6_PHY_INT quirk flag to
oa_tc6_init(), which turns on the oa_tc6 virtual IRQ for the internal
PHY. phylib then runs in interrupt mode. As a result, CDEN follows PLCA
transitions through lan86xx_config_intr() and lan86xx_handle_interrupt()
instead of the polling-based resync.
> CDEN is synchronized to the live PLCA status when lan86xx_config_intr()
> runs during phy_enable_interrupts(), then tracked on each subsequent
> PLCA transition via lan86xx_handle_interrupt(). This PHY interrupt path
> is critical for keeping CDEN correct across PLCA transitions.
>
> Fixes: 78341049fbcd ("net: phy: microchip_t1s: configure collision detection based on PLCA mode")
[Severity: Low]
Can this patch be backported on its own? It uses OA_TC6_PHY_INT, but at
the baseline include/linux/oa_tc6.h only defines OA_TC6_BROKEN_PHY. The
new flag comes from the prerequisite "net: ethernet: oa_tc6: deliver the
PHY interrupt to phylib", together with the irq_chip, irq_domain and
phy_irq_work code.
That prerequisite has no Fixes: tag and no "Cc: stable # dependency"
annotation. It only says "Prerequisite for ..." in prose.
78341049fbcd is from October 2024 and is in current stable branches.
Stable tooling that picks Fixes: tagged commits could take this patch
without its dependency. lan865x_probe() would then fail to build with
OA_TC6_PHY_INT undeclared.
Would it make sense to either tag the prerequisite as a stable dependency
or drop the Fixes: tag here?
Is the "critical" wording accurate? The earlier commit "net: phy:
microchip_t1s: fix collision detection on PLCA status change" already
added a polling resync for the LAN865X Rev.B entry:
drivers/net/phy/microchip_t1s.c:lan86xx_read_status() {
...
/* When no PHY interrupt is available, phylib polls read_status().
* Use the PLCA status from that poll to resync CDEN.
*/
mutex_lock(&priv->cden_lock);
ret = lan86xx_update_cden(phydev);
...
}
So this patch seems to cut the resync delay from about one phylib poll
interval down to interrupt latency. It does not appear to close a
correctness hole by itself. Could the wording be toned down?
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index d7e5dfc22396f..bd670c1c5d472 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
[ ... ]
> @@ -348,7 +349,8 @@ static int lan865x_probe(struct spi_device *spi)
>
> netdev->netdev_ops = &lan865x_netdev_ops;
>
> - priv->tc6 = oa_tc6_init(spi, netdev, NULL);
> + tc6_quirks.quirk_flags = OA_TC6_PHY_INT;
> + priv->tc6 = oa_tc6_init(spi, netdev, &tc6_quirks);
[Severity: Medium]
With OA_TC6_PHY_INT set, phydev->irq becomes valid and phy_polling_mode()
returns false. The periodic CDEN resync in lan86xx_read_status() then
stops. From that point, does CDEN depend on every PHY interrupt getting
through the oa_tc6 virtual IRQ path?
Two error branches in that path are not recovered. The first is in
oa_tc6_phy_irq_work():
drivers/net/ethernet/oa_tc6.c:oa_tc6_phy_irq_work() {
...
handle_nested_irq(tc6->phy_virq);
ret = oa_tc6_phy_irq_unmask_hw(tc6);
if (ret)
dev_err(&tc6->spi->dev, "Failed to unmask PHY interrupt: %d\n",
ret);
}
The INT_MASK0 read or write here can fail, for example with an SPI
transfer error or -EPROTO from oa_tc6_check_ctrl_read_reply() or
oa_tc6_check_ctrl_write_reply(). PHYINTM then stays set in hardware while
the phy_irq_masked shadow says unmasked.
The second is in oa_tc6_process_extended_status():
drivers/net/ethernet/oa_tc6.c:oa_tc6_process_extended_status() {
...
if (tc6->phy_virq && FIELD_GET(OA_TC6_STATUS0_PHY_INT, value)) {
ret = oa_tc6_phy_irq_mask_hw(tc6);
if (ret)
dev_err(&tc6->spi->dev,
"Failed to mask PHY interrupt: %d\n", ret);
else
schedule_work(&tc6->phy_irq_work);
}
...
}
oa_tc6_phy_irq_mask_hw() can report an error even though its write
reached the device. In that case the worker that would unmask is never
scheduled.
In both cases, unmask_hw only runs again after a PHYINT is delivered.
bus_sync_unlock only runs on genirq enable, disable or request.
Would PSTC interrupts then stop for good, with phylib no longer polling?
lan86xx_update_cden() would not run again until the driver is rebound.
Before this patch, a transient SPI control error only delayed the resync
until the next poll.
> if (IS_ERR(priv->tc6)) {
> ret = PTR_ERR(priv->tc6);
> goto free_netdev;
[Severity: High]
This isn't a bug introduced by this patch, but there is a problem in the
same driver. lan865x_remove() cancels the multicast work before it
unregisters the netdev:
drivers/net/ethernet/microchip/lan865x/lan865x.c:lan865x_remove() {
...
cancel_work_sync(&priv->multicast_work);
unregister_netdev(priv->netdev);
oa_tc6_exit(priv->tc6);
free_netdev(priv->netdev);
}
At that point the netdev is still registered and may still be IFF_UP.
lan865x uses the legacy rx-mode path, so __dev_set_rx_mode() calls
ndo_set_rx_mode() synchronously:
__dev_set_rx_mode()
lan865x_set_multicast_list()
schedule_work(&priv->multicast_work);
Can a concurrent multicast join or promisc change re-queue the work in
the window between cancel_work_sync() and unregister_netdev() clearing
IFF_UP?
Nothing cancels the work a second time. oa_tc6_exit() frees tc6 and
free_netdev() frees priv. lan865x_multicast_work_handler() would then
dereference priv->netdev and priv->tc6 in freed memory.
remove() runs under device_lock rather than rtnl, so nothing serialises
the two paths. Would moving cancel_work_sync() after unregister_netdev()
close this window?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124124930.485323-1-parthiban.veerasooran%40microchip.com
next prev parent reply other threads:[~2026-11-25 13:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 12:49 [PATCH net-next RESEND v4 0/4] net: microchip_t1s: fix collision detection on PLCA status change Parthiban Veerasooran
2026-11-24 12:49 ` [PATCH net-next RESEND v4 1/4] net: phy: " Parthiban Veerasooran
2026-11-25 13:05 ` netdev-bot+sashiko
2026-11-24 12:49 ` [PATCH net-next RESEND v4 2/4] net: ethernet: oa_tc6: deliver the PHY interrupt to phylib Parthiban Veerasooran
2026-11-25 13:05 ` netdev-bot+sashiko
2026-11-24 12:49 ` [PATCH net-next RESEND v4 3/4] microchip: lan865x: enable PHY interrupt via virtual IRQ Parthiban Veerasooran
2026-11-25 13:05 ` netdev-bot+sashiko [this message]
2026-11-24 12:49 ` [PATCH net-next RESEND v4 4/4] net: phy: microchip_t1s: fix collision detection for LAN867X Rev.D0 Parthiban Veerasooran
2026-11-25 13:05 ` netdev-bot+sashiko
2026-11-24 12:52 ` [PATCH net-next RESEND v4 0/4] net: microchip_t1s: fix collision detection on PLCA status change netdev-bot+sinfo
2026-11-25 3:28 ` Parthiban.Veerasooran
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=179561192833.3135.495365531706227788@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parthiban.veerasooran@microchip.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