* [PATCH/RFC net v2] net: dec: tulip: de2104x: Add shutdown handler to stop NIC
@ 2020-10-23 2:45 Moritz Fischer
2020-10-23 20:08 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Moritz Fischer @ 2020-10-23 2:45 UTC (permalink / raw)
To: netdev
Cc: davem, linux-parisc, linux-kernel, lucyyan, moritzf,
James.Bottomley, Moritz Fischer
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>
---
Changes from v1:
- Replace call to de_remove_one with de_shutdown() function
as suggested by James.
---
drivers/net/ethernet/dec/tulip/de2104x.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
index f1a2da15dd0a..6de0cd6cf4ca 100644
--- a/drivers/net/ethernet/dec/tulip/de2104x.c
+++ b/drivers/net/ethernet/dec/tulip/de2104x.c
@@ -2180,11 +2180,19 @@ static int de_resume (struct pci_dev *pdev)
#endif /* CONFIG_PM */
+static void de_shutdown(struct pci_dev *pdev)
+{
+ struct net_device *dev = pci_get_drvdata (pdev);
+
+ de_close(dev);
+}
+
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,
#ifdef CONFIG_PM
.suspend = de_suspend,
.resume = de_resume,
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH/RFC net v2] net: dec: tulip: de2104x: Add shutdown handler to stop NIC
2020-10-23 2:45 [PATCH/RFC net v2] net: dec: tulip: de2104x: Add shutdown handler to stop NIC Moritz Fischer
@ 2020-10-23 20:08 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-10-23 20:08 UTC (permalink / raw)
To: Moritz Fischer
Cc: netdev, davem, linux-parisc, linux-kernel, lucyyan, moritzf,
James.Bottomley
On Thu, 22 Oct 2020 19:45:20 -0700 Moritz Fischer wrote:
> 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>
Change looks good.
Philosophically speaking I wonder if this is a fix or a feature.
If missing .shutdown callback was a bug we shouldn't accept drivers
which don't specify it :S
If you don't have a strong preference I'd rather apply this to net-next.
In any case - you need to respin, 'cause this does not apply to net
either :)
> diff --git a/drivers/net/ethernet/dec/tulip/de2104x.c b/drivers/net/ethernet/dec/tulip/de2104x.c
> index f1a2da15dd0a..6de0cd6cf4ca 100644
> --- a/drivers/net/ethernet/dec/tulip/de2104x.c
> +++ b/drivers/net/ethernet/dec/tulip/de2104x.c
> @@ -2180,11 +2180,19 @@ static int de_resume (struct pci_dev *pdev)
>
> #endif /* CONFIG_PM */
>
> +static void de_shutdown(struct pci_dev *pdev)
> +{
> + struct net_device *dev = pci_get_drvdata (pdev);
No space needed before parens
> +
> + de_close(dev);
> +}
> +
> 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,
> #ifdef CONFIG_PM
> .suspend = de_suspend,
> .resume = de_resume,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-23 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-23 2:45 [PATCH/RFC net v2] net: dec: tulip: de2104x: Add shutdown handler to stop NIC Moritz Fischer
2020-10-23 20:08 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).