diff mbox series

[v3,net-next,07/15] net: mscc: ocelot: just flush the CPU extraction group on error

Message ID 20210118161731.2837700-8-olteanv@gmail.com
State New
Headers show
Series [v3,net-next,01/15] net: dsa: tag_8021q: add helpers to deduce whether a VLAN ID is RX or TX VLAN | expand

Commit Message

Vladimir Oltean Jan. 18, 2021, 4:17 p.m. UTC
From: Vladimir Oltean <vladimir.oltean@nxp.com>

This procedure should yield the same effect as manually reading out the
extraction data just to discard it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Changes in v3:
None.

Changes in v2:
Patch is new.

 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index d4cf6eeff3c9..76fa681b41f4 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -701,9 +701,10 @@  static irqreturn_t ocelot_xtr_irq_handler(int irq, void *arg)
 		dev->stats.rx_packets++;
 	}
 
-	if (err < 0)
-		while (ocelot_read(ocelot, QS_XTR_DATA_PRESENT) & BIT(grp))
-			ocelot_read_rix(ocelot, QS_XTR_RD, grp);
+	if (err < 0) {
+		ocelot_write(ocelot, QS_XTR_FLUSH, BIT(grp));
+		ocelot_write(ocelot, QS_XTR_FLUSH, 0);
+	}
 
 	return IRQ_HANDLED;
 }