All of lore.kernel.org
 help / color / mirror / Atom feed
* pl2303 : unknown device type
@ 2021-07-27 12:37 Chris
  2021-07-27 13:24 ` Oliver Neukum
  2021-07-29 10:10 ` Johan Hovold
  0 siblings, 2 replies; 10+ messages in thread
From: Chris @ 2021-07-27 12:37 UTC (permalink / raw)
  To: linux-usb


[-- Attachment #1.1: Type: text/plain, Size: 185 bytes --]

This problem was introduced with 5.13 and still persists in 5.13.5
After downgrading to 5.12.x, everything works like expected. Tested on 
archlinux. The device is an "ICP-DAS I-7561"


[-- Attachment #1.2: dmsg --]
[-- Type: text/plain, Size: 530 bytes --]

dmesg -w 

[ 1999.689678] usb 2-4: new full-speed USB device number 3 using ohci-pci
[ 1999.919763] usb 2-4: New USB device found, idVendor=067b, idProduct=2303, bcdDevice=5d.ca
[ 1999.919772] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1999.919775] usb 2-4: Product: USB-Serial Controller
[ 1999.919777] usb 2-4: Manufacturer: Prolific Technology Inc.
[ 1999.923348] pl2303 2-4:1.0: pl2303 converter detected
[ 1999.923365] pl2303 2-4:1.0: unknown device type, please report to linux-usb@vger.kernel.org 

[-- Attachment #1.3: lsusb --]
[-- Type: text/plain, Size: 2468 bytes --]

lsusb -v

Bus 002 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
Couldn't open device, some information will be missing

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x067b Prolific Technology, Inc.
  idProduct          0x2303 PL2303 Serial Port / Mobile Action MA-8910P
  bcdDevice           5d.ca
  iManufacturer           1 Prolific Technology Inc.
  iProduct                2 USB-Serial Controller
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: pl2303 : unknown device type
  2021-07-27 12:37 pl2303 : unknown device type Chris
@ 2021-07-27 13:24 ` Oliver Neukum
  2021-07-29 10:15   ` Johan Hovold
  2021-07-29 10:10 ` Johan Hovold
  1 sibling, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2021-07-27 13:24 UTC (permalink / raw)
  To: Chris, linux-usb, johan


On 27.07.21 14:37, Chris wrote:
> This problem was introduced with 5.13 and still persists in 5.13.5
> After downgrading to 5.12.x, everything works like expected. Tested on 
> archlinux. The device is an "ICP-DAS I-7561"
>

Hi,


this is almost certainly 8a7bf7510d1f43994b39a677e561af4ee6a1a0ae

("USB: serial: pl2303: amend and tighten type detection")

Your device just says 0 everywhere:

  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0

We could add a default type, but does that make sense?

Getting Johan into the loop.

    Regards

        Oliver




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

* Re: pl2303 : unknown device type
  2021-07-27 12:37 pl2303 : unknown device type Chris
  2021-07-27 13:24 ` Oliver Neukum
@ 2021-07-29 10:10 ` Johan Hovold
  2021-07-29 13:55   ` Chris
  1 sibling, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2021-07-29 10:10 UTC (permalink / raw)
  To: Chris; +Cc: linux-usb

[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]

On Tue, Jul 27, 2021 at 02:37:23PM +0200, Chris wrote:
> This problem was introduced with 5.13 and still persists in 5.13.5
> After downgrading to 5.12.x, everything works like expected. Tested on 
> archlinux. The device is an "ICP-DAS I-7561"

Thanks for reporting this.

> lsusb -v
> 
> Bus 002 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
> Couldn't open device, some information will be missing
> 
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass            0
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        64
>   idVendor           0x067b Prolific Technology, Inc.
>   idProduct          0x2303 PL2303 Serial Port / Mobile Action MA-8910P
>   bcdDevice           5d.ca

This is an unexpected device version (93.202) which may need to add a
special case for. The descriptors look just fine otherwise and matches
for example an HXD device I have here (with bcdDevice 4.00) but I guess
it could also be an HX or earlier.

Do you have any idea what kind of chip this is? 

Johan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: pl2303 : unknown device type
  2021-07-27 13:24 ` Oliver Neukum
@ 2021-07-29 10:15   ` Johan Hovold
  0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2021-07-29 10:15 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: Chris, linux-usb

On Tue, Jul 27, 2021 at 03:24:28PM +0200, Oliver Neukum wrote:
> 
> On 27.07.21 14:37, Chris wrote:
> > This problem was introduced with 5.13 and still persists in 5.13.5
> > After downgrading to 5.12.x, everything works like expected. Tested on 
> > archlinux. The device is an "ICP-DAS I-7561"

> this is almost certainly 8a7bf7510d1f43994b39a677e561af4ee6a1a0ae
> 
> ("USB: serial: pl2303: amend and tighten type detection")

Indeed.

> Your device just says 0 everywhere:
> 
>   bDeviceClass            0
>   bDeviceSubClass         0
>   bDeviceProtocol         0

This is expected. The protocol is per-interface, and nothing besides the
bcdVersion really stands out in the report.

> We could add a default type, but does that make sense?

Yeah, we may need to fallback to something like HX type if turns out
that there are more devices out there with unexpected bcdDevice.

Johan 

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

* Re: pl2303 : unknown device type
  2021-07-29 10:10 ` Johan Hovold
@ 2021-07-29 13:55   ` Chris
  2021-07-30  7:32     ` Johan Hovold
  0 siblings, 1 reply; 10+ messages in thread
From: Chris @ 2021-07-29 13:55 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

On Thursday, July 29, 2021 12:10:44 PM CEST Johan Hovold wrote:
> Do you have any idea what kind of chip this is?

No, sorry, I don't. Do I have to open the device to check? (I'd rather not... 
I'd have to crawl into the attic to get to it)

cheerio,
chris

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: pl2303 : unknown device type
  2021-07-29 13:55   ` Chris
@ 2021-07-30  7:32     ` Johan Hovold
  2021-07-30 12:11       ` Johan Hovold
  0 siblings, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2021-07-30  7:32 UTC (permalink / raw)
  To: Chris; +Cc: linux-usb

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

On Thu, Jul 29, 2021 at 03:55:48PM +0200, Chris wrote:
> On Thursday, July 29, 2021 12:10:44 PM CEST Johan Hovold wrote:
> > Do you have any idea what kind of chip this is?
> 
> No, sorry, I don't. Do I have to open the device to check? (I'd rather not... 
> I'd have to crawl into the attic to get to it)

No, that's alright. It's most likely an HXD and the difference to HX is
just the maximum line speed as far as we know currently.

I'll add a special case for the bcdDevice of this device for now.

Johan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: pl2303 : unknown device type
  2021-07-30  7:32     ` Johan Hovold
@ 2021-07-30 12:11       ` Johan Hovold
  2021-07-30 12:21         ` [PATCH] USB: serial: pl2303: fix HX type detection Johan Hovold
  0 siblings, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2021-07-30 12:11 UTC (permalink / raw)
  To: Chris; +Cc: linux-usb

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

On Fri, Jul 30, 2021 at 09:32:03AM +0200, Johan Hovold wrote:
> On Thu, Jul 29, 2021 at 03:55:48PM +0200, Chris wrote:
> > On Thursday, July 29, 2021 12:10:44 PM CEST Johan Hovold wrote:
> > > Do you have any idea what kind of chip this is?
> > 
> > No, sorry, I don't. Do I have to open the device to check? (I'd rather not... 
> > I'd have to crawl into the attic to get to it)
> 
> No, that's alright. It's most likely an HXD and the difference to HX is
> just the maximum line speed as far as we know currently.
> 
> I'll add a special case for the bcdDevice of this device for now.

Taking a closer look at this I realised that your device is actually an
HX for which bcdDevice is configurable in EEPROM/OTPROM unlike for HXD
and later types. (The default HXD product string also has a "D" in it:
"USB-Serial Controller D").

So we need to assume any device with bcdUSB 1.10 and unknown bcdDevice
to be an HX.

Johan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* [PATCH] USB: serial: pl2303: fix HX type detection
  2021-07-30 12:11       ` Johan Hovold
@ 2021-07-30 12:21         ` Johan Hovold
  2021-07-30 12:29           ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Johan Hovold @ 2021-07-30 12:21 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Charles Yeh, Yeh.Charles [葉榮鑫],
	linux-usb, linux-kernel, Chris, stable

The device release number for HX-type devices is configurable in
EEPROM/OTPROM and cannot be used reliably for type detection.

Assume all (non-H) devices with bcdUSB 1.1 and unknown bcdDevice to be
of HX type while adding a bcdDevice check for HXD and TB (1.1 and 2.0,
respectively).

Reported-by: Chris <chris@cyber-anlage.de>
Fixes: 8a7bf7510d1f ("USB: serial: pl2303: amend and tighten type detection")
Cc: stable@vger.kernel.org	# 5.13
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/pl2303.c | 41 ++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 2f2f5047452b..17601e32083e 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -418,24 +418,33 @@ static int pl2303_detect_type(struct usb_serial *serial)
 	bcdDevice = le16_to_cpu(desc->bcdDevice);
 	bcdUSB = le16_to_cpu(desc->bcdUSB);
 
-	switch (bcdDevice) {
-	case 0x100:
-		/*
-		 * Assume it's an HXN-type if the device doesn't support the old read
-		 * request value.
-		 */
-		if (bcdUSB == 0x200 && !pl2303_supports_hx_status(serial))
-			return TYPE_HXN;
+	switch (bcdUSB) {
+	case 0x110:
+		switch (bcdDevice) {
+		case 0x300:
+			return TYPE_HX;
+		case 0x400:
+			return TYPE_HXD;
+		default:
+			return TYPE_HX;
+		}
 		break;
-	case 0x300:
-		if (bcdUSB == 0x200)
+	case 0x200:
+		switch (bcdDevice) {
+		case 0x100:
+			/*
+			 * Assume it's an HXN-type if the device doesn't
+			 * support the old read request value.
+			 */
+			if (!pl2303_supports_hx_status(serial))
+				return TYPE_HXN;
+			break;
+		case 0x300:
 			return TYPE_TA;
-
-		return TYPE_HX;
-	case 0x400:
-		return TYPE_HXD;
-	case 0x500:
-		return TYPE_TB;
+		case 0x500:
+			return TYPE_TB;
+		}
+		break;
 	}
 
 	dev_err(&serial->interface->dev,
-- 
2.31.1


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

* Re: [PATCH] USB: serial: pl2303: fix HX type detection
  2021-07-30 12:21         ` [PATCH] USB: serial: pl2303: fix HX type detection Johan Hovold
@ 2021-07-30 12:29           ` Greg KH
  2021-07-30 15:11             ` Johan Hovold
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2021-07-30 12:29 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Charles Yeh, Yeh.Charles [葉榮鑫],
	linux-usb, linux-kernel, Chris, stable

On Fri, Jul 30, 2021 at 02:21:56PM +0200, Johan Hovold wrote:
> The device release number for HX-type devices is configurable in
> EEPROM/OTPROM and cannot be used reliably for type detection.
> 
> Assume all (non-H) devices with bcdUSB 1.1 and unknown bcdDevice to be
> of HX type while adding a bcdDevice check for HXD and TB (1.1 and 2.0,
> respectively).
> 
> Reported-by: Chris <chris@cyber-anlage.de>
> Fixes: 8a7bf7510d1f ("USB: serial: pl2303: amend and tighten type detection")
> Cc: stable@vger.kernel.org	# 5.13
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/usb/serial/pl2303.c | 41 ++++++++++++++++++++++---------------
>  1 file changed, 25 insertions(+), 16 deletions(-)
> 

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH] USB: serial: pl2303: fix HX type detection
  2021-07-30 12:29           ` Greg KH
@ 2021-07-30 15:11             ` Johan Hovold
  0 siblings, 0 replies; 10+ messages in thread
From: Johan Hovold @ 2021-07-30 15:11 UTC (permalink / raw)
  To: Greg KH
  Cc: Charles Yeh, Yeh.Charles [葉榮鑫],
	linux-usb, linux-kernel, Chris, stable

On Fri, Jul 30, 2021 at 02:29:55PM +0200, Greg Kroah-Hartman wrote:
> On Fri, Jul 30, 2021 at 02:21:56PM +0200, Johan Hovold wrote:
> > The device release number for HX-type devices is configurable in
> > EEPROM/OTPROM and cannot be used reliably for type detection.
> > 
> > Assume all (non-H) devices with bcdUSB 1.1 and unknown bcdDevice to be
> > of HX type while adding a bcdDevice check for HXD and TB (1.1 and 2.0,
> > respectively).
> > 
> > Reported-by: Chris <chris@cyber-anlage.de>
> > Fixes: 8a7bf7510d1f ("USB: serial: pl2303: amend and tighten type detection")
> > Cc: stable@vger.kernel.org	# 5.13
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> >  drivers/usb/serial/pl2303.c | 41 ++++++++++++++++++++++---------------
> >  1 file changed, 25 insertions(+), 16 deletions(-)
> > 
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thanks for reviewing. Now applied.

Johan

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

end of thread, other threads:[~2021-07-30 15:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27 12:37 pl2303 : unknown device type Chris
2021-07-27 13:24 ` Oliver Neukum
2021-07-29 10:15   ` Johan Hovold
2021-07-29 10:10 ` Johan Hovold
2021-07-29 13:55   ` Chris
2021-07-30  7:32     ` Johan Hovold
2021-07-30 12:11       ` Johan Hovold
2021-07-30 12:21         ` [PATCH] USB: serial: pl2303: fix HX type detection Johan Hovold
2021-07-30 12:29           ` Greg KH
2021-07-30 15:11             ` Johan Hovold

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.