public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Nokia N800 - USB Host mode issues
@ 2007-06-29 16:39 Robert Schuster
  2007-07-03  9:26 ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Schuster @ 2007-06-29 16:39 UTC (permalink / raw)
  To: linux-omap-open-source

Hi,
I am using the patches available from
http://www.muru.com/linux/n800-usb-host/

to enable the USB Host mode capability of the N800 device

.. and have some questions:

I connected an external powered USB Hub to it and tried a few devices.

a)
First of all: It works fine and I can for instance transmit big amount
of data through a USB ethernet device (using the pegasus.ko driver).
However it does not seem to like plugging devices of. Because after
doing so (in case of the ethernet device I did ifconfig eth0 down first)
the host will not accept the device anymore. It also seems to have
trouble communicating to the hub at all.

b)
The host did not accept an USB keyboard of mine which has two built-in
USB 1.1 ports (the real HUB is an USB 2.0 one).

Has any development happened on the USB Hostdriver for the N800 after
the release of the above mentioned patches?

Is there any interest to debug the problems a) and b) further? If so,
what info should I provide?

Regards
Robert Schuster

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

* Re: Nokia N800 - USB Host mode issues
  2007-06-29 16:39 Nokia N800 - USB Host mode issues Robert Schuster
@ 2007-07-03  9:26 ` Tony Lindgren
  2007-07-04  0:20   ` robert.vogt
  2007-07-04 12:52   ` Robert Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Tony Lindgren @ 2007-07-03  9:26 UTC (permalink / raw)
  To: Robert Schuster; +Cc: linux-omap-open-source

Hi,

* Robert Schuster <theBohemian@gmx.net> [070629 09:41]:
> Hi,
> I am using the patches available from
> http://www.muru.com/linux/n800-usb-host/
> 
> to enable the USB Host mode capability of the N800 device
> 
> .. and have some questions:
> 
> I connected an external powered USB Hub to it and tried a few devices.
> 
> a)
> First of all: It works fine and I can for instance transmit big amount
> of data through a USB ethernet device (using the pegasus.ko driver).
> However it does not seem to like plugging devices of. Because after
> doing so (in case of the ethernet device I did ifconfig eth0 down first)
> the host will not accept the device anymore. It also seems to have
> trouble communicating to the hub at all.

Thanks for the info. Sounds like some of the issues have been
fixed already.

> b)
> The host did not accept an USB keyboard of mine which has two built-in
> USB 1.1 ports (the real HUB is an USB 2.0 one).

Turns out it's because the babble interrupts are fatal for HS
devices, but must be ignored for LS/FS devices... This is already fixed
in the linux-omap git tree.

> Has any development happened on the USB Hostdriver for the N800 after
> the release of the above mentioned patches?

Yes, but the changes have been only in the linux-omap git tree. I've
just refreshed the N800 usb host patches [1] to be in sync with linux-omap
tree. Can you please see if these work better for you?

> Is there any interest to debug the problems a) and b) further? If so,
> what info should I provide?

Yes, musb chips are integrated in 2430 and 3430, and tusb uses this chip
too. So development is going on, please post any patches you may have
to this mailing list :)

For the information to provide, knowing what kind of devices don't
work after updating to the latest series of patches would be nice.

Regards,

Tony

[1] http://www.muru.com/linux/n800-usb-host/

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

* Re: Nokia N800 - USB Host mode issues
  2007-07-03  9:26 ` Tony Lindgren
@ 2007-07-04  0:20   ` robert.vogt
  2007-07-11 11:03     ` Tony Lindgren
  2007-07-04 12:52   ` Robert Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: robert.vogt @ 2007-07-04  0:20 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source

Hi Tony,

The new patches seem to be working much better for me.  Now when I enter host
mode, I get 5V out consistently, and it is at least able to see (and power!)
the device.  I am not sure how to load the usb-serial driver, however (do I
need to unload the gadget driver?), as it should be compiled-in to the
kernel... (or do I need to add the device to the appropriate device driver's
support table?)

Here is what I'm seeing as I plug in the device...

Nokia-N800-10:/proc/driver# cat musb_hdrc
Status: MHDRC, Mode=Host (Power=e0, DevCtl=19)
OTG state: a_wait_bcon; inactive
Options: tusb-omap-dma, otg (peripheral+host), debug=1 [eps=16]
Peripheral address: c0
Root port status: 00000100
TUSB6010: devconf c0010001, phy enable 00800000 drive 0000000a
        otg 174 timer 005b8d80
        prcm conf 00000000 mgmt 00a80300; int src 0000a000 mask 00000008
Gadget driver: g_file_storage

----- plug in USB-Serial Device -----

Nokia-N800-10:/proc/driver# cat musb_hdrc
Status: MHDRC, Mode=Host (Power=e0, DevCtl=5d)
OTG state: a_host; active
Options: tusb-omap-dma, otg (peripheral+host), debug=1 [eps=16]
Peripheral address: c0
Root port status: 00000101
TUSB6010: devconf c0010001, phy enable 00800000 drive 0000000a
        otg 171 timer 005b8d80
        prcm conf 00010000 mgmt 00a80300; int src 00000000 mask 00000008
Gadget driver: g_file_storage

----- Sometimes: ------
Nokia-N800-10:/proc/driver# dmesg -c
[ 2988.626434] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
[ 2988.626525] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 2988.626617] hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
[ 2988.782623] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status
0x101
[ 2988.907653] usb 1-1: new full speed USB device using musb_hdrc and 
address 8
[ 2989.032623] usb 1-1: device descriptor read/64, error -71
[ 2989.266998] usb 1-1: device descriptor read/64, error -71
[ 2989.501373] usb 1-1: new full speed USB device using musb_hdrc and 
address 9
[ 2989.626373] usb 1-1: device descriptor read/64, error -71
[ 2989.859588] usb 1-1: device descriptor read/64, error -71
[ 2990.095153] usb 1-1: new full speed USB device using musb_hdrc and 
address 10
[ 2990.516967] usb 1-1: device not accepting address 10, error -71
[ 2990.642028] usb 1-1: new full speed USB device using musb_hdrc and 
address 11
[ 2991.063934] usb 1-1: device not accepting address 11, error -71
[ 2991.064056] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 2991.064117] hub 1-0:1.0: port 1 enable change, status 00000101

----- And sometimes: ------
Nokia-N800-10:/proc/driver# dmesg -c
[ 3760.898742] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
[ 3760.898895] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 3760.899017] hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
[ 3761.056060] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status
0x101
[ 3761.181121] usb 1-1: new full speed USB device using musb_hdrc and 
address 16
[ 3761.306060] usb 1-1: device descriptor read/64, error -71
[ 3761.540466] usb 1-1: device descriptor read/64, error -71
[ 3761.774841] usb 1-1: new full speed USB device using musb_hdrc and 
address 17
[ 3761.837341] musb_stage0_irq 615: BABBLE devctl: 5d
[ 3761.899841] usb 1-1: device descriptor read/64, error -71
[ 3762.142059] usb 1-1: device descriptor read/64, error -71
[ 3762.384185] usb 1-1: new full speed USB device using musb_hdrc and 
address 18
[ 3762.806091] usb 1-1: device not accepting address 18, error -71
[ 3762.929870] usb 1-1: new full speed USB device using musb_hdrc and 
address 19
[ 3762.953948] usb 1-1: ep0 maxpacket = 8
[ 3762.959594] usb 1-1: skipped 4 descriptors after interface
[ 3762.960327] usb 1-1: default language 0x0409
[ 3762.964538] usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=0
[ 3762.964569] usb 1-1: Product: OBD-II Device Interface
[ 3762.964599] usb 1-1: Manufacturer: ArborHost.com Consulting
[ 3762.964660] usb 1-1: device v04d8 p000a is not supported
[ 3762.964843] usb 1-1: uevent
[ 3762.965301] usb 1-1: configuration #1 chosen from 1 choice
[ 3762.965515] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
[ 3762.965667] usb 1-1:1.0: uevent
[ 3762.966003] usbtest 1-1:1.0: usb_probe_interface
[ 3762.966033] usbtest 1-1:1.0: usb_probe_interface - got id
[ 3762.966400] usb 1-1: adding 1-1:1.1 (config #1, interface 1)
[ 3762.966552] usb 1-1:1.1: uevent
[ 3762.966857] usbtest 1-1:1.1: usb_probe_interface
[ 3762.966918] usbtest 1-1:1.1: usb_probe_interface - got id
[ 3762.967529] drivers/usb/core/inode.c: creating file '019'
[ 3762.967620] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 3762.967681] hub 1-0:1.0: port 1 enable change, status 00000103

Thanks.

-Robert Vogt IV
Caflor Industries


Quoting Tony Lindgren <tony@atomide.com>:

> Hi,
>
> * Robert Schuster <theBohemian@gmx.net> [070629 09:41]:
>> Hi,
>> I am using the patches available from
>> http://www.muru.com/linux/n800-usb-host/
>>
>> to enable the USB Host mode capability of the N800 device
>>
>> .. and have some questions:
>>
>> I connected an external powered USB Hub to it and tried a few devices.
>>
>> a)
>> First of all: It works fine and I can for instance transmit big amount
>> of data through a USB ethernet device (using the pegasus.ko driver).
>> However it does not seem to like plugging devices of. Because after
>> doing so (in case of the ethernet device I did ifconfig eth0 down first)
>> the host will not accept the device anymore. It also seems to have
>> trouble communicating to the hub at all.
>
> Thanks for the info. Sounds like some of the issues have been
> fixed already.
>
>> b)
>> The host did not accept an USB keyboard of mine which has two built-in
>> USB 1.1 ports (the real HUB is an USB 2.0 one).
>
> Turns out it's because the babble interrupts are fatal for HS
> devices, but must be ignored for LS/FS devices... This is already fixed
> in the linux-omap git tree.
>
>> Has any development happened on the USB Hostdriver for the N800 after
>> the release of the above mentioned patches?
>
> Yes, but the changes have been only in the linux-omap git tree. I've
> just refreshed the N800 usb host patches [1] to be in sync with linux-omap
> tree. Can you please see if these work better for you?
>
>> Is there any interest to debug the problems a) and b) further? If so,
>> what info should I provide?
>
> Yes, musb chips are integrated in 2430 and 3430, and tusb uses this chip
> too. So development is going on, please post any patches you may have
> to this mailing list :)
>
> For the information to provide, knowing what kind of devices don't
> work after updating to the latest series of patches would be nice.
>
> Regards,
>
> Tony
>
> [1] http://www.muru.com/linux/n800-usb-host/
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>

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

* Re: Nokia N800 - USB Host mode issues
  2007-07-03  9:26 ` Tony Lindgren
  2007-07-04  0:20   ` robert.vogt
@ 2007-07-04 12:52   ` Robert Schuster
  2007-07-11 11:14     ` Tony Lindgren
  1 sibling, 1 reply; 7+ messages in thread
From: Robert Schuster @ 2007-07-04 12:52 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap-open-source

@Tony: Sorry have to send this again. The list does not like signed mails ..

Hi Tony,
thanks preparing the 2.6.18 backport. I tried those patches and it works
better generally. Throughput seems to be a bit higher now (tested with a
USB Ethernet adapter) and device removal/attachment is solid.

Still I have some problems but I probably need to tell you how I have
modified my N800. The boot process of the N770s detected whether they
should set the USB chip to host or client via a configuration variable
and loaded a bunch of drivers (usbnet, usbserial, pl2303, asix, usbhid
...). What I basically did is porting this behavior to the N800's
linuxrc. So pegasus et al gets loaded when USB host mode is requested
furthermore the musb driver is properly initialized (cat 'host' >
/sys/.../mode).

All connections as host are made with a Mini-B to A cable at whose end a
 type A gender changer is connected. I use the same cable without the
gender changer for connections made as client.

So here comes the problems:
1) USB Hostmode is not activated when there was no client-connection
first. That means I have to power on the N800 with the cable connected
to a host. When the OS' desktop is visible I disconnect the cable and
can connect it to the host side of a hub. Everything works fine.

Here is how the contents of 'mode' and 'cable' behave during those
activities:

 - N800 boots, echo "host" > ... happens, cable is connected to a host
 mode: a_wait_bcon
 cable: Mini-B

 - cable is unplugged:
 mode: a_wait_bcon
 cable: Mini-A

 - cable is plugged to a hub (as host, of course)
 mode: a_host
 cable: Mini-A

(the following is just for testing purposes)
 - cable is unplugged:
 mode: a_wait_bcon
 cable: Mini-A

 - cable is connected to a host
 mode: a_wait_bcon
 cable: Mini-A

So cable does not change back to Mini-B. My guess is that there is some
event missing in the driver's state machine that lets it switch to a
'wait for a connection with cable type Mini-A' state.

2) Attaching a USB Keyboard which has two USB 1.1 ports built-in fails.
First case is that I try to connect it directly (without a hub in
between). dmesg gives this:

[  647.438598] usb 1-1: new full speed USB device using musb_hdrc and
address 8
[  647.587036] usb 1-1: ep0 maxpacket = 8
[  647.587829] usb 1-1: default language 0x0409
[  647.588317] usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=0
[  647.588348] usb 1-1: Product: USB Keyboard + 2P Hub
[  647.588592] usb 1-1: uevent
[  647.589050] usb 1-1: configuration #1 chosen from 1 choice
[  647.589508] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
[  647.589660] usb 1-1:1.0: uevent
[  647.589813] hub 1-1:1.0: usb_probe_interface
[  647.589843] hub 1-1:1.0: usb_probe_interface - got id
[  647.589874] hub 1-1:1.0: USB hub found
[  647.590118] hub 1-1:1.0: 3 ports detected
[  647.590179] hub 1-1:1.0: compound device; port removable status: FRR
[  647.590209] hub 1-1:1.0: individual port power switching
[  647.590240] hub 1-1:1.0: individual port over-current protection
[  647.590270] hub 1-1:1.0: power on to power good time: 44ms
[  647.590454] hub 1-1:1.0: hub controller current requirement: 100mA
[  647.590484] hub 1-1:1.0: 100mA bus power budget for each child
[  647.590637] hub 1-1:1.0: enabling power on all ports
[  647.591613] musb_stage0_irq 537: VBUS_ERROR in a_host (91,
<VBusValid), retry  #1, port1 00020103
[  647.786224] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
[  652.696411] usb 1-1: khubd timed out on ep0in len=0/255

After the timeout the driver tries it over and over again.

If I connect the keyboard through a USB 2.0 hub it shows:

[  252.340789] usb 1-1.1.1: new full speed USB device using musb_hdrc
and address 7
[  252.426483] usb 1-1.1.1: device descriptor read/64, error -71
[  252.621673] usb 1-1.1.1: device descriptor read/64, error -71
[  252.817535] usb 1-1.1.1: new full speed USB device using musb_hdrc
and address 8
[  252.903167] usb 1-1.1.1: device descriptor read/64, error -71
[  253.098937] usb 1-1.1.1: device descriptor read/64, error -71
[  253.294067] usb 1-1.1.1: new full speed USB device using musb_hdrc
and address 9
[  253.715484] usb 1-1.1.1: device not accepting address 9, error -71
[  253.801910] usb 1-1.1.1: new full speed USB device using musb_hdrc
and address 10
[  254.223297] usb 1-1.1.1: device not accepting address 10, error -71
[  254.223968] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0002

After that:

[  267.701049] musb_stage0_irq 621: BUS RESET
[  267.701110] musb_stage2_irq 695: DISCONNECT (a_peripheral) as
Peripheral, devctl 19

... (all devices disconnecting) ...

[  267.854461] musb_stage0_irq 537: VBUS_ERROR in a_wait_vfall (98,
VALID), retry #0, port1 00000100
[  267.854522] tusb_source_power 544: VBUS b_idle, devctl 98 otg 171
conf c0000001 prcm 00a80500

After that I cannot get the driver to enter "a_host" again: Switching to
"peripheral" and connecting as client is ok. But if I try "host" cable
will show "disconnected" when it is really disconnected but also when it
is plugged into the hub (mode contains "a_wait_bcon" all the time).

This was a lot of text. I will try to understand the behavior from the
sources but I hope that someone with better knowledge about the driver
may get a clue faster.

Regards
Robert


Tony Lindgren schrieb:
> Hi,
> 
> * Robert Schuster <theBohemian@gmx.net> [070629 09:41]:
>> Hi,
>> I am using the patches available from
>> http://www.muru.com/linux/n800-usb-host/
>>
>> to enable the USB Host mode capability of the N800 device
>>
>> .. and have some questions:
>>
>> I connected an external powered USB Hub to it and tried a few devices.
>>
>> a)
>> First of all: It works fine and I can for instance transmit big amount
>> of data through a USB ethernet device (using the pegasus.ko driver).
>> However it does not seem to like plugging devices of. Because after
>> doing so (in case of the ethernet device I did ifconfig eth0 down first)
>> the host will not accept the device anymore. It also seems to have
>> trouble communicating to the hub at all.
> 
> Thanks for the info. Sounds like some of the issues have been
> fixed already.
> 
>> b)
>> The host did not accept an USB keyboard of mine which has two built-in
>> USB 1.1 ports (the real HUB is an USB 2.0 one).
> 
> Turns out it's because the babble interrupts are fatal for HS
> devices, but must be ignored for LS/FS devices... This is already fixed
> in the linux-omap git tree.
> 
>> Has any development happened on the USB Hostdriver for the N800 after
>> the release of the above mentioned patches?
> 
> Yes, but the changes have been only in the linux-omap git tree. I've
> just refreshed the N800 usb host patches [1] to be in sync with linux-omap
> tree. Can you please see if these work better for you?
> 
>> Is there any interest to debug the problems a) and b) further? If so,
>> what info should I provide?
> 
> Yes, musb chips are integrated in 2430 and 3430, and tusb uses this chip
> too. So development is going on, please post any patches you may have
> to this mailing list :)
> 
> For the information to provide, knowing what kind of devices don't
> work after updating to the latest series of patches would be nice.
> 
> Regards,
> 
> Tony
> 
> [1] http://www.muru.com/linux/n800-usb-host/
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
> 

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

* Re: Nokia N800 - USB Host mode issues
  2007-07-04  0:20   ` robert.vogt
@ 2007-07-11 11:03     ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2007-07-11 11:03 UTC (permalink / raw)
  To: robert.vogt; +Cc: linux-omap-open-source

* robert.vogt@caflor.net <robert.vogt@caflor.net> [070708 15:10]:
> Hi Tony,
>
> The new patches seem to be working much better for me.  Now when I enter 
> host
> mode, I get 5V out consistently, and it is at least able to see (and 
> power!)
> the device.  I am not sure how to load the usb-serial driver, however (do I
> need to unload the gadget driver?), as it should be compiled-in to the
> kernel... (or do I need to add the device to the appropriate device 
> driver's
> support table?)

Nice to hear it's working better now :) You can keep g_file_storage
loaded while using it in host mode with serial driver. But if you want
to use g_serial, you must unload g_file_storage.

> Here is what I'm seeing as I plug in the device...
>
> Nokia-N800-10:/proc/driver# cat musb_hdrc
> Status: MHDRC, Mode=Host (Power=e0, DevCtl=19)
> OTG state: a_wait_bcon; inactive
> Options: tusb-omap-dma, otg (peripheral+host), debug=1 [eps=16]
> Peripheral address: c0
> Root port status: 00000100
> TUSB6010: devconf c0010001, phy enable 00800000 drive 0000000a
>        otg 174 timer 005b8d80
>        prcm conf 00000000 mgmt 00a80300; int src 0000a000 mask 00000008
> Gadget driver: g_file_storage
>
> ----- plug in USB-Serial Device -----
>
> Nokia-N800-10:/proc/driver# cat musb_hdrc
> Status: MHDRC, Mode=Host (Power=e0, DevCtl=5d)
> OTG state: a_host; active
> Options: tusb-omap-dma, otg (peripheral+host), debug=1 [eps=16]
> Peripheral address: c0
> Root port status: 00000101
> TUSB6010: devconf c0010001, phy enable 00800000 drive 0000000a
>        otg 171 timer 005b8d80
>        prcm conf 00010000 mgmt 00a80300; int src 00000000 mask 00000008
> Gadget driver: g_file_storage
>
> ----- Sometimes: ------
> Nokia-N800-10:/proc/driver# dmesg -c
> [ 2988.626434] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
> [ 2988.626525] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
> [ 2988.626617] hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
> [ 2988.782623] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms 
> status
> 0x101
> [ 2988.907653] usb 1-1: new full speed USB device using musb_hdrc and 
> address 8
> [ 2989.032623] usb 1-1: device descriptor read/64, error -71
> [ 2989.266998] usb 1-1: device descriptor read/64, error -71
> [ 2989.501373] usb 1-1: new full speed USB device using musb_hdrc and 
> address 9
> [ 2989.626373] usb 1-1: device descriptor read/64, error -71
> [ 2989.859588] usb 1-1: device descriptor read/64, error -71
> [ 2990.095153] usb 1-1: new full speed USB device using musb_hdrc and 
> address 10
> [ 2990.516967] usb 1-1: device not accepting address 10, error -71
> [ 2990.642028] usb 1-1: new full speed USB device using musb_hdrc and 
> address 11
> [ 2991.063934] usb 1-1: device not accepting address 11, error -71
> [ 2991.064056] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
> [ 2991.064117] hub 1-0:1.0: port 1 enable change, status 00000101
>
> ----- And sometimes: ------
> Nokia-N800-10:/proc/driver# dmesg -c
> [ 3760.898742] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
> [ 3760.898895] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
> [ 3760.899017] hub 1-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
> [ 3761.056060] hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms 
> status
> 0x101
> [ 3761.181121] usb 1-1: new full speed USB device using musb_hdrc and 
> address 16
> [ 3761.306060] usb 1-1: device descriptor read/64, error -71
> [ 3761.540466] usb 1-1: device descriptor read/64, error -71
> [ 3761.774841] usb 1-1: new full speed USB device using musb_hdrc and 
> address 17
> [ 3761.837341] musb_stage0_irq 615: BABBLE devctl: 5d
> [ 3761.899841] usb 1-1: device descriptor read/64, error -71
> [ 3762.142059] usb 1-1: device descriptor read/64, error -71
> [ 3762.384185] usb 1-1: new full speed USB device using musb_hdrc and 
> address 18
> [ 3762.806091] usb 1-1: device not accepting address 18, error -71
> [ 3762.929870] usb 1-1: new full speed USB device using musb_hdrc and 
> address 19
> [ 3762.953948] usb 1-1: ep0 maxpacket = 8
> [ 3762.959594] usb 1-1: skipped 4 descriptors after interface
> [ 3762.960327] usb 1-1: default language 0x0409
> [ 3762.964538] usb 1-1: new device strings: Mfr=1, Product=2, 
> SerialNumber=0
> [ 3762.964569] usb 1-1: Product: OBD-II Device Interface
> [ 3762.964599] usb 1-1: Manufacturer: ArborHost.com Consulting
> [ 3762.964660] usb 1-1: device v04d8 p000a is not supported
> [ 3762.964843] usb 1-1: uevent
> [ 3762.965301] usb 1-1: configuration #1 chosen from 1 choice
> [ 3762.965515] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
> [ 3762.965667] usb 1-1:1.0: uevent
> [ 3762.966003] usbtest 1-1:1.0: usb_probe_interface
> [ 3762.966033] usbtest 1-1:1.0: usb_probe_interface - got id
> [ 3762.966400] usb 1-1: adding 1-1:1.1 (config #1, interface 1)
> [ 3762.966552] usb 1-1:1.1: uevent
> [ 3762.966857] usbtest 1-1:1.1: usb_probe_interface
> [ 3762.966918] usbtest 1-1:1.1: usb_probe_interface - got id
> [ 3762.967529] drivers/usb/core/inode.c: creating file '019'
> [ 3762.967620] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
> [ 3762.967681] hub 1-0:1.0: port 1 enable change, status 00000103

Sounds like there is still some flakeyness detecting devices, but it
also seems your serial device needs to be added to the known devices
list if it works with some known driver.

Regards,

Tony

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

* Re: Nokia N800 - USB Host mode issues
  2007-07-04 12:52   ` Robert Schuster
@ 2007-07-11 11:14     ` Tony Lindgren
  2007-07-11 13:45       ` Felipe Balbi
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2007-07-11 11:14 UTC (permalink / raw)
  To: Robert Schuster; +Cc: linux-omap-open-source

* Robert Schuster <theBohemian@gmx.net> [070704 05:53]:
> @Tony: Sorry have to send this again. The list does not like signed mails ..
> 
> Hi Tony,
> thanks preparing the 2.6.18 backport. I tried those patches and it works
> better generally. Throughput seems to be a bit higher now (tested with a
> USB Ethernet adapter) and device removal/attachment is solid.
> 
> Still I have some problems but I probably need to tell you how I have
> modified my N800. The boot process of the N770s detected whether they
> should set the USB chip to host or client via a configuration variable
> and loaded a bunch of drivers (usbnet, usbserial, pl2303, asix, usbhid
> ...). What I basically did is porting this behavior to the N800's
> linuxrc. So pegasus et al gets loaded when USB host mode is requested
> furthermore the musb driver is properly initialized (cat 'host' >
> /sys/.../mode).
> 
> All connections as host are made with a Mini-B to A cable at whose end a
>  type A gender changer is connected. I use the same cable without the
> gender changer for connections made as client.

OK

> So here comes the problems:
> 1) USB Hostmode is not activated when there was no client-connection
> first. That means I have to power on the N800 with the cable connected
> to a host. When the OS' desktop is visible I disconnect the cable and
> can connect it to the host side of a hub. Everything works fine.

Hmm, I'll take a look at that, but it won't happen until in August.
Could this be if you don't have any  driver loaded? I believe
currently the driver needs a gadget or host driver loaded in order
to be active.

> Here is how the contents of 'mode' and 'cable' behave during those
> activities:
> 
>  - N800 boots, echo "host" > ... happens, cable is connected to a host
>  mode: a_wait_bcon
>  cable: Mini-B
> 
>  - cable is unplugged:
>  mode: a_wait_bcon
>  cable: Mini-A
> 
>  - cable is plugged to a hub (as host, of course)
>  mode: a_host
>  cable: Mini-A
> 
> (the following is just for testing purposes)
>  - cable is unplugged:
>  mode: a_wait_bcon
>  cable: Mini-A
> 
>  - cable is connected to a host
>  mode: a_wait_bcon
>  cable: Mini-A
> 
> So cable does not change back to Mini-B. My guess is that there is some
> event missing in the driver's state machine that lets it switch to a
> 'wait for a connection with cable type Mini-A' state.

OK, sounds like there is something wrong with the status detection
still.

> 2) Attaching a USB Keyboard which has two USB 1.1 ports built-in fails.
> First case is that I try to connect it directly (without a hub in
> between). dmesg gives this:
> 
> [  647.438598] usb 1-1: new full speed USB device using musb_hdrc and
> address 8
> [  647.587036] usb 1-1: ep0 maxpacket = 8
> [  647.587829] usb 1-1: default language 0x0409
> [  647.588317] usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=0
> [  647.588348] usb 1-1: Product: USB Keyboard + 2P Hub
> [  647.588592] usb 1-1: uevent
> [  647.589050] usb 1-1: configuration #1 chosen from 1 choice
> [  647.589508] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
> [  647.589660] usb 1-1:1.0: uevent
> [  647.589813] hub 1-1:1.0: usb_probe_interface
> [  647.589843] hub 1-1:1.0: usb_probe_interface - got id
> [  647.589874] hub 1-1:1.0: USB hub found
> [  647.590118] hub 1-1:1.0: 3 ports detected
> [  647.590179] hub 1-1:1.0: compound device; port removable status: FRR
> [  647.590209] hub 1-1:1.0: individual port power switching
> [  647.590240] hub 1-1:1.0: individual port over-current protection
> [  647.590270] hub 1-1:1.0: power on to power good time: 44ms
> [  647.590454] hub 1-1:1.0: hub controller current requirement: 100mA
> [  647.590484] hub 1-1:1.0: 100mA bus power budget for each child
> [  647.590637] hub 1-1:1.0: enabling power on all ports
> [  647.591613] musb_stage0_irq 537: VBUS_ERROR in a_host (91,
> <VBusValid), retry  #1, port1 00020103
> [  647.786224] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
> [  652.696411] usb 1-1: khubd timed out on ep0in len=0/255
> 
> After the timeout the driver tries it over and over again.
> 
> If I connect the keyboard through a USB 2.0 hub it shows:
> 
> [  252.340789] usb 1-1.1.1: new full speed USB device using musb_hdrc
> and address 7
> [  252.426483] usb 1-1.1.1: device descriptor read/64, error -71
> [  252.621673] usb 1-1.1.1: device descriptor read/64, error -71
> [  252.817535] usb 1-1.1.1: new full speed USB device using musb_hdrc
> and address 8
> [  252.903167] usb 1-1.1.1: device descriptor read/64, error -71
> [  253.098937] usb 1-1.1.1: device descriptor read/64, error -71
> [  253.294067] usb 1-1.1.1: new full speed USB device using musb_hdrc
> and address 9
> [  253.715484] usb 1-1.1.1: device not accepting address 9, error -71
> [  253.801910] usb 1-1.1.1: new full speed USB device using musb_hdrc
> and address 10
> [  254.223297] usb 1-1.1.1: device not accepting address 10, error -71
> [  254.223968] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0002
> 
> After that:
> 
> [  267.701049] musb_stage0_irq 621: BUS RESET
> [  267.701110] musb_stage2_irq 695: DISCONNECT (a_peripheral) as
> Peripheral, devctl 19
> 
> ... (all devices disconnecting) ...
> 
> [  267.854461] musb_stage0_irq 537: VBUS_ERROR in a_wait_vfall (98,
> VALID), retry #0, port1 00000100
> [  267.854522] tusb_source_power 544: VBUS b_idle, devctl 98 otg 171
> conf c0000001 prcm 00a80500
> 
> After that I cannot get the driver to enter "a_host" again: Switching to
> "peripheral" and connecting as client is ok. But if I try "host" cable
> will show "disconnected" when it is really disconnected but also when it
> is plugged into the hub (mode contains "a_wait_bcon" all the time).

This is because the keyboard and hubs eat up more than the 100mA N800
can provide. I assume it works through a powered hub?

But still there's a problem if after the VBUS_ERROR it is unable to
detect other devices.

> This was a lot of text. I will try to understand the behavior from the
> sources but I hope that someone with better knowledge about the driver
> may get a clue faster.

Thanks for the information, it helps track down remaining issues. BTW,
my response time may be long right now as I'm mostly on vacation :)

Tony

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

* Re: Nokia N800 - USB Host mode issues
  2007-07-11 11:14     ` Tony Lindgren
@ 2007-07-11 13:45       ` Felipe Balbi
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2007-07-11 13:45 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Robert Schuster, linux-omap-open-source

On 7/11/07, Tony Lindgren <tony@atomide.com> wrote:
> * Robert Schuster <theBohemian@gmx.net> [070704 05:53]:
> > @Tony: Sorry have to send this again. The list does not like signed mails ..
> >
> > Hi Tony,
> > thanks preparing the 2.6.18 backport. I tried those patches and it works
> > better generally. Throughput seems to be a bit higher now (tested with a
> > USB Ethernet adapter) and device removal/attachment is solid.
> >
> > Still I have some problems but I probably need to tell you how I have
> > modified my N800. The boot process of the N770s detected whether they
> > should set the USB chip to host or client via a configuration variable
> > and loaded a bunch of drivers (usbnet, usbserial, pl2303, asix, usbhid
> > ...). What I basically did is porting this behavior to the N800's
> > linuxrc. So pegasus et al gets loaded when USB host mode is requested
> > furthermore the musb driver is properly initialized (cat 'host' >
> > /sys/.../mode).
> >
> > All connections as host are made with a Mini-B to A cable at whose end a
> >  type A gender changer is connected. I use the same cable without the
> > gender changer for connections made as client.
>
> OK
>
> > So here comes the problems:
> > 1) USB Hostmode is not activated when there was no client-connection
> > first. That means I have to power on the N800 with the cable connected
> > to a host. When the OS' desktop is visible I disconnect the cable and
> > can connect it to the host side of a hub. Everything works fine.
>
> Hmm, I'll take a look at that, but it won't happen until in August.
> Could this be if you don't have any  driver loaded? I believe
> currently the driver needs a gadget or host driver loaded in order
> to be active.

Weird here... I'm using recent omap gittree with n800 and it's quite
fine... I'll try to reproduce the bug and work a bit on that also ;-)

>
> > Here is how the contents of 'mode' and 'cable' behave during those
> > activities:
> >
> >  - N800 boots, echo "host" > ... happens, cable is connected to a host
> >  mode: a_wait_bcon
> >  cable: Mini-B
> >
> >  - cable is unplugged:
> >  mode: a_wait_bcon
> >  cable: Mini-A
> >
> >  - cable is plugged to a hub (as host, of course)
> >  mode: a_host
> >  cable: Mini-A
> >
> > (the following is just for testing purposes)
> >  - cable is unplugged:
> >  mode: a_wait_bcon
> >  cable: Mini-A
> >
> >  - cable is connected to a host
> >  mode: a_wait_bcon
> >  cable: Mini-A
> >
> > So cable does not change back to Mini-B. My guess is that there is some
> > event missing in the driver's state machine that lets it switch to a
> > 'wait for a connection with cable type Mini-A' state.
>
> OK, sounds like there is something wrong with the status detection
> still.

Maybe when we're forcing n800 to host mode by echo'ing sysfs entry is
causing the flakeyness... When I'm using correct mini-A cable, it's
working fine... but there's a problem that I couldn't solve:
When plugging mini-B cable... it sends me 3 cable events... when
unplugging it, just 1.

When plugging mini-A cable it sends me on cable event... and when
unplugging it, 3 events...

This is a bit weird and I couldn't solve this yet.

>
> > 2) Attaching a USB Keyboard which has two USB 1.1 ports built-in fails.
> > First case is that I try to connect it directly (without a hub in
> > between). dmesg gives this:
> >
> > [  647.438598] usb 1-1: new full speed USB device using musb_hdrc and
> > address 8
> > [  647.587036] usb 1-1: ep0 maxpacket = 8
> > [  647.587829] usb 1-1: default language 0x0409
> > [  647.588317] usb 1-1: new device strings: Mfr=1, Product=2, SerialNumber=0
> > [  647.588348] usb 1-1: Product: USB Keyboard + 2P Hub
> > [  647.588592] usb 1-1: uevent
> > [  647.589050] usb 1-1: configuration #1 chosen from 1 choice
> > [  647.589508] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
> > [  647.589660] usb 1-1:1.0: uevent
> > [  647.589813] hub 1-1:1.0: usb_probe_interface
> > [  647.589843] hub 1-1:1.0: usb_probe_interface - got id
> > [  647.589874] hub 1-1:1.0: USB hub found
> > [  647.590118] hub 1-1:1.0: 3 ports detected
> > [  647.590179] hub 1-1:1.0: compound device; port removable status: FRR
> > [  647.590209] hub 1-1:1.0: individual port power switching
> > [  647.590240] hub 1-1:1.0: individual port over-current protection
> > [  647.590270] hub 1-1:1.0: power on to power good time: 44ms
> > [  647.590454] hub 1-1:1.0: hub controller current requirement: 100mA
> > [  647.590484] hub 1-1:1.0: 100mA bus power budget for each child
> > [  647.590637] hub 1-1:1.0: enabling power on all ports
> > [  647.591613] musb_stage0_irq 537: VBUS_ERROR in a_host (91,
> > <VBusValid), retry  #1, port1 00020103
> > [  647.786224] musb_stage0_irq 598: CONNECT (a_host) devctl 5d
> > [  652.696411] usb 1-1: khubd timed out on ep0in len=0/255
> >
> > After the timeout the driver tries it over and over again.
> >
> > If I connect the keyboard through a USB 2.0 hub it shows:
> >
> > [  252.340789] usb 1-1.1.1: new full speed USB device using musb_hdrc
> > and address 7
> > [  252.426483] usb 1-1.1.1: device descriptor read/64, error -71
> > [  252.621673] usb 1-1.1.1: device descriptor read/64, error -71
> > [  252.817535] usb 1-1.1.1: new full speed USB device using musb_hdrc
> > and address 8
> > [  252.903167] usb 1-1.1.1: device descriptor read/64, error -71
> > [  253.098937] usb 1-1.1.1: device descriptor read/64, error -71
> > [  253.294067] usb 1-1.1.1: new full speed USB device using musb_hdrc
> > and address 9
> > [  253.715484] usb 1-1.1.1: device not accepting address 9, error -71
> > [  253.801910] usb 1-1.1.1: new full speed USB device using musb_hdrc
> > and address 10
> > [  254.223297] usb 1-1.1.1: device not accepting address 10, error -71
> > [  254.223968] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0002
> >
> > After that:
> >
> > [  267.701049] musb_stage0_irq 621: BUS RESET
> > [  267.701110] musb_stage2_irq 695: DISCONNECT (a_peripheral) as
> > Peripheral, devctl 19
> >
> > ... (all devices disconnecting) ...
> >
> > [  267.854461] musb_stage0_irq 537: VBUS_ERROR in a_wait_vfall (98,
> > VALID), retry #0, port1 00000100
> > [  267.854522] tusb_source_power 544: VBUS b_idle, devctl 98 otg 171
> > conf c0000001 prcm 00a80500
> >
> > After that I cannot get the driver to enter "a_host" again: Switching to
> > "peripheral" and connecting as client is ok. But if I try "host" cable
> > will show "disconnected" when it is really disconnected but also when it
> > is plugged into the hub (mode contains "a_wait_bcon" all the time).
>
> This is because the keyboard and hubs eat up more than the 100mA N800
> can provide. I assume it works through a powered hub?
>
> But still there's a problem if after the VBUS_ERROR it is unable to
> detect other devices.

Maybe that BABBLE weirdness here, tony??

>
> > This was a lot of text. I will try to understand the behavior from the
> > sources but I hope that someone with better knowledge about the driver
> > may get a clue faster.
>
> Thanks for the information, it helps track down remaining issues. BTW,
> my response time may be long right now as I'm mostly on vacation :)
>
> Tony
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>


-- 
Best Regards,

Felipe Balbi
felipebalbi@users.sourceforge.net

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

end of thread, other threads:[~2007-07-11 13:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-29 16:39 Nokia N800 - USB Host mode issues Robert Schuster
2007-07-03  9:26 ` Tony Lindgren
2007-07-04  0:20   ` robert.vogt
2007-07-11 11:03     ` Tony Lindgren
2007-07-04 12:52   ` Robert Schuster
2007-07-11 11:14     ` Tony Lindgren
2007-07-11 13:45       ` Felipe Balbi

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