[PATCH v2 0/5] can: esd_usb: Fixes and improvements
From: Stefan Mätje <stefan.maetje@esd.eu>
Date: 2025-08-21 14:34:29
Also in:
linux-can
The first patch fixes a condition where the esd_usb CAN driver may not detect connected CAN-USB devices correctly after a reboot. This patch was already presented on the list before starting this series and changes due to that feedback are integrated. References: https://lore.kernel.org/linux-can/d7fd564775351ea8a60a6ada83a0368a99ea6b19.camel@esd.eu/ (local) The second patch fixes situations where the the handling of TX context objects for each sent CAN frame could go out of sync with the acknowledged or erroneous TX jobs and then lose free TX context objects. This could lead to the driver incapable of sending frames. The third patch adds TX FIFO watermark to eliminate occasional error messages and significantly reduce the number of calls to netif_start_queue() and netif_stop_queue(). The forth patch makes some error messages also print the error code to achieve a higher significance. Removes also a duplicate message and makes the register / unregister messages symmetric. The fifth patch avoids emitting any error messages during the disconnect of CAN-USB devices or the driver unload. Previous versions: v1: https://lore.kernel.org/linux-can/20250811210611.3233202-1-stefan.maetje@esd.eu/ (local) Changes in v2: - Withdraw "can: esd_usb: Fix possible calls to kfree() with NULL". - Reworked now first patch: - Functions esd_usb_req_version() and esd_usb_recv_version() now allocate their own transfer buffers. - Check whether the announced message size fits into received data block. - Second patch: Added a Fixes tag - Third patch: Added a Fixes tag - Forth patch: - Convert all occurrences of error status prints to use "ERR_PTR(err)" instead of printing the decimal value of "err". - Rename retval to err in esd_usb_read_bulk_callback() to make the naming of error status variables consistent with all other functions. Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu> --- Stefan Mätje (5): can: esd_usb: Fix not detecting version reply in probe routine can: esd_usb: Fix handling of TX context objects can: esd_usb: Add watermark handling for TX jobs can: esd_usb: Rework display of error messages can: esd_usb: Avoid errors triggered from USB disconnect drivers/net/can/usb/esd_usb.c | 238 ++++++++++++++++++++++++---------- 1 file changed, 171 insertions(+), 67 deletions(-) base-commit: 0e6639c8505d70e821bc27f951a0ff6303f10d4d -- 2.34.1