Skip to content

Commit 14ae24c

Browse files
Marc Zyngiergregkh
authored andcommitted
usb: cdc-acm: Restore CAP_BRK functionnality to CH343
The CH343 USB/serial adapter is as buggy as it is popular (very). One of its quirks is that despite being capable of signalling a BREAK condition, it doesn't advertise it. This used to work nonetheless until 66aad7d ("usb: cdc-acm: return correct error code on unsupported break") applied some reasonable restrictions, preventing breaks from being emitted on devices that do not advertise CAP_BRK. Add a quirk for this particular device, so that breaks can still be produced on some of my machines attached to my console server. Fixes: 66aad7d ("usb: cdc-acm: return correct error code on unsupported break") Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: stable <stable@kernel.org> Cc: Oliver Neukum <oneukum@suse.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Oliver Neukum <oneukum@suse.com> Link: https://patch.msgid.link/20260301124440.1192752-1-maz@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8479891 commit 14ae24c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/usb/class/cdc-acm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,8 @@ static int acm_probe(struct usb_interface *intf,
13791379
acm->ctrl_caps = h.usb_cdc_acm_descriptor->bmCapabilities;
13801380
if (quirks & NO_CAP_LINE)
13811381
acm->ctrl_caps &= ~USB_CDC_CAP_LINE;
1382+
if (quirks & MISSING_CAP_BRK)
1383+
acm->ctrl_caps |= USB_CDC_CAP_BRK;
13821384
acm->ctrlsize = ctrlsize;
13831385
acm->readsize = readsize;
13841386
acm->rx_buflimit = num_rx_buf;
@@ -2002,6 +2004,9 @@ static const struct usb_device_id acm_ids[] = {
20022004
.driver_info = IGNORE_DEVICE,
20032005
},
20042006

2007+
/* CH343 supports CAP_BRK, but doesn't advertise it */
2008+
{ USB_DEVICE(0x1a86, 0x55d3), .driver_info = MISSING_CAP_BRK, },
2009+
20052010
/* control interfaces without any protocol set */
20062011
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
20072012
USB_CDC_PROTO_NONE) },

drivers/usb/class/cdc-acm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,4 @@ struct acm {
113113
#define CLEAR_HALT_CONDITIONS BIT(5)
114114
#define SEND_ZERO_PACKET BIT(6)
115115
#define DISABLE_ECHO BIT(7)
116+
#define MISSING_CAP_BRK BIT(8)

0 commit comments

Comments
 (0)