diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 4929932..40ce34d 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c @@ -1219,6 +1219,7 @@ static irqreturn_t bgmac_interrupt(int irq, void *dev_id) struct bgmac *bgmac = netdev_priv(dev_id); u32 int_status = bgmac_read(bgmac, BGMAC_INT_STATUS); + pr_info("[%s] int_status:0x%08x & int_mask:0x%08x = 0x%08x\n", __FUNCTION__, int_status, bgmac->int_mask, int_status & bgmac->int_mask); int_status &= bgmac->int_mask; if (!int_status) @@ -1240,22 +1241,31 @@ static int bgmac_poll(struct napi_struct *napi, int weight) { struct bgmac *bgmac = container_of(napi, struct bgmac, napi); int handled = 0; + u32 int_status; + pr_info("[%s] START weight:%d\n", __FUNCTION__, weight); /* Ack */ bgmac_write(bgmac, BGMAC_INT_STATUS, ~0); bgmac_dma_tx_free(bgmac, &bgmac->tx_ring[0]); handled += bgmac_dma_rx_read(bgmac, &bgmac->rx_ring[0], weight); + pr_info("[%s] Read handled:%d skb-s\n", __FUNCTION__, handled); /* Poll again if more events arrived in the meantime */ - if (bgmac_read(bgmac, BGMAC_INT_STATUS) & (BGMAC_IS_TX0 | BGMAC_IS_RX)) + int_status = bgmac_read(bgmac, BGMAC_INT_STATUS); + pr_info("[%s] Read IRQ status again BGMAC_IS_TX0:%d BGMAC_IS_RX:%d\n", __FUNCTION__, !!(int_status & BGMAC_IS_TX0), !!(int_status & BGMAC_IS_RX)); + if (int_status & (BGMAC_IS_TX0 | BGMAC_IS_RX)) { + pr_info("[%s] END more skb-s to handle, returning handled:%d\n", __FUNCTION__, handled); return handled; + } if (handled < weight) { + pr_info("[%s] Read skb-s < weight, calling napi_complete, en IRQs\n", __FUNCTION__); napi_complete(napi); bgmac_chip_intrs_on(bgmac); } + pr_info("[%s] END returning handled:%d\n", __FUNCTION__, handled); return handled; }