diff mbox series

[net] net: amd-xgbe: disable interrupts during pci removal

Message ID 20220209043201.1365811-1-Raju.Rangoju@amd.com (mailing list archive)
State Accepted
Commit 68c2d6af1f1e469544d6cbe9a601d96fb9c00e7f
Delegated to: Netdev Maintainers
Headers show
Series [net] net: amd-xgbe: disable interrupts during pci removal | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: bhelgaas@google.com; 1 maintainers not CCed: bhelgaas@google.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Raju Rangoju Feb. 9, 2022, 4:32 a.m. UTC
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")
Suggested-by: Selwin Sebastian <Selwin.Sebastian@amd.com>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 9, 2022, 1 p.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

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")
> Suggested-by: Selwin Sebastian <Selwin.Sebastian@amd.com>
> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
> 
> [...]

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!
Tom Lendacky Feb. 9, 2022, 2:12 p.m. UTC | #2
On 2/8/22 22:32, Raju Rangoju 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.

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

> 
> 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?

> Suggested-by: Selwin Sebastian <Selwin.Sebastian@amd.com>
> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
> ---
>   drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
> index efdcf484a510..2af3da4b2d05 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
> @@ -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

>   	xgbe_free_pdata(pdata);
>   }
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
index efdcf484a510..2af3da4b2d05 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-pci.c
@@ -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);
 }