Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/ethernet: cpsw: Bugfix interrupts before enabling napi

If interrupts happen before napi_enable was called, the driver will not
work as expected. Network transmissions are impossible in this state.
This bug can be reproduced easily by restarting the network interface in
a loop. After some time any network transmissions on the network
interface will fail.

This patch fixes the bug by enabling napi before enabling the network
interface interrupts.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Markus Pargmann and committed by
David S. Miller
dbbd2ad8 60e66fee

+1 -1
+1 -1
drivers/net/ethernet/ti/cpsw.c
··· 1169 1169 } 1170 1170 } 1171 1171 1172 + napi_enable(&priv->napi); 1172 1173 cpdma_ctlr_start(priv->dma); 1173 1174 cpsw_intr_enable(priv); 1174 - napi_enable(&priv->napi); 1175 1175 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); 1176 1176 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); 1177 1177