]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: davinci_cpdma: fix locking while ctrl_stop
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Mon, 22 Aug 2016 18:18:25 +0000 (21:18 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Aug 2016 07:13:10 +0000 (00:13 -0700)
commitddd9bb7a0204edd35026d3d4b4b1847bc72c2704
tree373869a7aad67b1c177d008fecb123bc5bc6b941
parent63b65a8a36f2a8f8362828e73b53bd8c2b8a5be7
net: ethernet: ti: davinci_cpdma: fix locking while ctrl_stop

The interrupts shouldn't be disabled while receiving skb, but while
ctrl_stop, the channels are stopped and all remaining packets are
handled with netif_receive_skb(), it can cause WARN_ONCE when ctrl
is stopping while not all packets were handled with NAPIs:

lock_irq_save
    cpdma_ctlr_stop
       cpdma_chan_top
           __cpdma_chan_free
               cpsw_rx_handler
                   netif_receive_skb

So, split locking while ctrl stop thus interrupts are still
enabled while skbs handling. It can cause WARN_ONCE in rare
cases when ctrl is stopping while not all packets were handled
with NAPIs.

Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_cpdma.c