Re: Unstable ehci(-platform) when using root hub (hw lockup after port reset problem?)

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

 



On 16 April 2016 at 17:13, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 15 Apr 2016, Rafał Miłecki wrote:
>
>> > What happens if you plug a USB-1.1 device (such as a mouse or keyboard)
>> > into your single-port system?
>>
>> Now, this is pretty interesting. So first of all I'm not using
>> CONFIG_USB_OHCI_HCD_PLATFORM.
>
> Is that because you simply haven't enabled it, or because you don't
> have any OHCI hardware on your platform?

I just didn't have it enabled. There is OHCI hardware available. Since
you mentioned it ofc I decided to give it a try. As I expected I got 2
root hubs visible this time:
1d6b:0002 Linux Foundation 2.0 root hub
1d6b:0001 Linux Foundation 1.1 root hub

First of all, with ohci-platform I can plug in USB 1.1 device, see it,
unplug it and continue using port. It's a great difference compared to
the previous report of USB port not being usable anymore (after
plugging USB 1.1 device).

Now, there is more interesting stuff. With ohci-platform enabled
triggering "port 1 full speed --> companion" (by plugging device very
slowly) doesn't mean USB becoming unusable anymore. I can see may more
ohci and ehci messages until (as it seems to me) both controllers give
up. Please take a look at attached ehci-ohci-success-1.txt.

So there is my theory:
1) Connecting USB 1.1 device without ohci-platform installed causes
some port lockup.
2) Connecting USB 2.0 very slowly seems to trigger some transmission
error and makes OHCI hardware trying to handle this device.
What I was experiencing so far was a mix of both above. I was
connecting USB 2.0 device slowly (triggering some error) and I got
OHCI hardware trying to handle it. I didn't have ohci-platform
installed and it resulted in port lockup.

Does it make any sense?

I'm also wondering if there is any way to avoid port lockups caused by
connecting USB 1.1 device without ohci-platform installed?


>>  After the first time I connect USB 1.1
>> device I see the same problem. This device doesn't get detected (due
>> to the missing "ohci-platform" driver I guess) and afterwards I can't
>> use my USB port anymore. Even connecting back some USB 2.0 device
>> won't get me any kernel event/message.
>>
>> It looks using USB 1.1 device is another (easier?) way of triggering
>> the same problem. At least from the early check it looks similar.
>>
>> You may take a look at attached mix-fail-1.txt.
>>
>>
>> > Does your platform data have the has_tt flag set or the
>> > "has-transaction-translator" OF property?
>>
>> I just checked bcma-hcd.c and it doesn't:
>> static const struct usb_ehci_pdata ehci_pdata = {
>> };
>>
>> However since you already asked, I decided to give it a try. I enabled
>> it but it resulted in USB port not being usable at all. Connecting any
>> USB 2.0 device give me 6 seconds of XactErr-s. If you take a look at
>> my previous e-mail, you'll see I already mentioned such error when
>> "plugging and unplugging USB device quickly (over and over)". Not sure
>> if it's related, just errors look the same.
>
> I get the impression that this behavior is intended, and your board was
> never meant to be used without an external hub.  Or possibly with some
> other permanently attached USB-2 device.  Either way, none of these
> problems would occur, right?

This sounds pretty unexpected. I can't imagine vendor telling users to
don't hot-plug USB device in the user manual.

I also tried installing original firmware on my Netgear R6250 (it's
based on 2.6.36.4) and after few tries I managed to get some errors,
but after all I never got port lockup. Sounds like a similar case to
what I'm seeing with OpenWrt (some recent kernel) and both:
ehci-platform and ohci-platform.

usb 1-1: new high speed USB device using ehci_hcd and address 28
usb 1-1: USB disconnect, address 28
usb 1-1: new high speed USB device using ehci_hcd and address 29
usb 1-1: USB disconnect, address 29
usb 2-1: new full speed USB device using ohci_hcd and address 6
usb 2-1: not running at top speed; connect to a high speed hub
usb 2-1: USB disconnect, address 6
usb 1-1: new high speed USB device using ehci_hcd and address 32
usb 1-1: USB disconnect, address 32
usb 2-1: new full speed USB device using ohci_hcd and address 7
usb 2-1: device descriptor read/64, error -62
usb 2-1: device descriptor read/64, error -62
usb 2-1: new full speed USB device using ohci_hcd and address 8
usb 2-1: device descriptor read/64, error -62
usb 2-1: device descriptor read/64, error -62
usb 2-1: new full speed USB device using ohci_hcd and address 9
usb 2-1: device not accepting address 9, error -62
usb 2-1: new full speed USB device using ohci_hcd and address 10
usb 2-1: device not accepting address 10, error -62
hub 2-0:1.0: unable to enumerate USB device on port 1
usb 1-1: new high speed USB device using ehci_hcd and address 34
usb 1-1: USB disconnect, address 34
usb 1-1: new high speed USB device using ehci_hcd and address 35
usb 1-1: USB disconnect, address 35

-- 
Rafał
[ 1241.301553] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1241.307048] ehci-platform ehci-platform.0: GetStatus port:1 status 001803 0  ACK POWER sig=j CSC CONNECT
[ 1241.316580] usb usb1-port1: status 0501, change 0001, 480 Mb/s
[ 1241.480829] usb usb1-port1: debounce total 100ms stable 100ms status 0x501
[ 1241.487691] [hub_port_connect -> __hub_port_init]
[ 1241.492409] [__hub_port_init -> __hub_port_reset]
[ 1241.551014] ehci-platform ehci-platform.0: port 1 reset complete, port enabled
[ 1241.558214] ehci-platform ehci-platform.0: GetStatus port:1 status 001005 0  ACK POWER sig=se0 PE CONNECT
[ 1241.620802] usb 1-1: new high-speed USB device number 26 using ehci-platform
[ 1241.628295] [__hub_port_init -> __hub_port_reset]
[ 1241.691012] ehci-platform ehci-platform.0: port 1 reset complete, port enabled
[ 1241.698216] ehci-platform ehci-platform.0: GetStatus port:1 status 001805 0  ACK POWER sig=j PE CONNECT
[ 1241.792784] usb 1-1: default language 0x0409
[ 1241.798530] usb 1-1: udev 26, busnum 1, minor = 25
[ 1241.803712] usb 1-1: usb_probe_device
[ 1241.807373] usb 1-1: configuration #1 chosen from 1 choice
[ 1241.813181] usb 1-1: adding 1-1:1.0 (config #1, interface 0)

[ 1243.625447] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1243.630965] ehci-platform ehci-platform.0: GetStatus port:1 status 001002 0  ACK POWER sig=se0 CSC
[ 1243.639956] usb usb1-port1: status 0100, change 0001, 12 Mb/s
[ 1243.645713] usb 1-1: USB disconnect, device number 26
[ 1243.650744] usb 1-1: unregistering device
[ 1243.654756] usb 1-1: unregistering interface 1-1:1.0
[ 1243.659975] usb 1-1: usb_disable_device nuking all URBs
[ 1243.820819] usb usb1-port1: debounce total 100ms stable 100ms status 0x100

[ 1246.512614] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1246.518109] ehci-platform ehci-platform.0: GetStatus port:1 status 001803 0  ACK POWER sig=j CSC CONNECT
[ 1246.527657] usb usb1-port1: status 0501, change 0001, 480 Mb/s
[ 1246.690814] usb usb1-port1: debounce total 100ms stable 100ms status 0x501
[ 1246.697678] [hub_port_connect -> __hub_port_init]
[ 1246.702385] [__hub_port_init -> __hub_port_reset]
[ 1246.761013] ehci-platform ehci-platform.0: port 1 reset complete, port enabled
[ 1246.768211] ehci-platform ehci-platform.0: GetStatus port:1 status 001005 0  ACK POWER sig=se0 PE CONNECT
[ 1246.830798] usb 1-1: new high-speed USB device number 27 using ehci-platform
[ 1246.838292] [__hub_port_init -> __hub_port_reset]
[ 1246.901011] ehci-platform ehci-platform.0: port 1 reset complete, port enabled
[ 1246.908213] ehci-platform ehci-platform.0: GetStatus port:1 status 001005 0  ACK POWER sig=se0 PE CONNECT
[ 1247.002782] usb 1-1: default language 0x0409
[ 1247.008406] usb 1-1: udev 27, busnum 1, minor = 26
[ 1247.013602] usb 1-1: usb_probe_device
[ 1247.017268] usb 1-1: configuration #1 chosen from 1 choice
[ 1247.023180] usb 1-1: adding 1-1:1.0 (config #1, interface 0)

[ 1248.019695] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1248.025233] ehci-platform ehci-platform.0: GetStatus port:1 status 001803 0  ACK POWER sig=j CSC CONNECT
[ 1248.034789] usb usb1-port1: status 0501, change 0001, 480 Mb/s
[ 1248.040604] usb 1-1: USB disconnect, device number 27
[ 1248.045657] usb 1-1: unregistering device
[ 1248.049653] usb 1-1: unregistering interface 1-1:1.0
[ 1248.054907] usb 1-1: usb_disable_device nuking all URBs
[ 1248.210820] usb usb1-port1: debounce total 100ms stable 100ms status 0x501
[ 1248.217687] [hub_port_connect -> __hub_port_init]
[ 1248.222403] [__hub_port_init -> __hub_port_reset]
[ 1248.280806] ehci-platform ehci-platform.0: port 1 full speed --> companion
[ 1248.287669] ehci-platform ehci-platform.0: GetStatus port:1 status 003801 0  ACK POWER OWNER sig=j CONNECT
[ 1248.297307] ohci-platform ohci-platform.0: rhsc
[ 1248.301901] hub 1-0:1.0: port_wait_reset: err = -16
[ 1248.306760] usb usb1-port1: not enabled, trying reset again...
[ 1248.312628] hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1248.318103] ohci-platform ohci-platform.0: GetStatus roothub.portstatus [0] = 0x00010101 CSC PPS CCS
[ 1248.327257] usb usb2-port1: status 0101, change 0001, 12 Mb/s
[ 1248.490815] usb usb2-port1: debounce total 100ms stable 100ms status 0x101
[ 1248.497669] [hub_port_connect -> __hub_port_init]
[ 1248.502371] [__hub_port_init -> __hub_port_reset]
[ 1248.507066] ohci-platform ohci-platform.0: rhsc
[ 1248.517956] ohci-platform ohci-platform.0: rhsc
[ 1248.522581] ehci-platform ehci-platform.0: GetStatus port:1 status 003002 0  ACK POWER OWNER sig=se0 CSC
[ 1248.532225] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1248.537706] ehci-platform ehci-platform.0: GetStatus port:1 status 003002 0  ACK POWER OWNER sig=se0 CSC
[ 1248.547213] usb usb1-port1: status 0100, change 0001, 12 Mb/s
[ 1248.630808] ohci-platform ohci-platform.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC PPS PES CCS
[ 1248.690798] usb 2-1: new full-speed USB device number 6 using ohci-platform
[ 1248.698385] ohci-platform ohci-platform.0: urb c69fc600 path 1 ep0in 5ec20000 cc 5 --> status -62
[ 1248.707223] ohci-platform ohci-platform.0: urb c69fc600 td c88190c0 (1) cc 5, len=0/64
[ 1248.716379] ohci-platform ohci-platform.0: urb c69fc600 path 1 ep0in 5ec20000 cc 5 --> status -62
[ 1248.725219] ohci-platform ohci-platform.0: urb c69fc600 td c8819000 (1) cc 5, len=0/64
[ 1248.733172] usb usb1-port1: debounce total 100ms stable 100ms status 0x100
[ 1248.740381] ohci-platform ohci-platform.0: urb c69fc600 path 1 ep0in 5ec20000 cc 5 --> status -62
[ 1248.749220] ohci-platform ohci-platform.0: urb c69fc600 td c88190c0 (1) cc 5, len=0/64
[ 1248.757143] [__hub_port_init -> __hub_port_reset]
[ 1248.880802] ohci-platform ohci-platform.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC PPS PES CCS
[ 1248.940794] usb 2-1: device descriptor read/64, error -62
[ 1249.051381] ohci-platform ohci-platform.0: urb c69fc600 path 1 ep0in 5ec20000 cc 5 --> status -62
[ 1249.060217] ohci-platform ohci-platform.0: urb c69fc600 td c8819000 (1) cc 5, len=0/64
[ 1249.069379] ohci-platform ohci-platform.0: urb c69fc600 path 1 ep0in 5ec20000 cc 5 --> status -62
[ 1249.078213] ohci-platform ohci-platform.0: urb c69fc600 td c88190c0 (1) cc 5, len=0/64
[ 1249.087378] ohci-platform ohci-platform.0: urb c69fc600 path 1 ep0in 5ec20000 cc 5 --> status -62
[ 1249.096210] ohci-platform ohci-platform.0: urb c69fc600 td c8819000 (1) cc 5, len=0/64
[ 1249.104134] [__hub_port_init -> __hub_port_reset]
[ 1249.108838] ohci-platform ohci-platform.0: rhsc
[ 1249.119005] ohci-platform ohci-platform.0: rhsc
[ 1249.220802] ohci-platform ohci-platform.0: GetStatus roothub.portstatus [0] = 0x00100103 PRSC PPS PES CCS
[ 1249.265621] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1249.271131] ehci-platform ehci-platform.0: GetStatus port:1 status 001002 0  ACK POWER sig=se0 CSC
[ 1249.280101] usb usb1-port1: status 0100, change 0001, 12 Mb/s
[ 1249.285857] usb 2-1: device descriptor read/64, error -62
[ 1249.400832] [hub_port_connect -> __hub_port_init]
[ 1249.405516] [__hub_port_init -> __hub_port_reset]
[ 1249.450820] usb usb1-port1: debounce total 100ms stable 100ms status 0x100
[ 1249.457676] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0000
[ 1249.463181] ohci-platform ohci-platform.0: GetStatus roothub.portstatus [0] = 0x00030100 PESC CSC PPS
[ 1249.472459] hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1249.477929] ohci-platform ohci-platform.0: GetStatus roothub.portstatus [0] = 0x00030100 PESC CSC PPS
[ 1249.487172] usb usb2-port1: status 0100, change 0003, 12 Mb/s
[ 1249.650811] usb usb2-port1: debounce total 100ms stable 100ms status 0x100

* I expected no more USB events / messages beyond this point. However USB port remained working correctly! *

[ 1330.363747] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
[ 1330.369251] ehci-platform ehci-platform.0: GetStatus port:1 status 001803 0  ACK POWER sig=j CSC CONNECT
[ 1330.378809] usb usb1-port1: status 0501, change 0001, 480 Mb/s
[ 1330.540848] usb usb1-port1: debounce total 100ms stable 100ms status 0x501
[ 1330.547713] [hub_port_connect -> __hub_port_init]
[ 1330.552425] [__hub_port_init -> __hub_port_reset]
[ 1330.611020] ehci-platform ehci-platform.0: port 1 reset complete, port enabled
[ 1330.618230] ehci-platform ehci-platform.0: GetStatus port:1 status 001005 0  ACK POWER sig=se0 PE CONNECT
[ 1330.680823] usb 1-1: new high-speed USB device number 29 using ehci-platform
[ 1330.688296] [__hub_port_init -> __hub_port_reset]
[ 1330.751012] ehci-platform ehci-platform.0: port 1 reset complete, port enabled
[ 1330.758213] ehci-platform ehci-platform.0: GetStatus port:1 status 001005 0  ACK POWER sig=se0 PE CONNECT
[ 1330.852784] usb 1-1: default language 0x0409
[ 1330.858279] usb 1-1: udev 29, busnum 1, minor = 28
[ 1330.863478] usb 1-1: usb_probe_device
[ 1330.867147] usb 1-1: configuration #1 chosen from 1 choice
[ 1330.873054] usb 1-1: adding 1-1:1.0 (config #1, interface 0)

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

  Powered by Linux