]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: cdc-acm: Restore CAP_BRK functionnality to CH343
authorMarc Zyngier <maz@kernel.org>
Sun, 1 Mar 2026 12:44:40 +0000 (12:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2026 15:17:55 +0000 (16:17 +0100)
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 66aad7d8d3ec5 ("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: 66aad7d8d3ec5 ("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>
drivers/usb/class/cdc-acm.c
drivers/usb/class/cdc-acm.h

index ad38c746270aff79ebf00d005c279c57d9bc40e8..7ede29d4c7c13491227fec89b0f900b085aa0778 100644 (file)
@@ -1379,6 +1379,8 @@ made_compressed_probe:
                acm->ctrl_caps = h.usb_cdc_acm_descriptor->bmCapabilities;
        if (quirks & NO_CAP_LINE)
                acm->ctrl_caps &= ~USB_CDC_CAP_LINE;
+       if (quirks & MISSING_CAP_BRK)
+               acm->ctrl_caps |= USB_CDC_CAP_BRK;
        acm->ctrlsize = ctrlsize;
        acm->readsize = readsize;
        acm->rx_buflimit = num_rx_buf;
@@ -2002,6 +2004,9 @@ static const struct usb_device_id acm_ids[] = {
        .driver_info = IGNORE_DEVICE,
        },
 
+       /* CH343 supports CAP_BRK, but doesn't advertise it */
+       { USB_DEVICE(0x1a86, 0x55d3), .driver_info = MISSING_CAP_BRK, },
+
        /* control interfaces without any protocol set */
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
                USB_CDC_PROTO_NONE) },
index 759ac15631d3e528bc9ae8e4f44952afe16edd0f..76f73853a60b63a9385a9a4b8fd361e693f7d459 100644 (file)
@@ -113,3 +113,4 @@ struct acm {
 #define CLEAR_HALT_CONDITIONS          BIT(5)
 #define SEND_ZERO_PACKET               BIT(6)
 #define DISABLE_ECHO                   BIT(7)
+#define MISSING_CAP_BRK                        BIT(8)