Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-28 Thread Frank Schäfer
Am 28.10.2013 09:27, schrieb Mika Westerberg:
> On Fri, Oct 25, 2013 at 03:43:03PM +0200, Frank Schäfer wrote:
>> Am 25.10.2013 15:17, schrieb Mika Westerberg:
>>> On Fri, Oct 25, 2013 at 03:01:37PM +0200, Frank Schäfer wrote:
> Tried few other baudrates > 115200 and they don't work either.
 Urgh... has this device ever been working at baud rates > 115200 ?
>>> I have only used it as a serial console for a device and never tried baud
>>> rates higher than 115200 before today.
>> Could you at least test kernel 3.11 ?
> Tried on v3.11 following rates: 115200, 230400, 460800, and they all work.

That's weird.
Ok, it seems I'll have to order one of these adapters to find out what's
going on. ;-)
In the meantime, we have to switch back to the old baud rate encoding
method/strategy for this chip.
I will send a patch later this evening.

Thank you for reporting this issue and testing !

Regards,
Frank Schäfer
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-28 Thread Mika Westerberg
On Fri, Oct 25, 2013 at 03:43:03PM +0200, Frank Schäfer wrote:
> Am 25.10.2013 15:17, schrieb Mika Westerberg:
> > On Fri, Oct 25, 2013 at 03:01:37PM +0200, Frank Schäfer wrote:
> >>> Tried few other baudrates > 115200 and they don't work either.
> >> Urgh... has this device ever been working at baud rates > 115200 ?
> > I have only used it as a serial console for a device and never tried baud
> > rates higher than 115200 before today.
> Could you at least test kernel 3.11 ?

Tried on v3.11 following rates: 115200, 230400, 460800, and they all work.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-25 Thread Frank Schäfer
Am 25.10.2013 15:17, schrieb Mika Westerberg:
> On Fri, Oct 25, 2013 at 03:01:37PM +0200, Frank Schäfer wrote:
>>> Tried few other baudrates > 115200 and they don't work either.
>> Urgh... has this device ever been working at baud rates > 115200 ?
> I have only used it as a serial console for a device and never tried baud
> rates higher than 115200 before today.
Could you at least test kernel 3.11 ?

>
>> If yes, what's the last working kernel version ?
>> Commit 8d48fdf689fe "USB: PL2303: correctly handle baudrates above
>> 115200" could be relevant.
>>
>> Btw: do you have a TRENDnet TU-S9 v1.xR or v2.0R ?
> It is v1.xR I believe.
Ok, thanks.

Regards,
Frank
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-25 Thread Mika Westerberg
On Fri, Oct 25, 2013 at 03:01:37PM +0200, Frank Schäfer wrote:
> > Tried few other baudrates > 115200 and they don't work either.
> Urgh... has this device ever been working at baud rates > 115200 ?

I have only used it as a serial console for a device and never tried baud
rates higher than 115200 before today.

> If yes, what's the last working kernel version ?
> Commit 8d48fdf689fe "USB: PL2303: correctly handle baudrates above
> 115200" could be relevant.
> 
> Btw: do you have a TRENDnet TU-S9 v1.xR or v2.0R ?

It is v1.xR I believe.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-25 Thread Frank Schäfer
Am 25.10.2013 12:27, schrieb Mika Westerberg:
> On Thu, Oct 24, 2013 at 03:20:02PM +0200, Frank Schäfer wrote:
>> Ok, this seems to be a HXD (HX rev. D) chip.
>> Could you please validate by checking what Prolifics CheckChipVersion
>> tool toll sais ?
> It says: "This is a PL-2303 HXD chip".
Good, so it's an original chip (no Chinese clone).

>
>> It would also be very nice if you could provide a USB-log of what this
>> tool does, because we are currently not able to distinguish between HXD
>> and EA, RA, SA chips.
> Attached is the exchange (in *.csv) that I got from USB analyzator. Hope it
> helps. Please let me know if you need something more.
Great, thanks !

>
>> Are baudrates > 115200 working ?
> Tried few other baudrates > 115200 and they don't work either.
Urgh... has this device ever been working at baud rates > 115200 ?
If yes, what's the last working kernel version ?
Commit 8d48fdf689fe "USB: PL2303: correctly handle baudrates above
115200" could be relevant.

Btw: do you have a TRENDnet TU-S9 v1.xR or v2.0R ?

Regards,
Frank Schäfer

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-25 Thread Mika Westerberg
On Thu, Oct 24, 2013 at 03:20:02PM +0200, Frank Schäfer wrote:
> Ok, this seems to be a HXD (HX rev. D) chip.
> Could you please validate by checking what Prolifics CheckChipVersion
> tool toll sais ?

It says: "This is a PL-2303 HXD chip".

> It would also be very nice if you could provide a USB-log of what this
> tool does, because we are currently not able to distinguish between HXD
> and EA, RA, SA chips.

Attached is the exchange (in *.csv) that I got from USB analyzator. Hope it
helps. Please let me know if you need something more.

> Are baudrates > 115200 working ?

Tried few other baudrates > 115200 and they don't work either.
# Total Phase Data Center(tm) v6.60
# (c) 2005-2013 Total Phase, Inc.
# www.totalphase.com
#
# 
#
# Level,Sp,Index,m:s.ms.us,Dur,Len,Err,Dev,Ep,Record,Data,Summary,ASCII
0,,0,0:00.000.000,,Capture started (Aggregate),,[10/25/13 12:44:46],
0,,1,0:00.000.000,
0,FS,2,0:00.000.014,
0,FS,3,0:00.000.015,750 ns,1 B,I,,,NAK packet,5A,,Z
0,FS,5,0:01.308.880,53.083 us,1 B,,05,00,Control Transfer,02,,.
1,FS,6,0:01.308.880,12.500 us,8 B,,05,00,   SETUP txn,C0 01 84 84 00 00 01 00,,
2,FS,7,0:01.308.880,2.083 us,3 B,,05,00,  SETUP packet,2D 05 D0,,-..
2,FS,8,0:01.308.884,7.416 us,11 B,,05,00,  DATA0 packet,C3 C0 01 84 84 00 00 01 00 4C AE,,.L.
2,FS,9,0:01.308.892,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,10,0:01.308.907,8.083 us,1 B,,05,00,   IN txn,02,,.
2,FS,11,0:01.308.907,2.083 us,3 B,,05,00,  IN packet,69 05 D0,,i..
2,FS,12,0:01.308.911,2.850 us,4 B,,05,00,  DATA1 packet,4B 02 C1 7E,,K..~
2,FS,13,0:01.308.915,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,14,0:01.308.926,7.166 us,0 B,,05,00,   OUT txn,,,
2,FS,15,0:01.308.926,2.083 us,3 B,,05,00,  OUT packet,E1 05 D0,,...
2,FS,16,0:01.308.929,2.083 us,3 B,,05,00,  DATA1 packet,4B 00 00,,K..
2,FS,17,0:01.308.933,750 ns,1 B,,05,00,  ACK packet,D2,,.
0,FS,19,0:01.311.385,35.166 us,0 B,,05,00,Control Transfer,,,
1,FS,20,0:01.311.385,12.500 us,8 B,,05,00,   SETUP txn,40 01 04 04 00 00 00 00,,@...
2,FS,21,0:01.311.385,2.083 us,3 B,,05,00,  SETUP packet,2D 05 D0,,-..
2,FS,22,0:01.311.388,7.416 us,11 B,,05,00,  DATA0 packet,C3 40 01 04 04 00 00 00 00 5B 40,,.@...[@
2,FS,23,0:01.311.396,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,24,0:01.311.412,7.333 us,0 B,,05,00,   IN txn,,,
2,FS,25,0:01.311.412,2.083 us,3 B,,05,00,  IN packet,69 05 D0,,i..
2,FS,26,0:01.311.416,2.083 us,3 B,,05,00,  DATA1 packet,4B 00 00,,K..
2,FS,27,0:01.311.419,750 ns,1 B,,05,00,  ACK packet,D2,,.
0,FS,29,0:01.324.425,118.000 us,1 B,,05,00,Control Transfer,02,,.
1,FS,30,0:01.324.425,12.500 us,8 B,,05,00,   SETUP txn,C0 01 84 84 00 00 01 00,,
2,FS,31,0:01.324.425,2.083 us,3 B,,05,00,  SETUP packet,2D 05 D0,,-..
2,FS,32,0:01.324.428,7.416 us,11 B,,05,00,  DATA0 packet,C3 C0 01 84 84 00 00 01 00 4C AE,,.L.
2,FS,33,0:01.324.437,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,34,0:01.324.447,8.083 us,1 B,,05,00,   IN txn,02,,.
2,FS,35,0:01.324.447,2.083 us,3 B,,05,00,  IN packet,69 05 D0,,i..
2,FS,36,0:01.324.450,2.850 us,4 B,,05,00,  DATA1 packet,4B 02 C1 7E,,K..~
2,FS,37,0:01.324.454,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,38,0:01.324.536,7.083 us,0 B,,05,00,   OUT txn,,,
2,FS,39,0:01.324.536,2.083 us,3 B,,05,00,  OUT packet,E1 05 D0,,...
2,FS,40,0:01.324.539,2.083 us,3 B,,05,00,  DATA1 packet,4B 00 00,,K..
2,FS,41,0:01.324.542,750 ns,1 B,,05,00,  ACK packet,D2,,.
0,FS,43,0:01.326.799,52.833 us,1 B,,05,00,Control Transfer,FF,,.
1,FS,44,0:01.326.799,12.500 us,8 B,,05,00,   SETUP txn,C0 01 83 83 00 00 01 00,,
2,FS,45,0:01.326.799,2.083 us,3 B,,05,00,  SETUP packet,2D 05 D0,,-..
2,FS,46,0:01.326.802,7.516 us,11 B,,05,00,  DATA0 packet,C3 C0 01 83 83 00 00 01 00 F8 D9,,...
2,FS,47,0:01.326.811,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,48,0:01.326.826,8.083 us,1 B,,05,00,   IN txn,FF,,.
2,FS,49,0:01.326.826,2.083 us,3 B,,05,00,  IN packet,69 05 D0,,i..
2,FS,50,0:01.326.829,2.916 us,4 B,,05,00,  DATA1 packet,4B FF 00 FF,,K...
2,FS,51,0:01.326.833,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,52,0:01.326.845,7.166 us,0 B,,05,00,   OUT txn,,,
2,FS,53,0:01.326.845,2.083 us,3 B,,05,00,  OUT packet,E1 05 D0,,...
2,FS,54,0:01.326.848,2.083 us,3 B,,05,00,  DATA1 packet,4B 00 00,,K..
2,FS,55,0:01.326.851,750 ns,1 B,,05,00,  ACK packet,D2,,.
0,FS,57,0:01.340.406,50.416 us,1 B,,05,00,Control Transfer,02,,.
1,FS,58,0:01.340.406,12.500 us,8 B,,05,00,   SETUP txn,C0 01 84 84 00 00 01 00,,
2,FS,59,0:01.340.406,2.083 us,3 B,,05,00,  SETUP packet,2D 05 D0,,-..
2,FS,60,0:01.340.410,7.416 us,11 B,,05,00,  DATA0 packet,C3 C0 01 84 84 00 00 01 00 4C AE,,.L.
2,FS,61,0:01.340.418,750 ns,1 B,,05,00,  ACK packet,D2,,.
1,FS,62,0:01.340.431,8.083 us,1 B,,05,00,   IN txn,02,,.
2,FS,63,0:01.340.431,2.083 us,3 B,,05,00,  IN packet,69 05 D0,,i..
2,FS,64,0:01.340.434,2.850 us,4 B,,05,00,   

Re: pl2303 driver regression after commit 61fa8d694b854

2013-10-24 Thread Frank Schäfer
Am 24.10.2013 14:21, schrieb Mika Westerberg:
> Hi,
>
> Just noticed that after commit 61fa8d694b854 (usb: pl2303: also use the
> divisor based baud rate encoding method for baud rates < 115200 with HX
> chips) my TRENDnet TU-S9 USB-to-serial adapter started corrupting data.
>
> I added baud <= 115200 check back to the comparison which makes the device
> work for me again (I'm using it at 115200 bps):
>
> if (type == type_0 || type == type_1 || type == HX_CLONE || baud <= 115200)
>   baud = pl2303_baudrate_encode_direct(baud, type, buf);
There's a better way to fix this...

>
> The PL2303 chip has following markings if it helps:
>
>   PL-2303HX
>   LF10482D
>   TP37331HD
>
> and here is the output of 'lsusb -vv' of that device:
>
> Bus 002 Device 116: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
> Device Descriptor:
>   bLength18
>   bDescriptorType 1
>   bcdUSB   1.10
>   bDeviceClass0 (Defined at Interface level)
>   bDeviceSubClass 0 
>   bDeviceProtocol 0 
>   bMaxPacketSize064
>   idVendor   0x067b Prolific Technology, Inc.
>   idProduct  0x2303 PL2303 Serial Port
>   bcdDevice4.00
>   iManufacturer   1 Prolific Technology Inc. 
>   iProduct2 USB-Serial Controller D

Ok, this seems to be a HXD (HX rev. D) chip.
Could you please validate by checking what Prolifics CheckChipVersion
tool toll sais ?
It would also be very nice if you could provide a USB-log of what this
tool does, because we are currently not able to distinguish between HXD
and EA, RA, SA chips.
Are baudrates > 115200 working ?

Regards,
Frank Schäfer

>   iSerial 0 
>   bNumConfigurations  1
>   Configuration Descriptor:
> bLength 9
> bDescriptorType 2
> wTotalLength   39
> bNumInterfaces  1
> bConfigurationValue 1
> iConfiguration  0 
> bmAttributes 0x80
>   (Bus Powered)
> MaxPower  100mA
> Interface Descriptor:
>   bLength 9
>   bDescriptorType 4
>   bInterfaceNumber0
>   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
> bmAttributes3
>   Transfer TypeInterrupt
>   Synch Type   None
>   Usage Type   Data
> wMaxPacketSize 0x000a  1x 10 bytes
> bInterval   1
>   Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x02  EP 2 OUT
> bmAttributes2
>   Transfer TypeBulk
>   Synch Type   None
>   Usage Type   Data
> wMaxPacketSize 0x0040  1x 64 bytes
> bInterval   0
>   Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x83  EP 3 IN
> bmAttributes2
>   Transfer TypeBulk
>   Synch Type   None
>   Usage Type   Data
> wMaxPacketSize 0x0040  1x 64 bytes
> bInterval   0
> Device Status: 0x
>   (Bus Powered)

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pl2303 driver regression after commit 61fa8d694b854

2013-10-24 Thread Mika Westerberg
Hi,

Just noticed that after commit 61fa8d694b854 (usb: pl2303: also use the
divisor based baud rate encoding method for baud rates < 115200 with HX
chips) my TRENDnet TU-S9 USB-to-serial adapter started corrupting data.

I added baud <= 115200 check back to the comparison which makes the device
work for me again (I'm using it at 115200 bps):

if (type == type_0 || type == type_1 || type == HX_CLONE || baud <= 115200)
baud = pl2303_baudrate_encode_direct(baud, type, buf);

The PL2303 chip has following markings if it helps:

PL-2303HX
LF10482D
TP37331HD

and here is the output of 'lsusb -vv' of that device:

Bus 002 Device 116: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0 
  bDeviceProtocol 0 
  bMaxPacketSize064
  idVendor   0x067b Prolific Technology, Inc.
  idProduct  0x2303 PL2303 Serial Port
  bcdDevice4.00
  iManufacturer   1 Prolific Technology Inc. 
  iProduct2 USB-Serial Controller D
  iSerial 0 
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   39
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0x80
  (Bus Powered)
MaxPower  100mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  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
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x000a  1x 10 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02  EP 2 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
Device Status: 0x
  (Bus Powered)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html