Skip to content

Commit 2a4e7a0

Browse files
mditto-googledavem330
authored andcommitted
forcedeth: Acknowledge only interrupts that are being processed
This is to avoid a race, accidentally acknowledging an interrupt that we didn't notice and won't immediately process. This is based solely on code inspection; it is not known if there was an actual bug here. Signed-off-by: David Decotigny <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f9c4082 commit 2a4e7a0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/net/ethernet/nvidia/forcedeth.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3398,7 +3398,8 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
33983398

33993399
for (i = 0;; i++) {
34003400
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_TX_ALL;
3401-
writel(NVREG_IRQ_TX_ALL, base + NvRegMSIXIrqStatus);
3401+
writel(events, base + NvRegMSIXIrqStatus);
3402+
netdev_dbg(dev, "tx irq events: %08x\n", events);
34023403
if (!(events & np->irqmask))
34033404
break;
34043405

@@ -3509,7 +3510,8 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data)
35093510

35103511
for (i = 0;; i++) {
35113512
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_RX_ALL;
3512-
writel(NVREG_IRQ_RX_ALL, base + NvRegMSIXIrqStatus);
3513+
writel(events, base + NvRegMSIXIrqStatus);
3514+
netdev_dbg(dev, "rx irq events: %08x\n", events);
35133515
if (!(events & np->irqmask))
35143516
break;
35153517

@@ -3553,7 +3555,8 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
35533555

35543556
for (i = 0;; i++) {
35553557
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_OTHER;
3556-
writel(NVREG_IRQ_OTHER, base + NvRegMSIXIrqStatus);
3558+
writel(events, base + NvRegMSIXIrqStatus);
3559+
netdev_dbg(dev, "irq events: %08x\n", events);
35573560
if (!(events & np->irqmask))
35583561
break;
35593562

@@ -3617,10 +3620,10 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
36173620

36183621
if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
36193622
events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK;
3620-
writel(NVREG_IRQ_TIMER, base + NvRegIrqStatus);
3623+
writel(events & NVREG_IRQ_TIMER, base + NvRegIrqStatus);
36213624
} else {
36223625
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK;
3623-
writel(NVREG_IRQ_TIMER, base + NvRegMSIXIrqStatus);
3626+
writel(events & NVREG_IRQ_TIMER, base + NvRegMSIXIrqStatus);
36243627
}
36253628
pci_push(base);
36263629
if (!(events & NVREG_IRQ_TIMER))

0 commit comments

Comments
 (0)