Re: bluetooth adapters keep disconnecting with an "USB disconnect"

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

 



On Mon, 18 Jan 2010, Peter Kornatowski wrote:

> >The timestamp is in microseconds from system startup; it doesn't give
> >the time of day.  If you can match up one of the events in the usbmon
> >log with something in the dmesg log then you can figure out the offset
> >between the two time scales.  Generally it doesn't matter.
> 
> I know that it gives me the time from system startup, but the syslog 
> gives me that, too. For example (*):
> Jan 17 03:36:36 peter kernel: [110056.795139] usb 3-2: 
> uhci_result_common: failed with status 440000
> But as you can see the timestamp here (also in microseconds) has 12 
> digits! But the usbmon log has even in the last lines (where the 
> system was running over 15 hours) just 10 digits. I tried to grep for 
> the whole timestamp from the syslog (then I got nothing) or just for 
> the first 10 digits or the last 10 digits, but then it grepped way 
> too many lines.

I just checked the source code, and it contains a bug.  The timestamp
value is intended to be the number of microseconds since startup,
modulo 4096 seconds.  That's so it will fit into 32 bits.

However in fact the calculation uses 65536 instead of 4096, and the
resulting overflow causes odd behavior.  (The computation is done in
hex instead of decimal, and the value used is 0xFFFF instead of 0xFFF.)

So to get an exact correspondence, begin with the number of seconds
since startup and divide by 65536.  Multiple the remainder by one
million, add in the additional microseconds, and take the low-order 32
bits of the result.  That's what the usbmon log contains.

> (*) This is from a test I ran over the weekend with no usb-devices at 
> all, but just the 3 bluetooth-adapters (you asked for that). I got 
> just one USB-disconnect in 65 hours of testing. So as I assumed, 
> USB-hubs just increase the number of disconnects, but are not the 
> cause. I attached the syslog of the disconnect.

The syslog makes it look exactly like a normal disconnect.  I suspect 
that in the end this will turn out to be hardware problem with the 
bluetooth adapters, like the problem Manuel described.

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