Skip to contentSkip to conversation

net: amd-xgbe: disable interrupts during pci removal

PATCH Applied Raju Rangoju 3 participants 3 messages Feb 9, 2022

Subsystems (3)
lore
Share & tools
lore

Raju Rangoju

author maintainer
#0 lore raw

PATCH 1/1 net: amd-xgbe: disable interrupts during pci removal

Hardware interrupts are enabled during the pci probe, however, they are not disabled during pci removal.

Disable all hardware interrupts during pci removal to avoid any issues.

Fixes e75377404726 ("amd-xgbe: Update PCI support to use new IRQ functions")
---
 drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-pci.c +3 -0
index efdcf484a510..2af3da4b2d05 100644
@@ -425,6 +425,9 @@ static void xgbe_pci_remove(struct pci_dev *pdev)
 
 	pci_free_irq_vectors(pdata->pcidev);
 
+	/* Disable all interrupts in the hardware */
+	XP_IOWRITE(pdata, XP_INT_EN, 0x0);
+
 	xgbe_free_pdata(pdata);
 }
 
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 11 lines · On Wed, 9 Feb 2022 10:02:01 +0530 you wrote:

Hardware interrupts are enabled during the pci probe, however, they are not disabled during pci removal.

Disable all hardware interrupts during pci removal to avoid any issues.

Fixes e75377404726 ("amd-xgbe: Update PCI support to use new IRQ functions")

[...]

Here is the summary with links:
- [net] net: amd-xgbe: disable interrupts during pci removal

    https://git.kernel.org/netdev/net/c/68c2d6af1f1e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
In reply to Raju Rangoju
Quoted 5 lines · Raju Rangoju

Hardware interrupts are enabled during the pci probe, however, they are not disabled during pci removal.

Disable all hardware interrupts during pci removal to avoid any issues.

Are there issues? I would expect the change log to say what the issues are and hence the reason for making this change.

Quoted 2 lines
Fixes e75377404726 ("amd-xgbe: Update PCI support to use new IRQ functions")

Is this the right fixes tag? The XP_IOWRITE() that sets XP_INT_EN was introduced in: 47f164deab22 ("amd-xgbe: Add PCI device support"). If the idea is to be certain interrupts are not enabled for the device after removal, wouldn't that really be the tag to use?

Or was the introduction of using pci_free_irq_vectors() in combination with XP_IN_EN not being zeroed the true cause?

Quoted 11 lines
---
  drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-pci.c +0 -0
index efdcf484a510..2af3da4b2d05 100644

drivers/net/ethernet/amd/xgbe/xgbe-pci.c static void xgbe_pci_remove(struct pci_dev *pdev) · line 430

Quoted 6 lines
drivers/net/ethernet/amd/xgbe/xgbe-pci.c +3 -0
@@ -425,6 +425,9 @@ static void xgbe_pci_remove(struct pci_dev *pdev)
 
  	pci_free_irq_vectors(pdata->pcidev);
 
+	/* Disable all interrupts in the hardware */
+	XP_IOWRITE(pdata, XP_INT_EN, 0x0);
+

Shouldn't this be done before calling pci_free_irq_vectors().

Thanks,
Tom

Quoted 3 lines
drivers/net/ethernet/amd/xgbe/xgbe-pci.c +0 -0
  	xgbe_free_pdata(pdata);
  }