Skip to content

Commit 6b292a0

Browse files
KAGA-KOKOdavem330
authored andcommitted
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: 495c66a ("genirq/msi: Convert to new functions") Reported-by: Ondrej Mosnacek <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Sunil Goutham <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://bugzilla.redhat.com/show_bug.cgi?id=2041772 Signed-off-by: David S. Miller <[email protected]>
1 parent b669361 commit 6b292a0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/net/ethernet/cavium/thunder/nic_main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct nicpf {
5959

6060
/* MSI-X */
6161
u8 num_vec;
62-
bool irq_allocated[NIC_PF_MSIX_VECTORS];
62+
unsigned int irq_allocated[NIC_PF_MSIX_VECTORS];
6363
char irq_name[NIC_PF_MSIX_VECTORS][20];
6464
};
6565

@@ -1150,7 +1150,7 @@ static irqreturn_t nic_mbx_intr_handler(int irq, void *nic_irq)
11501150
u64 intr;
11511151
u8 vf;
11521152

1153-
if (irq == pci_irq_vector(nic->pdev, NIC_PF_INTR_ID_MBOX0))
1153+
if (irq == nic->irq_allocated[NIC_PF_INTR_ID_MBOX0])
11541154
mbx = 0;
11551155
else
11561156
mbx = 1;
@@ -1176,14 +1176,14 @@ static void nic_free_all_interrupts(struct nicpf *nic)
11761176

11771177
for (irq = 0; irq < nic->num_vec; irq++) {
11781178
if (nic->irq_allocated[irq])
1179-
free_irq(pci_irq_vector(nic->pdev, irq), nic);
1180-
nic->irq_allocated[irq] = false;
1179+
free_irq(nic->irq_allocated[irq], nic);
1180+
nic->irq_allocated[irq] = 0;
11811181
}
11821182
}
11831183

11841184
static int nic_register_interrupts(struct nicpf *nic)
11851185
{
1186-
int i, ret;
1186+
int i, ret, irq;
11871187
nic->num_vec = pci_msix_vec_count(nic->pdev);
11881188

11891189
/* Enable MSI-X */
@@ -1201,13 +1201,13 @@ static int nic_register_interrupts(struct nicpf *nic)
12011201
sprintf(nic->irq_name[i],
12021202
"NICPF Mbox%d", (i - NIC_PF_INTR_ID_MBOX0));
12031203

1204-
ret = request_irq(pci_irq_vector(nic->pdev, i),
1205-
nic_mbx_intr_handler, 0,
1204+
irq = pci_irq_vector(nic->pdev, i);
1205+
ret = request_irq(irq, nic_mbx_intr_handler, 0,
12061206
nic->irq_name[i], nic);
12071207
if (ret)
12081208
goto fail;
12091209

1210-
nic->irq_allocated[i] = true;
1210+
nic->irq_allocated[i] = irq;
12111211
}
12121212

12131213
/* Enable mailbox interrupt */

0 commit comments

Comments
 (0)