I'm polling for changes in USB devices; when something changes, I grab the
contents of idVendor, idProduct, serial, product and manufacturer.  (The
serial is used to make a best effort at detecting when a previously-known
device was inserted; though I'm seeing that many devices don't have unique
serials or anything close--best effort will have to do, I guess.)

This occasionally causes a timeout with some USB pen drives.

Running

  while true; do cat 
/sys/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2.1/serial; done

and inserting an Attache stick with ub loaded will display the serial
about five to seven times and then hang.  usb-storage spams the serial
during the "waiting for device to settle" delay, and then similarly
hangs (logs attached).

2.6.10 and 2.6.11-rc4-bk8.

(re: "over 100mA budget", taking the device off of the bus-powered hub
does the same thing.)

-- 
Glenn Maynard
<7>hub 2-2:1.0: state 5 ports 4 chg 0000 evt 0002
<7>hub 2-2:1.0: port 1, status 0101, change 0001, 12 Mb/s
<7>hub 2-2:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
<6>usb 2-2.1: new full speed USB device using uhci_hcd and address 6
<7>usb 2-2.1: new device strings: Mfr=1, Product=2, SerialNumber=3
<7>usb 2-2.1: default language 0x0409
<6>usb 2-2.1: Product: USB DISK 12X
<6>usb 2-2.1: Manufacturer:
<6>usb 2-2.1: SerialNumber: 07410E1A052F
<7>usb 2-2.1: hotplug
<7>usb 2-2.1: adding 2-2.1:1.0 (config #1, interface 0)
<7>usb 2-2.1:1.0: hotplug
<7>usb-storage 2-2.1:1.0: usb_probe_interface
<7>usb-storage 2-2.1:1.0: usb_probe_interface - got id
<6>scsi1 : SCSI emulation for USB Mass Storage devices
<4>usb 2-2.1: 100mA over 100mA budget!
<7>hub 2-2:1.0: 200mA power budget left
<7>hub 2-2:1.0: state 5 ports 4 chg 0000 evt 0002
<7>usb-storage: device found at 6
<7>usb-storage: waiting for device to settle before scanning
<5>  Vendor:           Model: USB DISK 12X      Rev: 1.07
<5>  Type:   Direct-Access                      ANSI SCSI revision: 00
<5>SCSI device sda: 243712 512-byte hdwr sectors (125 MB)
<5>sda: assuming Write Enabled
<3>sda: assuming drive cache: write through
<5>SCSI device sda: 243712 512-byte hdwr sectors (125 MB)
<5>sda: assuming Write Enabled
<3>sda: assuming drive cache: write through
<6> sda:<4>usb 2-2.1: cat timed out on ep0in
<4>usb 2-2.1: cat timed out on ep0in
<7>hub 2-2:1.0: state 5 ports 4 chg 0000 evt 0002
<7>hub 2-2:1.0: port 1, status 0101, change 0001, 12 Mb/s
<7>hub 2-2:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
<6>usb 2-2.1: new full speed USB device using uhci_hcd and address 4
<7>usb 2-2.1: new device strings: Mfr=1, Product=2, SerialNumber=3
<7>usb 2-2.1: default language 0x0409
<6>usb 2-2.1: Product: USB DISK 12X
<6>usb 2-2.1: Manufacturer:
<6>usb 2-2.1: SerialNumber: 07410E1A052F
<7>usb 2-2.1: hotplug
<7>usb 2-2.1: adding 2-2.1:1.0 (config #1, interface 0)
<7>usb 2-2.1:1.0: hotplug
<7>ub 2-2.1:1.0: usb_probe_interface
<7>ub 2-2.1:1.0: usb_probe_interface - got id
<6>uba: device 4 capacity nsec 243712 bsize 512
<6>uba: device 4 capacity nsec 243712 bsize 512
<6> uba:end_request: I/O error, dev uba, sector 0
<3>Buffer I/O error on device uba, logical block 0
<4>usb 2-2.1: cat timed out on ep0in
<4>usb 2-2.1: cat timed out on ep0in
<4>end_request: I/O error, dev uba, sector 0
<3>Buffer I/O error on device uba, logical block 0
<4> unable to read partition table
<4>usb 2-2.1: 100mA over 100mA budget!
<7>hub 2-2:1.0: 200mA power budget left
<7>hub 2-2:1.0: state 5 ports 4 chg 0000 evt 0002
<4>usb 2-2.1: cat timed out on ep0in
<4>usb 2-2.1: cat timed out on ep0in
Bus 004 Device 001: ID 0000:0000 Virtual Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0000 Virtual
  idProduct          0x0000 Hub
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.11-rc4-bk8 uhci_hcd
  iProduct                2 Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #4
  iSerial                 1 0000:00:1d.3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)

Bus 003 Device 001: ID 0000:0000 Virtual Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0000 Virtual
  idProduct          0x0000 Hub
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.11-rc4-bk8 uhci_hcd
  iProduct                2 Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #3
  iSerial                 1 0000:00:1d.2
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)

Bus 002 Device 020: ID 0d7d:1400 Apacer 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 Interface
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0d7d Apacer
  idProduct          0x1400 
  bcdDevice            0.02
  iManufacturer           1         
  iProduct                2 USB DISK 12X    
  iSerial                 3 07410E1A052F
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               none
        wMaxPacketSize         64
        bInterval               0
  Language IDs: (length=4)
     0409 English(US)

Bus 002 Device 001: ID 0000:0000 Virtual Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0000 Virtual
  idProduct          0x0000 Hub
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.11-rc4-bk8 uhci_hcd
  iProduct                2 Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #2
  iSerial                 1 0000:00:1d.1
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)

Bus 001 Device 001: ID 0000:0000 Virtual Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0000 Virtual
  idProduct          0x0000 Hub
  bcdDevice            2.06
  iManufacturer           3 Linux 2.6.11-rc4-bk8 uhci_hcd
  iProduct                2 Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #1
  iSerial                 1 0000:00:1d.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               none
        wMaxPacketSize          2
        bInterval             255
  Language IDs: (length=4)
     0409 English(US)

Reply via email to