public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: cdc-acm: Restore CAP_BRK functionnality to CH343
@ 2026-03-01 12:44 Marc Zyngier
  2026-03-02 10:27 ` Oliver Neukum
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Zyngier @ 2026-03-01 12:44 UTC (permalink / raw)
  To: linux-usb, linux-kernel; +Cc: stable, Oliver Neukum, Greg Kroah-Hartman

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@vger.kernel.org
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/class/cdc-acm.c | 5 +++++
 drivers/usb/class/cdc-acm.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index ad38c746270af..7ede29d4c7c13 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1379,6 +1379,8 @@ static int acm_probe(struct usb_interface *intf,
 		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) },
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 759ac15631d3e..76f73853a60b6 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -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)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: cdc-acm: Restore CAP_BRK functionnality to CH343
  2026-03-01 12:44 [PATCH] usb: cdc-acm: Restore CAP_BRK functionnality to CH343 Marc Zyngier
@ 2026-03-02 10:27 ` Oliver Neukum
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Neukum @ 2026-03-02 10:27 UTC (permalink / raw)
  To: Marc Zyngier, linux-usb, linux-kernel; +Cc: stable, Greg Kroah-Hartman



On 01.03.26 13:44, Marc Zyngier wrote:
> 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@vger.kernel.org
> Cc: Oliver Neukum <oneukum@suse.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Oliver Neukum <oneukum@suse.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-02 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01 12:44 [PATCH] usb: cdc-acm: Restore CAP_BRK functionnality to CH343 Marc Zyngier
2026-03-02 10:27 ` Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox