Hello,

My company (Cybernetics) is using the FTDI USB to Serial converter in an embedded
application.  I keep getting a kernel panic when I try to access the device.  The panic
seems to happen when the driver receives serial data from the device while the driver 
is
opened.  I have attached debugging information below.

I have tried kernels 2.4.12 and 2.4.13-pre6; both get the same problem.  I have not 
tried
any older kernels.

Any help would be greatly appreciated.

Sincerely,
Anthony J. Battersby
Cybernetics

--------------------------------------------------------------------------------

/*
Program to reproduce the problem.  Causes a kernel panic.
*/

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char *argv[])
{
   int fd;
   int ret;
   unsigned char buf[1024];

   fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NDELAY);
   if (fd == -1)
      {
      perror("open");
      return -1;
      }

   ret = fcntl(fd, F_SETFL, 0);
   if (ret == -1)
      {
      perror("fcntl");
      return -1;
      }

   buf[0] = 0x1b;
   buf[1] = 0x00;
   ret = write(fd, buf, 2);
   if (ret == -1)
      {
      perror("write");
      return -1;
      }

   /* At this point, my device will respond to the "0x1b 0x00" command by   */
   /* sending a response such as "0x1b 0x00 0x00".  If the sleep is omitted,*/
   /* the termination of the program will cause the closing of /dev/ttyUSB0 */
   /* and the kernel panic will not happen.                                 */
   sleep(1);

   return 0;
}

--------------------------------------------------------------------------------

cat /proc/bus/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=236/900 us (26%), #Int=  2, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=ef80
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=046d ProdID=c308 Rev=12.00
S:  Manufacturer=Logitech
S:  Product=Logitech USB Keyboard
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr= 80mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=hid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl= 10ms
I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=hid
E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl= 32ms
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0403 ProdID=6001 Rev= 2.00
S:  Manufacturer=FTDI
S:  Product=USB <-> Serial
S:  SerialNumber=12345678
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 90mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=serial
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms

--------------------------------------------------------------------------------

Output from ver_linux script (note: kernel and modules were compiled with gcc 2.91.66, 
not
2.96)

Linux serpent 2.4.13-pre6 #1 Mon Oct 22 00:16:29 EST 2001 i686 unknown

Gnu C                  2.96
Gnu make               3.79.1
binutils               2.10.91.0.2
util-linux             2.10s
mount                  2.11b
modutils               2.4.2
e2fsprogs              1.19
Linux C Library        2.2.2
Dynamic linker (ldd)   2.2.2
Procps                 2.0.7
Net-tools              1.57
Console-tools          0.3.3
Sh-utils               2.0
Modules Loaded         nfs lockd sunrpc eepro100 ftdi_sio usbserial serial ide-cd cdrom
keybdev hid input usb-uhci usbcore

--------------------------------------------------------------------------------

ksymoops 2.4.0 on i686 2.4.13-pre6.  Options used
     -v /usr/src/linux/vmlinux (specified)
     -k oops_ksyms (specified)
     -l oops_modules (specified)
     -o /lib/modules/2.4.13-pre6/ (default)
     -m /boot/System.map-2.4.13-pre6 (default)

Warning (compare_maps): mismatch on symbol usb_devfs_handle  , usbcore says c882dc34,
/lib/modules/2.4.13-pre6/kernel/drivers/usb/usbcore.o says c882d754.  Ignoring
/lib/modules/2.4.13-pre6/kernel/drivers/usb/usbcore.o entry
invalid operand: 0000
CPU:    0
EIP:    0010:[<c011051d>]    Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010282
eax: 00000018   ebx: c78f0820   ecx: 00000000   edx: 00000082
esi: c01d6000   edi: c01d6000   ebp: c01d7d64   esp: c01d7d1c
ds: 0018   es: 0018   ss: 0018
Process swapper (pid: 0, stackpage=c01d7000)
Stack: c01b0f16 c78f0820 c01d6000 c78f0858 c7843100 c88314f1 c747fe40 00000286
       c78f0220 c7923400 c73bf7a1 00000000 c79471a0 c01d6000 00000286 00000000
       c01d6000 c01d7da4 00000000 c886a665 c78f0820 c78f0800 00000001 c01d7def
Call Trace: [<c88314f1>] [<c886a665>] [<c88643bb>] [<c0155986>] [<c0156087>]
   [<c01567cb>] [<c8830509>] [<c0168a41>] [<c883060c>] [<c8832336>] [<c01556ef>]
   [<c0155788>] [<c886ab65>] [<c88328c0>] [<c88329c3>] [<c0110001>] [<c0107d7d>]
   [<c0107ee7>] [<c01051a0>] [<c01051a0>] [<c0109d58>] [<c01051a0>] [<c01051a0>]
   [<c01051c3>] [<c0105224>] [<c0105000>] [<c0105027>]
Code: 0f 0b 8d 65 bc 5b 5e 5f 89 ec 5d c3 8d 76 00 55 89 e5 83 ec

>>EIP; c011051d <schedule+3bd/3cc>   <=====
Trace; c88314f1 <[usb-uhci]uhci_submit_urb+21d/34c>
Trace; c886a665 <[ftdi_sio]ftdi_sio_write+145/364>
Trace; c88643bb <[usbserial]serial_write+97/b4>
Trace; c0155986 <tty_default_put_char+1e/24>
Trace; c0156087 <echo_char+3f/5c>
Trace; c01567cb <n_tty_receive_buf+377/d8c>
Trace; c8830509 <[usb-uhci]uhci_submit_bulk_urb+455/464>
Trace; c0168a41 <ide_set_handler+55/60>
Trace; c883060c <[usb-uhci]uhci_clean_transfer+94/1d0>
Trace; c8832336 <[usb-uhci]process_transfer+2f2/304>
Trace; c01556ef <flush_to_ldisc+db/e4>
Trace; c0155788 <tty_flip_buffer_push+14/58>
Trace; c886ab65 <[ftdi_sio]ftdi_sio_read_bulk_callback+22d/2a8>
Trace; c88328c0 <[usb-uhci]process_urb+1d4/210>
Trace; c88329c3 <[usb-uhci]uhci_interrupt+c7/12c>
Trace; c0110001 <reschedule_idle+29/9c>
Trace; c0107d7d <handle_IRQ_event+31/5c>
Trace; c0107ee7 <do_IRQ+6b/a8>
Trace; c01051a0 <default_idle+0/28>
Trace; c01051a0 <default_idle+0/28>
Trace; c0109d58 <call_do_IRQ+5/d>
Trace; c01051a0 <default_idle+0/28>
Trace; c01051a0 <default_idle+0/28>
Trace; c01051c3 <default_idle+23/28>
Trace; c0105224 <cpu_idle+3c/50>
Trace; c0105000 <_stext+0/0>
Trace; c0105027 <rest_init+27/28>
Code;  c011051d <schedule+3bd/3cc>
00000000 <_EIP>:
Code;  c011051d <schedule+3bd/3cc>   <=====
   0:   0f 0b                     ud2a      <=====
Code;  c011051f <schedule+3bf/3cc>
   2:   8d 65 bc                  lea    0xffffffbc(%ebp),%esp
Code;  c0110522 <schedule+3c2/3cc>
   5:   5b                        pop    %ebx
Code;  c0110523 <schedule+3c3/3cc>
   6:   5e                        pop    %esi
Code;  c0110524 <schedule+3c4/3cc>
   7:   5f                        pop    %edi
Code;  c0110525 <schedule+3c5/3cc>
   8:   89 ec                     mov    %ebp,%esp
Code;  c0110527 <schedule+3c7/3cc>
   a:   5d                        pop    %ebp
Code;  c0110528 <schedule+3c8/3cc>
   b:   c3                        ret
Code;  c0110529 <schedule+3c9/3cc>
   c:   8d 76 00                  lea    0x0(%esi),%esi
Code;  c011052c <__wake_up+0/90>
   f:   55                        push   %ebp
Code;  c011052d <__wake_up+1/90>
  10:   89 e5                     mov    %esp,%ebp
Code;  c011052f <__wake_up+3/90>
  12:   83 ec 00                  sub    $0x0,%esp

 <0>Kernel panic: Aiee, killing interrupt handler!

1 warning issued.  Results may not be reliable.

--------------------------------------------------------------------------------


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to