🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Alexey Charkov Fri, 13 Nov 2026 13:01
[PATCH net] net: via-rhine: Stop the NIC on platform device shutdown
#15892
Author: Alexey Charkov
Date: Fri, 13 Nov 2026 13:01
57 lines
13420 bytes
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>
Re: [PATCH net] net: via-rhine: Stop the NIC on platform device shutdown
#18841
Author: patchwork-bot+netdevbpf
Date: Thu, 19 Nov 2026 00:10
29 lines
8990 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads