[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813-translucent-turkey-of-force-96bb34-mkl@pengutronix.de>
Date: Wed, 13 Aug 2025 10:14:28 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Stefan Mätje <stefan.maetje@....eu>
Cc: Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Frank Jungclaus <frank.jungclaus@....eu>, linux-can@...r.kernel.org, socketcan@....eu,
Simon Horman <horms@...nel.org>, Olivier Sobrie <olivier@...rie.be>,
Oliver Hartkopp <socketcan@...tkopp.net>, netdev@...r.kernel.org
Subject: Re: [PATCH 3/6] can: esd_usb: Fix handling of TX context objects
On 11.08.2025 23:06:08, Stefan Mätje wrote:
> For each TX CAN frame submitted to the USB device the driver saves the
> echo skb index in struct esd_tx_urb_context context objects. If the
> driver runs out of free context objects CAN transmission stops.
>
> This patch fixes some spots where such context objects are not freed
> correctly.
>
> In esd_usb_tx_done_msg() the check for netif_device_present() is moved
> after the identification and release of TX context and the release of
> the echo skb. This is allowed even if netif_device_present() would
> return false because the mentioned operations don't touch the device
> itself but only free local acquired resources. This keeps the context
> handling with the acknowledged TX jobs in sync.
>
> In esd_usb_start_xmit() a check is performed to see whether a context
> object could be allocated. Added a netif_stop_queue() there before the
> function is aborted. This makes sure the network queue is stopped and
> avoids getting tons of log messages in a situation without free TX
> objects. The adjacent log message now also prints the active jobs
> counter making a cross check between active jobs and "no free context"
> condition possible.
>
> In esd_usb_start_xmit() the error handling of usb_submit_urb() missed to
> free the context object together with the echo skb and decreasing the
> job count.
>
> Signed-off-by: Stefan Mätje <stefan.maetje@....eu>
Please add a Fixes tag.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists