[PATCH net] net: via-rhine: Stop the NIC on platform device shutdown
From: Alexey Charkov
Date: Fri Nov 13 2026 - 16:13:33 EST
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@xxxxxxxxx>
---
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@xxxxxxxxx>