All of
 help / color / mirror / Atom feed
From: Johan Hovold <>
To: Malte Bayer <>
Cc: "" <>
Subject: Re: Possible bug in the cp210x kernel driver?
Date: Tue, 21 Sep 2021 10:34:53 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Malte,

The mailings lists reject html so can you see if you can disable that
in you mail client when replying?

On Mon, Sep 20, 2021 at 05:51:43PM +0200, Malte Bayer wrote:

> > In event mode the device is supposed to replace any '0xec' characters
> > in the input stream with the string '0xec 0x00', which the driver then
> > needs to convert back to '0xec'.
> > 
> > But clearly your device doesn't escape '0xec' as expected.
> > 
> > What type of cp210x are you using?
> Its the Silabs CP2102 DCL00X1612+

I used a CP2102 when implementing support for the embedded-event mode
and just verified that everything is working as expected.

The batch number "DCL00X" might provide some insight here though.
Searching for it gives a few hits describing counterfeit CP2102 devices
which has that particular number. [1][2] Apparently they behave
mostly like the real ones, but I wouldn't be surprised if they did not
implement the event mode.

It seems people were able to use the difference in responses to
malformed requests to determine which chips were fake. The below patch
is first stab at it based on [3].

Supposedly, the fake ones would only return a single byte in response,
while the CP2102 I have hear happily returns the full eight byte

Can apply the patch and send me the logs from when connecting your

This might require some experimentation (e.g. different request,
length), but if we're lucky the malformed type request is all that's
needed to determine when event mode is supported.



From 43cab5bee8b12617d97998fa956553aef62fa704 Mon Sep 17 00:00:00 2001
From: Johan Hovold <>
Date: Tue, 21 Sep 2021 10:24:47 +0200
Subject: [PATCH] dbg: USB: serial: cp210x: add cp2102 quirk instrumentation

Signed-off-by: Johan Hovold <>
 drivers/usb/serial/cp210x.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 66a6ac50a4cd..51d99d29dde1 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -2074,6 +2074,20 @@ static void cp210x_init_max_speed(struct usb_serial *serial)
 	priv->use_actual_rate = use_actual_rate;
+static void cp2102_determine_quirks(struct usb_serial *serial)
+	u8 data[8];
+	int ret;
+	ret = cp210x_read_vendor_block(serial, REQTYPE_DEVICE_TO_HOST,
+			CP210X_GET_PARTNUM, data, sizeof(data));
+	if (ret)
+		return;
+	dev_info(&serial->interface->dev, "%s - %*ph\n", __func__,
+			(int)sizeof(data), data);
 static int cp210x_get_fw_version(struct usb_serial *serial, u16 value)
 	struct cp210x_serial_private *priv = usb_get_serial_data(serial);
@@ -2108,7 +2122,13 @@ static void cp210x_determine_type(struct usb_serial *serial)
+	dev_info(&serial->interface->dev, "%s - type = 0x%02x\n", __func__,
+			priv->partnum);
 	switch (priv->partnum) {
+	case CP210X_PARTNUM_CP2102:
+		cp2102_determine_quirks(serial);
+		break;
 	case CP210X_PARTNUM_CP2105:
 	case CP210X_PARTNUM_CP2108:
 		cp210x_get_fw_version(serial, CP210X_GET_FW_VER);

       reply	other threads:[~2021-09-21  8:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <>
2021-09-21  8:34 ` Johan Hovold [this message]
     [not found] <>
2021-09-22 11:28 ` Johan Hovold
2021-09-22 20:25   ` Malte Di Donato
2021-09-23  8:52     ` Johan Hovold
     [not found] <>
2021-09-20  8:10 ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Possible bug in the cp210x kernel driver?' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.