-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Hello (again)
A culmination of a number of threads/random crashes reported by users all have a constant undercurrent:
#195
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=16280
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=8010&hilit=serial+toggle
There are two main themes here -
- a broken USB device (FT232BM/BL / FT8U232 / various other wierd and wonderful ones) consistently causes the Pi to lock up if the device is accessed
- sporadic crashes are reported after days or weeks of use with otherwise functional devices
The constant factor with both of these is that the devices are full-speed plugged into a high-speed hub, be it the model B ports or a downstream hub. The crash is caused by a data toggle error condition existing either due to the broken USB device sending one with the wrong PID, or due to genuine variations in the aether causing a device to drop a packet.
I have a FT232BL device and the Pi locks up as a result of a usb_control_msg which is sent on opening the serial port in any garden variety terminal emulator. It works perfectly well if the speed is either forced to Full via command line parameter or via being plugged into a model A directly.
If a data toggle error occurs when the device is behind a transaction translator, it appears that the HC gets halted with the datatglerr interrupt bit set. The driver currently does not handle this at all well and goes into an infinite loop. The relevant interrupt handler is not called from handle_hc_chhltd_intr_dma.
The data toggle error interrupt handler as it currently exists is basically a stub, and does nothing but disable the interrupt. For a split transaction, I think the correct recovery is to restart the split and flip the expected data toggle bit in the HC's register.