[PATCH] can: m_can: reset IR_RF0L in message reception loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Message lost warning is reported in loop without interrupt reset. Besides
redundant log messages it may lead to serious performance problem, where
fifo gets full faster than next reception is scheduled by NAPI. This
patch fixes it.

Signed-off-by: Mariusz Madej <mariusz.madej@xxxxxxxxxx>
---
 drivers/net/can/m_can/m_can.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 3752520a7..bd5539435 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -501,8 +501,10 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota)
 	}
while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) {
-		if (rxfs & RXFS_RFL)
+		if (rxfs & RXFS_RFL) {
 			netdev_warn(dev, "Rx FIFO 0 Message Lost\n");
+			m_can_write(cdev, M_CAN_IR, IR_RF0L);	
+		}
m_can_read_fifo(dev, rxfs); --
2.20.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux