From 8bc839bcda8895974cd01bf671c2d5ea36f8ab80 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Mon, 29 Aug 2011 17:37:36 +0800 Subject: [PATCH] bce(4): Flush BCE_PCICFG_INT_ACK_CMD in interrupt handler This could avoid possible spurious interrupts due to the PCI write to BCE_PCICFG_INT_ACK_CMD is still pending after we leave interrupt handler. Obtained-from: Linux bnx2 --- sys/dev/netif/bce/if_bce.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/netif/bce/if_bce.c b/sys/dev/netif/bce/if_bce.c index 9f982cefe5..c4bbbfeb73 100644 --- a/sys/dev/netif/bce/if_bce.c +++ b/sys/dev/netif/bce/if_bce.c @@ -5390,6 +5390,12 @@ bce_intr(void *xsc) BCE_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM | BCE_PCICFG_INT_ACK_CMD_MASK_INT); + /* + * Read back to deassert IRQ immediately to avoid too + * many spurious interrupts. + */ + REG_RD(sc, BCE_PCICFG_INT_ACK_CMD); + /* Check if the hardware has finished any work. */ hw_rx_cons = bce_get_hw_rx_cons(sc); hw_tx_cons = bce_get_hw_tx_cons(sc); -- 2.41.0