* [PATCH net] net: via-rhine: Stop the NIC on platform device shutdown
@ 2026-11-13 13:01 Alexey Charkov
2026-11-19 0:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Charkov @ 2026-11-13 13:01 UTC (permalink / raw)
To: Kevin Brace, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Alexey Charkov, Rob Herring
Cc: netdev, linux-kernel
Close a running interface on platform device shutdown, so that the chip
stops its receive DMA before kexec hands its memory to the next kernel.
Do it in the driver, as the platform (OF) variant lacks a .shutdown
callback and nothing else stops it, unlike for PCI, where the core
clears bus mastering ahead of kexec.
Keep incoming frames from landing in receive buffers the old kernel had
allocated: on a WonderMedia WM8950 board, broadcast traffic alone
corrupts the next kernel at random points as it decompresses and boots,
hanging about a third of kexec attempts early on, e.g. with
"unrecognized/unsupported processor variant".
Fixes: 2d283862dc62 ("net: via-rhine: add OF bus binding")
Signed-off-by: Alexey Charkov <alchark@gmail.com>
---
drivers/net/ethernet/via/via-rhine.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index e56ebbdd428d..dbbbaf7f20ac 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -2461,6 +2461,17 @@ static void rhine_remove_one_platform(struct platform_device *pdev)
free_netdev(dev);
}
+static void rhine_shutdown_platform(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+
+ rtnl_lock();
+ netif_device_detach(dev);
+ if (netif_running(dev))
+ dev_close(dev);
+ rtnl_unlock();
+}
+
static void rhine_shutdown_pci(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
@@ -2580,6 +2591,7 @@ static struct pci_driver rhine_driver_pci = {
static struct platform_driver rhine_driver_platform = {
.probe = rhine_init_one_platform,
.remove = rhine_remove_one_platform,
+ .shutdown = rhine_shutdown_platform,
.driver = {
.name = DRV_NAME,
.of_match_table = rhine_of_tbl,
---
base-commit: ead6fa9a0ab194f02a2f36d634b193e9c5f9a1c6
change-id: 20261113-vt8500-rhine-shutdown-b2ac8a702688
Best regards,
--
Alexey Charkov <alchark@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: via-rhine: Stop the NIC on platform device shutdown
2026-11-13 13:01 [PATCH net] net: via-rhine: Stop the NIC on platform device shutdown Alexey Charkov
@ 2026-11-19 0:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-19 0:10 UTC (permalink / raw)
To: Alexey Charkov
Cc: kevinbrace, andrew+netdev, davem, edumazet, kuba, pabeni, robh,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 13 Nov 2026 17:01:05 +0400 you wrote:
> Close a running interface on platform device shutdown, so that the chip
> stops its receive DMA before kexec hands its memory to the next kernel.
> Do it in the driver, as the platform (OF) variant lacks a .shutdown
> callback and nothing else stops it, unlike for PCI, where the core
> clears bus mastering ahead of kexec.
>
> Keep incoming frames from landing in receive buffers the old kernel had
> allocated: on a WonderMedia WM8950 board, broadcast traffic alone
> corrupts the next kernel at random points as it decompresses and boots,
> hanging about a third of kexec attempts early on, e.g. with
> "unrecognized/unsupported processor variant".
>
> [...]
Here is the summary with links:
- [net] net: via-rhine: Stop the NIC on platform device shutdown
https://git.kernel.org/netdev/net/c/3d10dc3ae1f7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-19 0:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 13:01 [PATCH net] net: via-rhine: Stop the NIC on platform device shutdown Alexey Charkov
2026-11-19 0:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®