Re: USB: synce-hal does not work with linux usb high speed connection (ehci_hcd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 23.02.2011 16:47, schrieb Alan Stern:
> On Wed, 23 Feb 2011, Flynn Marquardt wrote:
>
>>>> Hi Alan,
>>>>
>>>> some years ago I reported a problem consuming and now I ask with another
>>>> problem I have.
>>>> If you are not the right person, please tell me who I should ask instead.
>>>>
>>>> My problem:
>>>>
>>>> I use synce-hal (http://www.synce.org/moin/) to connect to Windows CE
>>>> devices through usb.
>>>> All works fine with older devices, that only have usb full-speed and on
>>>> the linux host e.g. the uhci_hcd
>>>> module is used: connection can be established and used.
>>>>
>>>> Newer devices have usb high speed ports and linux uses the ehci_hcd
>>>> module and the connection cannot be
>>>> "fully" established (connection is little bit tricky, details are here
>>>> http://www.synce.org/moin/TechnicalInformation/InitalConnection).
>>>> The needed pppd can be started and the ppp-connection can be
>>>> established, but the device cannot be 'pinged',
>>>> the Windows CE is waiting for some magic bytes, that do not arrive and
>>>> gets a timeout.
>>>> After unloading ehci_hcd (forcing full speed) these devices work fine too.
>>>> So this really a ehci related problem.
>>>>
>>>> Can this be fixed, so that synce also works with high speed?
>>>> In Windows all works fine with these devices using high speed.
>>>> I'll do any debugging, that is needed, sending usb-debugfs, usb-monitor
>>>> output, ...
>>> What version of the Linux kernel are you using?
>>>
>> I have this problem with different current versions on different machines:
>> - 2.6.38-rc6
>> - 2.6.37.1
>> - 2.6.36.4
>>
>>> It would help to see usbmon traces for both a working full-speed 
>>> connection and a non-working high-speed connection.
>>>
>> The output of usbmon is attached for kernel version 2.6.37.1:
>> - 6.uhci.mon.out: successful connect and status query (synce-pstatus)
>> with ehci module unloaded
>> - 4.ehci.mon.out: failed connect with ehci module loaded
>>
>> The usbmon output contains only the traffic belonging to the device, e.g.:
>>
>> cat /sys/kernel/debug/usb/usbmon/4u > 4.ehci.mon.out
> Okay, good.  The two usbmon traces are very similar, right up until the
> end.
>
> At the end, the EHCI trace got an EOVERFLOW error.  The synce-hal
> program asked for a 256-byte transfer and the device sent more than 256
> bytes.  On a full-speed connection this doesn't matter, but on a
> high-speed connection it does.
>
> The solution is to fix synce-hal.  It should request a 512-byte or
> 1024-byte transfer, not a 256-byte transfer.
>
> You should report this bug to the Synce project.
>
I tried to fix it myself and searched for 256-byte buffer and did not
find any ...

But I fixed it anyway: the problem is the bulk_in_size in
drivers/usb/serial/ipaq.c:

        .bulk_in_size =         256,

I increased these values to 512:

        .bulk_in_size =         512,

and it works now and is faster! Some other serial usb drivers also have
this increased
value, so it should be safe. diff is attached.

I appreciate your help Alan!

Flynn

--- drivers/usb/serial/ipaq.c-orig	2011-02-23 19:01:44.316173437 +0100
+++ drivers/usb/serial/ipaq.c	2011-02-23 19:07:23.525877261 +0100
@@ -557,7 +557,7 @@
 	.description =		"PocketPC PDA",
 	.usb_driver =		&ipaq_driver,
 	.id_table =		ipaq_id_table,
-	.bulk_in_size =		256,
+	.bulk_in_size =		512,
 	.bulk_out_size =	256,
 	.open =			ipaq_open,
 	.attach =		ipaq_startup,

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux