Re: khubd timed out on ep0in len=0/64 with 3.4 kernel

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

 



Hi

I tried resetting usb device when it gets ETIMEDOUT during get
descriptor. On second retry, I don't see timeout. Please see this
patch:

Index: linux-3.4/drivers/usb/core/hub.c
===================================================================
--- linux-3.4.orig/drivers/usb/core/hub.c
+++ linux-3.4/drivers/usb/core/hub.c
@@ -3213,6 +3213,14 @@ hub_port_init (struct usb_hub *hub, stru
  r = -EPROTO;
  break;
  }
+
+                                if (r == -ETIMEDOUT) {
+ r = usb_reset_device(hdev);
+ if (r) {
+ dev_dbg(&udev->dev, "failed to reset usb %d\n", r);
+ }
+ }
+
  if (r == 0)
  break;
  }


Here are debugs (sorry if they are too verbose) where it recovers from
timeout. At 6.632 is the first timeout and at 6.968 it was able to get
bMaxPacketSize0. I couldn't reproduce the issue with this patch.

[    1.632081] usb 1-3: new high speed USB device using ehci_hcd and address 2
[    6.632092] usb 1-3: khubd timed out on ep0in len=0/64 status -2
[    6.632110] usb 1-3: hub_port_init: iter 0 maxpktsize 0 r -110
[    6.736140] hub 1-0:1.0: port 3: status 0503 change 0000
[    6.736208] usb 1-3: hub_port_init reset usb ret -21
[    6.864079] usb 1-3: device descriptor read/64, error -71
[    6.968342] usb 1-3: hub_port_init: iter 0 maxpktsize 64 r 18
[    7.101325] usb 1-3: default language 0x0409
[    7.102201] usb 1-3: udev 2, busnum 1, minor = 1
[    7.102205] usb 1-3: New USB device found, idVendor=0e39, idProduct=2b00
[    7.102208] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    7.102212] usb 1-3: Product: eUSB
[    7.102214] usb 1-3: Manufacturer: SMART
[    7.102217] usb 1-3: SerialNumber: 3E3B2F01123531050102
[    7.102424] usb 1-3: configuration #1 chosen from 1 choice
[    7.102674] usb 1-3: adding 1-3:1.0 (config #1, interface 0)
[    7.460377] hub 1-0:1.0: state 7 ports 5 chg 0008 evt 0000
[    7.460429] hub 1-0:1.0: port 3, status 0503, change 0000, 480 Mb/s

thank you.

On Fri, Oct 25, 2013 at 7:38 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 25 Oct 2013, Prasad Koya wrote:
>
>> Resending in plain-text.
>>
>> On Thu, Oct 24, 2013 at 11:06 PM, Prasad Koya <prasad.koya@xxxxxxxxx> wrote:
>> > Hi
>> >
>> > I tried with even unmounting the USB before forcing panic and I see same
>> > time out while getting device descriptor.
>
> A better test would be to unbind usb-storage from the device
> beforehand.
>
> Anyway, if the device doesn't allow itself to be reset properly then
> the device is buggy.  You can test this easily enough by forcing a
> device reset by hand; see
>
>         http://marc.info/?l=linux-usb&m=126028634531290&w=2
>
>> > From debugs, I see that the portstatus is 0x501 to start with ie,
>> > (high-speed attached, power-on, device is attached). After reset I see
>> > wPortStatus and wPortChange bits as expected. However, get descriptor
>> > timesout with status as -ENOENT. If I ignore this error and set
>> > bMaxPacketSize0 to 64, it gets through the initialization but i see
>> > usb-storage driver doing a reset much later.
>> >
>> > Pl see the debugs:
>
> You have added so many new debugging messages, I can't tell what they
> mean.
>
> Alan Stern
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux