* [PATCH net] net: via-velocity: Stop the device on shutdown
@ 2026-11-19 12:47 Roland Waltersson
2026-11-23 13:07 ` netdev-bot+sashiko
0 siblings, 1 reply; 2+ messages in thread
From: Roland Waltersson @ 2026-11-19 12:47 UTC (permalink / raw)
To: Francois Romieu, netdev@vger.kernel.org
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Kai-Heng Feng, Rafael J. Wysocki,
linux-kernel@vger.kernel.org
The driver has no .shutdown hook, so on reboot, power off or kexec the
chip is left running after device_shutdown(): it keeps receiving
packets into its RX rings by DMA and raising its interrupt.
Since commit 38f34dba806a ("PM: ACPI: reboot: Reinstate S5 for
reboot"), the ACPI S5 preparation (_PTS(5), wakeup devices, all GPEs
disabled) also runs on reboot, after device_shutdown(). On a congatec
conga-EAF board (AMD G-series) with traffic on the velocity port, a
reboot now and then hangs after
ACPI: PM: Preparing to enter system sleep state S5
reboot: Restarting system
and the board is never reset. Not running the S5 preparation on reboot
avoids the hang.
Stop the device the same way commit 2ca1c94ce0b6 ("tg3: Disable tg3
device on system reboot to avoid triggering AER") did for tg3: add a
PCI .shutdown hook that detaches and closes the interface, which stops
the chip, masks its interrupts and frees the rings, and then disables
the PCI device, which turns off bus mastering.
An interface that is down needs nothing more: velocity_close() has
already stopped it, or it was never opened and probe left the chip in
D3hot.
Fixes: 38f34dba806a ("PM: ACPI: reboot: Reinstate S5 for reboot")
Signed-off-by: Roland Waltersson <rolwal@netinsight.net>
---
drivers/net/ethernet/via/via-velocity.c | 27 +++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index 6d7b6f3b4..3daf7a8dd 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -2942,6 +2942,32 @@ static void velocity_pci_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}
+/**
+ * velocity_pci_shutdown - stop the device on shutdown
+ * @pdev: PCI device
+ *
+ * Called on reboot, power off and kexec. Close the interface, which
+ * stops the chip and masks its interrupts, and disable the PCI device,
+ * which turns off bus mastering. Otherwise the chip keeps receiving
+ * packets into its rings by DMA and raising interrupts while the rest
+ * of the restart runs.
+ */
+static void velocity_pci_shutdown(struct pci_dev *pdev)
+{
+ struct net_device *netdev = pci_get_drvdata(pdev);
+
+ rtnl_lock();
+
+ netif_device_detach(netdev);
+
+ if (netif_running(netdev))
+ dev_close(netdev);
+
+ rtnl_unlock();
+
+ pci_disable_device(pdev);
+}
+
static int velocity_platform_probe(struct platform_device *pdev)
{
const struct velocity_info_tbl *info;
@@ -3241,6 +3267,7 @@ static struct pci_driver velocity_pci_driver = {
.id_table = velocity_pci_id_table,
.probe = velocity_pci_probe,
.remove = velocity_pci_remove,
+ .shutdown = velocity_pci_shutdown,
.driver = {
.pm = &velocity_pm_ops,
},
base-commit: a8aeac0b1883206cf72461258e6bfd991589049e
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net] net: via-velocity: Stop the device on shutdown
2026-11-19 12:47 [PATCH net] net: via-velocity: Stop the device on shutdown Roland Waltersson
@ 2026-11-23 13:07 ` netdev-bot+sashiko
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sashiko @ 2026-11-23 13:07 UTC (permalink / raw)
To: roland.waltersson
Cc: romieu, netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
kai.heng.feng, rafael.j.wysocki, linux-kernel
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
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] The patch adds a .shutdown hook to velocity_pci_driver only.
- [Low] The commit message carries a Fixes: tag for 38f34dba806a ("PM:
ACPI: reboot: Reinstate S5 for reboot").
- [Low] The commit author is "Roland Waltersson
<roland.waltersson@netinsight.net>", but the only Signed-off-by…
--
net: via-velocity: Stop the device on shutdown
This commit adds a PCI .shutdown hook to the via-velocity driver. The hook
detaches and closes the interface, then disables the PCI device, so the
chip stops DMAing into its RX rings and raising interrupts after
device_shutdown(). The commit message links an occasional reboot hang on a
congatec conga-EAF board to the ACPI S5 preparation, which commit
38f34dba806a reinstated on reboot.
> and the board is never reset. Not running the S5 preparation on reboot
> avoids the hang.
[ ... ]
> Fixes: 38f34dba806a ("PM: ACPI: reboot: Reinstate S5 for reboot")
[Severity: Low]
Was the new velocity_pci_shutdown() hook tested on the conga-EAF board?
Does the hang go away with it?
The message shows that skipping the S5 preparation avoids the hang. It
does not say whether stopping the velocity chip has the same effect.
It also does not explain how a chip that is still bus mastering, or still
has INTx asserted, would hang during _PTS(5) or the GPE disable.
The cited tg3 commit 2ca1c94ce0b6 fixed a different symptom (AER on
reboot).
The Fixes: tag makes this a stable candidate. Could the changelog say
whether the fix was checked against this hang?
> Signed-off-by: Roland Waltersson <rolwal@netinsight.net>
[Severity: Low]
This isn't a bug, but the Signed-off-by address (rolwal@netinsight.net)
does not match the author address (roland.waltersson@netinsight.net).
checkpatch reports this as a From:/Signed-off-by: email address mismatch.
> diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
> index 6d7b6f3b46339..3daf7a8dd06eb 100644
> --- a/drivers/net/ethernet/via/via-velocity.c
> +++ b/drivers/net/ethernet/via/via-velocity.c
[ ... ]
> @@ -3241,6 +3267,7 @@ static struct pci_driver velocity_pci_driver = {
> .id_table = velocity_pci_id_table,
> .probe = velocity_pci_probe,
> .remove = velocity_pci_remove,
> + .shutdown = velocity_pci_shutdown,
> .driver = {
> .pm = &velocity_pm_ops,
> },
[Severity: Medium]
Only velocity_pci_driver gets a .shutdown hook here. Does
velocity_platform_driver need one as well?
The platform driver binds the same VT6110 MAC through the
"via,velocity-vt6110" compatible. It uses the same velocity_probe() core:
velocity_platform_probe()
return velocity_probe(&pdev->dev, irq, info, BUS_PLATFORM);
Its registration still has no .shutdown:
static struct platform_driver velocity_platform_driver = {
.probe = velocity_platform_probe,
.remove = velocity_platform_remove,
.driver = {
...
},
};
The commit message describes the problem without naming a bus: "on
reboot, power off or kexec the chip is left running after
device_shutdown(): it keeps receiving packets into its RX rings by DMA and
raising its interrupt."
On a platform-bound velocity with the interface up, the chip would keep
DMAing into its RX rings and raising its IRQ after device_shutdown(). With
kexec, that DMA can land in memory the new kernel has reused.
Apart from pci_disable_device(), velocity_pci_shutdown() does nothing
bus-specific. Could that part go into a shared helper that a platform
.shutdown hook also calls?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/IA0PR17MB668711363A5BE04D1BC3C76B9E792%40IA0PR17MB6687.namprd17.prod.outlook.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-23 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 12:47 [PATCH net] net: via-velocity: Stop the device on shutdown Roland Waltersson
2026-11-23 13:07 ` netdev-bot+sashiko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox