Re: [Ftdi-usb-sio-devel] ftdi_sio: kernel panic on close()
Brought to you by:
bryder
From: Ian A. <ab...@me...> - 2004-01-23 11:34:07
|
On 22/01/2004 18:48, Hans Schou wrote: > On Thu, 15 Jan 2004, Ian Abbott wrote: > I have now graped something with minicom, /proc/ksyms and > /proc/modules > > > Use the 'ksymoops' tool to produce a nice report. > > I tried that, see attachment. Does that give an idea? Yes, thanks. This seems to be the known problem of characters being received while the usbserial code holds the usb serial port's semaphore. There is a trail from ftdi_sio_read_bulk_callback -> flush_to_ldisc -> n_tty_receive_buf -> n_tty_receive_char -> opost -> tty_default_put_char -> serial_write -> __down -> __down_failed. Three things clash, resulting in this oops. First, there is the use of the usb serial port semaphore in the serial_write function (usbserial.c). Second, there is the use of the "low_latency" serial port parameter, which is turned on by default in the ftdi_sio driver. Third, there are the termios settings, which may cause characters to be written back to the port when characters are received from the port (echoing or special handling of received control characters). > > Also, its best if the kernel is compiled using stack frame pointers > > to make the stack trace more meaningful. > > I'm not sure sure what "stack frame pointers" is. The "CONFIG_FRAME_POINTER" kernel option. Using "menuconfig", it appears as "Kernel hacking ---> Compile the kernel with frame pointers", at least for "i386" and "arm" architectures. This option should be turned on to make debugging easier, but some distros turn it off in their shipped kernel configs, as it makes the kernel slightly larger and slower. > Thanks for any clue which could solve this problem with ftdi. Until the port semaphore in usbserial.c is addressed (I have no idea when that will be), one of two things can be done to prevent this oops. The first option is to turn off the "low_latency" option. This could be done by modifying the driver ftdi_sio driver (comment out the "priv->flags = ASYNC_LOW_LATENCY;" line in the "ftdi_common_startup" function), or by running the "setserial" program with the "^low_latency" option on the USB serial ports created by the ftdi_sio driver (e.g. "setserial /dev/ttyUSB0 ^low_latency"). However, turning off the low_latency option can cause a lot of received data to be dropped at high speeds. The second option is to make sure the termios settings don't cause characters to be written back to the port while processing received characters. Make sure the following "c_lflag" bits are *not* set in the "struct termios" structure sent to the port using the "tcsetattr" function: ECHO, ECHOE, ECHOK, ECHONL, ECHOCTL. The safest option is to set "c_lflag" to zero. -- -=( Ian Abbott @ MEV Ltd. E-mail: <ab...@me...> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- |