Skip to contentSkip to conversation

single bit errors on files stored on USB-HDDs via USB2/usb_storage

DISCUSSION [email protected] 2 participants 2 messages Dec 10, 2006

lore
Share & tools
lore
#0 lore raw

How the wires can cause single-bit errors is a bit beyond me; USB protects every bit on the wire well enough that communication errors should be detected.

Every packet starts with an identifier byte; this contains a 4-bit packet identifier repeated twice.

Some small "token" packets have an 11-bit payload (7 address and 4 endpoint bits) and a 5-bit CRC.

Any corruption of those would result in USB state machine confusion and at least large data gaps.

Packets with an actual data payload are protected with a CRC-16. Not quite as strong as Ethernet, but sufficient to detect all errors of three bits or less, and all burst errors of 16 consecutive bits or less.

A single-bit flip can't get past a CRC-16 unless you flip at least three bits in the CRC as well. The actual pattern depends on the bit position and averages 8 bits; given the documented bit error positions and a better knowledge of the ATA-over-USB encapsulation protocol, the actual CRC changes could be computed.

Now, I can imagine a USB slave controller so cheap and/or buggy that it doesn't check the CRC, but I'd think that most would. Checking a CRC is hardly a novel challenge.

#1 lore raw

Hi There!

Quoted 3 lines

Now, I can imagine a USB slave controller so cheap and/or buggy that it doesn't check the CRC, but I'd think that most would. Checking a CRC is hardly a novel challenge.

Do we have any counters in the USB Stack and the drivers which count the USB transaction errors?
According to some datasheets (i.e. NXP ISP1563) there are bits called USB Error and USB Error Interrupt" etc.
Are those should be implemented / counted in the driver stack somewhere? Okay, simple question...

A quick look into ehci.h tells me that the bit inside of the kernel
is propably called STS_ERR and is used i.e. in ehci_dbg.c 's and printed through dbg_status_buf() and dbg_intr.buf(). Maybe it's sufficient to turn on debugging and turn the
error flag into an error counter just to get an idea if it cumulates?

Just my five cents,

Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany

http://www.anagramm-technology.com
Phone: +49-89-741518-50
Fax: +49-89-741518-19