Patchwork net: fec: Fix the disabling of RX interrupt

login
register
mail settings
Submitter Fabio Estevam
Date Feb. 18, 2013, 7:07 p.m.
Message ID <1361214447-7279-1-git-send-email-fabio.estevam@freescale.com>
Download mbox | patch
Permalink /patch/221452/
State Superseded
Delegated to: David Miller
Headers show

Comments

Fabio Estevam - Feb. 18, 2013, 7:07 p.m.
The correct way to disable FEC RX interrupt is to clean only the FEC_ENET_RXF 
bit.

Since commit dc975382d2e (net: fec: add napi support to improve proformance) 
FEC_RX_DISABLED_IMASK is being written to the FEC_IMASK register, which also 
incorrectly sets other bits.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 0fe68c4..f4f8495 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -811,6 +811,7 @@  fec_enet_interrupt(int irq, void *dev_id)
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	uint int_events;
 	irqreturn_t ret = IRQ_NONE;
+	int reg;
 
 	do {
 		int_events = readl(fep->hwp + FEC_IEVENT);
@@ -821,8 +822,9 @@  fec_enet_interrupt(int irq, void *dev_id)
 
 			/* Disable the RX interrupt */
 			if (napi_schedule_prep(&fep->napi)) {
-				writel(FEC_RX_DISABLED_IMASK,
-					fep->hwp + FEC_IMASK);
+				reg = readl(fep->hwp + FEC_IMASK);
+				reg &= ~FEC_ENET_RXF;
+				writel(reg, fep->hwp + FEC_IMASK);
 				__napi_schedule(&fep->napi);
 			}
 		}