can: m_can: reset IR_RF0L in message reception loop
Subsystems (2)
PATCH 1/1 can: m_can: reset IR_RF0L in message reception loop
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.
--- drivers/net/can/m_can/m_can.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/can/m_can/m_can.c +3 -1
@@ -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);
Signature · 1 line
2.20.1
Quoted 4 lines · Mariusz Madej
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.
Looking at the flow in m_can_rx_handler, it looks as though m_can_handle_bus_errors -> m_can_handle_lost_msg already handles message loss properly, and issues a netdev_err. I wonder whether we can remove the warning from m_can_do_rx_poll entirely:
drivers/net/can/m_can/m_can.c +0 -3
@@ -501,9 +501,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) }while ((rxfs &RXFS_FFL_MASK ) && (quota >0 )) { -if (rxfs &RXFS_RFL ) -netdev_warn (dev,"Rx FIFO 0 Message Lost\n" ); -m_can_read_fifo (dev, rxfs); quota--;
---
Regards,
Torin Cooper-Bennun
Software Engineer | maxiluxsystems.com
Marc Kleine-Budde
maintainerQuoted 17 lines · Torin Cooper-Bennun
Quoted 4 lines · Mariusz Madej
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.
Looking at the flow in
m_can_rx_handler, it looks as thoughm_can_handle_bus_errors->m_can_handle_lost_msgalready handles message loss properly, and issues anetdev_err. I wonder whether we can remove the warning fromm_can_do_rx_pollentirely:drivers/net/can/m_can/m_can.c +0
-0
drivers/net/can/m_can/m_can.c static int m_can_do_rx_poll(struct net_device *dev, int quota) · line 506
Quoted 9 lines
drivers/net/can/m_can/m_can.c +0
-3@@ -501,9 +501,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) }while ((rxfs &RXFS_FFL_MASK ) && (quota >0 )) { -if (rxfs &RXFS_RFL ) -netdev_warn (dev,"Rx FIFO 0 Message Lost\n" ); -m_can_read_fifo (dev, rxfs); quota--;
Looks good to me. Can you send a proper patch?
regards,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Quoted 18 lines · Marc Kleine-Budde
Quoted 18 lines
Looking at the flow in
m_can_rx_handler, it looks as thoughm_can_handle_bus_errors->m_can_handle_lost_msgalready handles message loss properly, and issues anetdev_err. I wonder whether we can remove the warning fromm_can_do_rx_pollentirely:drivers/net/can/m_can/m_can.c +0
-3@@ -501,9 +501,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) }while ((rxfs &RXFS_FFL_MASK ) && (quota >0 )) { -if (rxfs &RXFS_RFL ) -netdev_warn (dev,"Rx FIFO 0 Message Lost\n" ); -m_can_read_fifo (dev, rxfs);
Quoted 4 lines
drivers/net/can/m_can/m_can.c static int m_can_do_rx_poll(struct net_device *dev, int quota) · line 506
Quoted 2 lines
drivers/net/can/m_can/m_can.c +0
-0quota--;Looks good to me. Can you send a proper patch?
Of course, will do shortly.
--
Regards,
Torin Cooper-Bennun
Software Engineer | maxiluxsystems.com