Re: Debugging bus resets

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

 



On Tue, 12 May 2009, Brad Schick wrote:

> I'm looking for suggestions to help debug bus resets without a protocol
> analyzer. I have two devices with the same hardware and firmware. One of
> them experiences repeated bus resets during enumeration, while the other
> does not. The debugfs usbmon output doesn't show bus resets explicitly,

It does if you look at the I/O for the device's parent hub as well as 
the I/O for the device itself.

> but I know they are happening from a device counter, and you can see the
> second enum process below repeats. First the good usbmon log:
> 
> f1b92900 2090659937 S Ci:1:000:0 s 80 06 0100 0000 0040 64 <
> f1b92900 2090661039 C Ci:1:000:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f1b92900 2090748930 S Co:1:000:0 s 00 05 003b 0000 0000 0            //
> set address
> f1b92900 2090749915 C Co:1:000:0 0 0
> f1b92900 2090766857 S Ci:1:059:0 s 80 06 0100 0000 0012 18 <
> f1b92900 2090768040 C Ci:1:059:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f1b92900 2090768054 S Ci:1:059:0 s 80 06 0600 0000 000a 10 <
> f1b92900 2090768165 C Ci:1:059:0 -32 0
> f1b92900 2090768176 S Ci:1:059:0 s 80 06 0600 0000 000a 10 <
> f1b92900 2090768915 C Ci:1:059:0 -32 0
> f1b92900 2090768926 S Ci:1:059:0 s 80 06 0600 0000 000a 10 <
> f1b92900 2090769915 C Ci:1:059:0 -32 0
> f1b92900 2090769927 S Ci:1:059:0 s 80 06 0200 0000 0009 9 <
> f1b92900 2090770917 C Ci:1:059:0 0 9 = 09021200 01010080 32
> f1b92900 2090770928 S Ci:1:059:0 s 80 06 0200 0000 0012 18 <
> f1b92900 2090771165 C Ci:1:059:0 0 18 = 09021200 01010080 32090400
> 00000000 0000
> f1b92900 2090771270 S Co:1:059:0 s 00 09 0001 0000 0000 0       // set
> config
> f1b92900 2090771414 C Co:1:059:0 0 0
> ---start of device specific stuff---
> f1b92b80 2105622160 S Co:1:059:0 s 20 05 0000 0000 0000 0
> f1b92b80 2106051927 C Co:1:059:0 0 0
> 
> Here is the other problem device:
> 
> f2c7ab00 471460277 S Ci:1:000:0 s 80 06 0100 0000 0040 64 <
> f2c7ab00 471461380 C Ci:1:000:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7ab00 471548287 S Co:1:000:0 s 00 05 0031 0000 0000 0           //
> set address
> f2c7ab00 471549258 C Co:1:000:0 0 0
> f2c7ab00 471567861 S Ci:1:049:0 s 80 06 0100 0000 0012 18 <
> f2c7ab00 471568385 C Ci:1:049:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7ab00 471568431 S Ci:1:049:0 s 80 06 0600 0000 000a 10 <
> f2c7ab00 471568507 C Ci:1:049:0 -32 0
> f2c7ab00 471568525 S Ci:1:049:0 s 80 06 0600 0000 000a 10 <
> f2c7ab00 471569258 C Ci:1:049:0 -32 0
> f2c7ab00 471569275 S Ci:1:049:0 s 80 06 0600 0000 000a 10 <
> f2c7ab00 471570257 C Ci:1:049:0 -32 0
> f2c7ab00 471570276 S Ci:1:049:0 s 80 06 0200 0000 0009 9 <
> f2c7ab00 471571384 C Ci:1:049:0 0 9 = 09021200 01010080 32
> f2c7ab00 471571402 S Ci:1:049:0 s 80 06 0200 0000 0012 18 <
> f2c7ab00 471571632 C Ci:1:049:0 0 18 = 09021200 01010080 32090400
> 00000000 0000
> f2c7ab00 471572088 S Co:1:049:0 s 00 09 0001 0000 0000 0         // set
> config
> f2c7ab00 471572256 C Co:1:049:0 0 0
> f2c7a480 473103289 S Ci:1:000:0 s 80 06 0100 0000 0040 64 <
> f2c7a480 473104384 C Ci:1:000:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7a480 473176279 S Co:1:000:0 s 00 05 0031 0000 0000 0         // set
> address
> f2c7a480 473177257 C Co:1:000:0 0 0
> f2c7a480 473194864 S Ci:1:049:0 s 80 06 0100 0000 0012 18 <
> f2c7a480 473195385 C Ci:1:049:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7a480 473195400 S Ci:1:049:0 s 80 06 0200 0000 0012 18 <
> f2c7a480 473195633 C Ci:1:049:0 0 18 = 09021200 01010080 32090400
> 00000000 0000
> f2c7a480 473195643 S Co:1:049:0 s 00 09 0001 0000 0000 0       // set config
> f2c7a480 473195758 C Co:1:049:0 0 0
> f2c7a480 473195769 S Co:1:049:0 s 01 0b 0000 0000 0000 0       // set
> interface alt (not supported)
> f2c7a480 473195883 C Co:1:049:0 -32 0
> f2c7a480 473219525 S Ci:1:049:0 s 80 06 0100 0000 0040 64 <
> f2c7a480 473220385 C Ci:1:049:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7a480 473299295 S Ci:1:000:0 s 80 06 0100 0000 0040 64 <
> f2c7a480 473300383 C Ci:1:000:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7a480 473371280 S Co:1:000:0 s 00 05 0031 0000 0000 0      // set address
> f2c7a480 473372257 C Co:1:000:0 0 0
> f2c7a480 473391851 S Ci:1:049:0 s 80 06 0100 0000 0012 18 <
> f2c7a480 473392379 C Ci:1:049:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f2c7a480 473393235 S Ci:1:049:0 s 80 06 0200 0000 0012 18 <
> f2c7a480 473393509 C Ci:1:049:0 0 18 = 09021200 01010080 32090400
> 00000000 0000
> f2c7a480 473393521 S Co:1:049:0 s 00 09 0001 0000 0000 0     // set config
> f2c7a480 473393633 C Co:1:049:0 0 0
> f2c7a480 473393642 S Co:1:049:0 s 01 0b 0000 0000 0000 0    // set
> interface alt (not supported)
> f2c7a480 473393758 C Co:1:049:0 -32 0
> f1b92200 473485330 S Ci:1:049:0 s 80 06 0100 0000 0012 18 <
> f1b92200 473486386 C Ci:1:049:0 0 18 = 12010002 ff00ff40 25098190
> 10000000 0001
> f1b92200 473488026 S Ci:1:049:0 s 80 06 0200 0000 0009 9 <
> f1b92200 473488256 C Ci:1:049:0 0 9 = 09021200 01010080 32
> f1b92200 473489774 S Ci:1:049:0 s 80 06 0200 0000 00ff 255 <
> f1b92200 473490007 C Ci:1:049:0 0 18 = 09021200 01010080 32090400
> 00000000 0000
> f1b92200 473492330 S Ci:1:049:0 s 80 06 0600 0000 000a 10 <
> f1b92200 473492508 C Ci:1:049:0 -32 0
> ---start of device specific stuff---
> f1b92f00 474847588 S Co:1:049:0 s 20 05 0000 0000 0000 0
> f1b92f00 475270136 C Co:1:049:0 0 0
> 
> 
> Any tips for tracking this down?

Resets don't just happen for no reason.  Something causes them, either
a kernel driver or a user program.

Since you haven't said what type of device this is, I can't guess 
whether a kernel driver is involved (or which driver).  Resets from a 
user program can be tracked if you set the usbfs_snoop=y parameter for 
usbcore.

>  It looks like the resets always happen
> after set_config or set_interface.

A better way of putting this would be to say that no I/O occurs between
the set_config or set_interface from the previous reset and the start
of the next reset.

> Once in a great while, they don't
> happen or happen more or less frequently. Perhaps there is some
> electrical interference, but it seems strange that the resets appear to
> happen at the same spots.

It might not be strange at all.  Maybe a user program always causes the 
resets to appear in those spots.

> I am running kernel 2.6.28-11, and basically looking for
> suggestions/tools that might help me figure this out. The device itself
> is very limited and can't log much more than a few counters.

You need to start by finding out what software is causing the resets.  
A good place to start would be the device's entry in 
/proc/bus/usb/devices.  (If your distribution doesn't mount 
/proc/bus/usb for you, you'll have to do "mount -t usbfs none 
/proc/bus/usb" first.)

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