Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a4e7a08 authored by Mike Ditto's avatar Mike Ditto Committed by David S. Miller
Browse files

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: default avatarDavid Decotigny <david.decotigny@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9c4082d
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -3398,7 +3398,8 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)


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


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


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


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


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


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


	if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
	if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
		events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK;
		events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK;
		writel(NVREG_IRQ_TIMER, base + NvRegIrqStatus);
		writel(events & NVREG_IRQ_TIMER, base + NvRegIrqStatus);
	} else {
	} else {
		events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK;
		events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK;
		writel(NVREG_IRQ_TIMER, base + NvRegMSIXIrqStatus);
		writel(events & NVREG_IRQ_TIMER, base + NvRegMSIXIrqStatus);
	}
	}
	pci_push(base);
	pci_push(base);
	if (!(events & NVREG_IRQ_TIMER))
	if (!(events & NVREG_IRQ_TIMER))