All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: thunderx: Do not invoke pci_irq_vector() from interrupt context, 
@ 2022-04-29 13:54 Thomas Gleixner
  2022-05-01 16:10 ` ['[PATCH] net: thunderx: Do not invoke pci_irq_vector() from\n interrupt context', ''] patchwork-bot+netdevbpf
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2022-04-29 13:54 UTC (permalink / raw)
  To: Ondrej Mosnacek
  Cc: Sunil Goutham, David S . Miller, Jakub Kicinski, Paolo Abeni, netdev

pci_irq_vector() can't be used in atomic context any longer. This conflicts
with the usage of this function in nic_mbx_intr_handler().

Cache the Linux interrupt numbers in struct nicpf and use that cache in the
interrupt handler to select the mailbox.

Fixes: 495c66aca3da ("genirq/msi: Convert to new functions")
Reported-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Sunil Goutham <sgoutham@marvell.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Cc: stable@vger.kernel.org
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2041772
---
 drivers/net/ethernet/cavium/thunder/nic_main.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/drivers/net/ethernet/cavium/thunder/nic_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nic_main.c
@@ -59,7 +59,7 @@ struct nicpf {
 
 	/* MSI-X */
 	u8			num_vec;
-	bool			irq_allocated[NIC_PF_MSIX_VECTORS];
+	unsigned int		irq_allocated[NIC_PF_MSIX_VECTORS];
 	char			irq_name[NIC_PF_MSIX_VECTORS][20];
 };
 
@@ -1150,7 +1150,7 @@ static irqreturn_t nic_mbx_intr_handler(
 	u64 intr;
 	u8  vf;
 
-	if (irq == pci_irq_vector(nic->pdev, NIC_PF_INTR_ID_MBOX0))
+	if (irq == nic->irq_allocated[NIC_PF_INTR_ID_MBOX0])
 		mbx = 0;
 	else
 		mbx = 1;
@@ -1176,14 +1176,14 @@ static void nic_free_all_interrupts(stru
 
 	for (irq = 0; irq < nic->num_vec; irq++) {
 		if (nic->irq_allocated[irq])
-			free_irq(pci_irq_vector(nic->pdev, irq), nic);
-		nic->irq_allocated[irq] = false;
+			free_irq(nic->irq_allocated[irq], nic);
+		nic->irq_allocated[irq] = 0;
 	}
 }
 
 static int nic_register_interrupts(struct nicpf *nic)
 {
-	int i, ret;
+	int i, ret, irq;
 	nic->num_vec = pci_msix_vec_count(nic->pdev);
 
 	/* Enable MSI-X */
@@ -1201,13 +1201,13 @@ static int nic_register_interrupts(struc
 		sprintf(nic->irq_name[i],
 			"NICPF Mbox%d", (i - NIC_PF_INTR_ID_MBOX0));
 
-		ret = request_irq(pci_irq_vector(nic->pdev, i),
-				  nic_mbx_intr_handler, 0,
+		irq = pci_irq_vector(nic->pdev, i);
+		ret = request_irq(irq, nic_mbx_intr_handler, 0,
 				  nic->irq_name[i], nic);
 		if (ret)
 			goto fail;
 
-		nic->irq_allocated[i] = true;
+		nic->irq_allocated[i] = irq;
 	}
 
 	/* Enable mailbox interrupt */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ['[PATCH] net: thunderx: Do not invoke pci_irq_vector() from\n interrupt context', '']
  2022-04-29 13:54 [PATCH] net: thunderx: Do not invoke pci_irq_vector() from interrupt context, Thomas Gleixner
@ 2022-05-01 16:10 ` patchwork-bot+netdevbpf
  2022-05-02  8:27   ` Ondrej Mosnacek
  0 siblings, 1 reply; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-01 16:10 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: omosnace, sgoutham, davem, kuba, pabeni, netdev

Hello:

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

On Fri, 29 Apr 2022 15:54:24 +0200 you wrote:
> pci_irq_vector() can't be used in atomic context any longer. This conflicts
> with the usage of this function in nic_mbx_intr_handler().
> 
> Cache the Linux interrupt numbers in struct nicpf and use that cache in the
> interrupt handler to select the mailbox.
> 
> Fixes: 495c66aca3da ("genirq/msi: Convert to new functions")
> Reported-by: Ondrej Mosnacek <omosnace@redhat.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Sunil Goutham <sgoutham@marvell.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: netdev@vger.kernel.org
> Cc: stable@vger.kernel.org
> Link: https://bugzilla.redhat.com/show_bug.cgi?id=2041772
> 
> [...]

Here is the summary with links:
  - net: thunderx: Do not invoke pci_irq_vector() from interrupt context
    https://git.kernel.org/netdev/net/c/6b292a04c694

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ['[PATCH] net: thunderx: Do not invoke pci_irq_vector() from\n interrupt context', '']
  2022-05-01 16:10 ` ['[PATCH] net: thunderx: Do not invoke pci_irq_vector() from\n interrupt context', ''] patchwork-bot+netdevbpf
@ 2022-05-02  8:27   ` Ondrej Mosnacek
  2022-05-02  8:52     ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Ondrej Mosnacek @ 2022-05-02  8:27 UTC (permalink / raw)
  To: David S. Miller
  Cc: Thomas Gleixner, sgoutham, Jakub Kicinski, Paolo Abeni, network dev

Hi David,

On Sun, May 1, 2022 at 6:10 PM <patchwork-bot+netdevbpf@kernel.org> wrote:
>
> Hello:
>
> This patch was applied to netdev/net.git (master)
> by David S. Miller <davem@davemloft.net>:
>
> On Fri, 29 Apr 2022 15:54:24 +0200 you wrote:
> > pci_irq_vector() can't be used in atomic context any longer. This conflicts
> > with the usage of this function in nic_mbx_intr_handler().
> >
> > Cache the Linux interrupt numbers in struct nicpf and use that cache in the
> > interrupt handler to select the mailbox.
> >
> > Fixes: 495c66aca3da ("genirq/msi: Convert to new functions")
> > Reported-by: Ondrej Mosnacek <omosnace@redhat.com>
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Sunil Goutham <sgoutham@marvell.com>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Cc: Paolo Abeni <pabeni@redhat.com>
> > Cc: netdev@vger.kernel.org
> > Cc: stable@vger.kernel.org
> > Link: https://bugzilla.redhat.com/show_bug.cgi?id=2041772
> >
> > [...]
>
> Here is the summary with links:
>   - net: thunderx: Do not invoke pci_irq_vector() from interrupt context
>     https://git.kernel.org/netdev/net/c/6b292a04c694

It seems the patch got mangled when applying? The commit is missing
the subject line.

--
Ondrej Mosnacek
Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ['[PATCH] net: thunderx: Do not invoke pci_irq_vector() from\n interrupt context', '']
  2022-05-02  8:27   ` Ondrej Mosnacek
@ 2022-05-02  8:52     ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2022-05-02  8:52 UTC (permalink / raw)
  To: Ondrej Mosnacek, David S. Miller
  Cc: sgoutham, Jakub Kicinski, Paolo Abeni, network dev

On Mon, May 02 2022 at 10:27, Ondrej Mosnacek wrote:
> On Sun, May 1, 2022 at 6:10 PM <patchwork-bot+netdevbpf@kernel.org> wrote:
>> Here is the summary with links:
>>   - net: thunderx: Do not invoke pci_irq_vector() from interrupt context
>>     https://git.kernel.org/netdev/net/c/6b292a04c694
>
> It seems the patch got mangled when applying? The commit is missing
> the subject line.

Probably my fault. I somehow managed to have the proper Subject: line
and another empty 'Subject:' header in that mail.

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-02  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 13:54 [PATCH] net: thunderx: Do not invoke pci_irq_vector() from interrupt context, Thomas Gleixner
2022-05-01 16:10 ` ['[PATCH] net: thunderx: Do not invoke pci_irq_vector() from\n interrupt context', ''] patchwork-bot+netdevbpf
2022-05-02  8:27   ` Ondrej Mosnacek
2022-05-02  8:52     ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.