mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
net: can: rockchip: fix rx stuck and timeout
In some special applications, tx has read data from the fifo, rx to read the fifo is 0 when there is no need to do timeout waiting. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Change-Id: I7f4bc88ace026088228396da96d628bebb9e4b94
This commit is contained in:
@@ -852,7 +852,10 @@ static irqreturn_t rockchip_canfd_interrupt(int irq, void *dev_id)
|
||||
rockchip_canfd_write(rcan, CAN_INT_MASK, 0x1);
|
||||
napi_schedule(&rcan->napi);
|
||||
} else {
|
||||
quota = rockchip_canfd_get_rx_fifo_cnt(ndev);
|
||||
work_done = 0;
|
||||
quota = (rockchip_canfd_read(rcan, CAN_RXFC) &
|
||||
rcan->rx_fifo_mask) >>
|
||||
rcan->rx_fifo_shift;
|
||||
if (quota) {
|
||||
while (work_done < quota)
|
||||
work_done += rockchip_canfd_rx(ndev);
|
||||
|
||||
Reference in New Issue
Block a user