]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: dec: tulip: de2104x: Add shutdown handler to stop NIC
authorMoritz Fischer <mdf@kernel.org>
Wed, 28 Oct 2020 17:21:25 +0000 (10:21 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 31 Oct 2020 00:14:38 +0000 (17:14 -0700)
The driver does not implement a shutdown handler which leads to issues
when using kexec in certain scenarios. The NIC keeps on fetching
descriptors which gets flagged by the IOMMU with errors like this:

DMAR: DMAR:[DMA read] Request device [5e:00.0]fault addr fffff000
DMAR: DMAR:[DMA read] Request device [5e:00.0]fault addr fffff000
DMAR: DMAR:[DMA read] Request device [5e:00.0]fault addr fffff000
DMAR: DMAR:[DMA read] Request device [5e:00.0]fault addr fffff000
DMAR: DMAR:[DMA read] Request device [5e:00.0]fault addr fffff000

Signed-off-by: Moritz Fischer <mdf@kernel.org>
Link: https://lore.kernel.org/r/20201028172125.496942-1-mdf@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/dec/tulip/de2104x.c

index d9f6c19940ef027a75f22915895ca1d556ec8510..c3cbe55205a7bca96b5c743180bfb18ed16447a0 100644 (file)
@@ -2175,11 +2175,21 @@ out:
 
 static SIMPLE_DEV_PM_OPS(de_pm_ops, de_suspend, de_resume);
 
+static void de_shutdown(struct pci_dev *pdev)
+{
+       struct net_device *dev = pci_get_drvdata(pdev);
+
+       rtnl_lock();
+       dev_close(dev);
+       rtnl_unlock();
+}
+
 static struct pci_driver de_driver = {
        .name           = DRV_NAME,
        .id_table       = de_pci_tbl,
        .probe          = de_init_one,
        .remove         = de_remove_one,
+       .shutdown       = de_shutdown,
        .driver.pm      = &de_pm_ops,
 };