Re: [PATCH RFC] can: m_can: m_can_tx_work_queue(): fix tx_skb race condition

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

 



On 05.05.2021 13:06:59, Torin Cooper-Bennun wrote:
> On Wed, May 05, 2021 at 01:43:02PM +0200, Marc Kleine-Budde wrote:
> > The m_can_start_xmit() function checks if the cdev->tx_skb is NULL and
> > returns with NETDEV_TX_BUSY in case tx_sbk is not NULL.
> > 
> > There is a race condition in the m_can_tx_work_queue(), where first
> > the skb is send to the driver and then the case tx_sbk is set to NULL.
> > A TX complete IRQ might come in between and wake the queue, which
> > results in tx_skb not being cleared yet.
> > 
> > Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
> > Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> > ---
> > Hello,
> > 
> > compile time tested only.
> > 
> > Marc
> 
> Thanks a lot for spotting this Marc, after initial testing this is
> working very well. I don't see that error message at all now, even at
> very high transmit rates, and dropped frames are reduced considerably.
> 
> (Test setup: RPi CM4, TCAN4550, 500 kbit/s CAN-FD.)

Can I add your Tested-by?

Marc

-- 
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 |

Attachment: signature.asc
Description: PGP signature


[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