Bug 8564

Summary: ftdi_sio: BUG: unable to handle kernel NULL pointer dereference at virtual address
Product: Drivers Reporter: Ted Logan (tedtheologian)
Component: USBAssignee: Chuck Ebbert (cebbert)
Status: CLOSED CODE_FIX    
Severity: blocking CC: kenny, P, tez
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.21-1.3194.fc7 Subsystem:
Regression: --- Bisected commit-id:

Description Ted Logan 2007-06-01 11:34:55 UTC
Fedora 7
USB-UIRT

   1.
      drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI
USB Serial Device
   2.
      ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
   3.
      BUG: unable to handle kernel NULL pointer dereference at virtual address
00000014
   4.
       printing eip:
   5.
      f8a1740a
   6.
      *pde = 00000000
   7.
      Oops: 0002 [#1]
   8.
      SMP
   9.
      last sysfs file: /devices/pci0000:00/0000:00:1d.7/usb5/idVendor
  10.
      Modules linked in: ftdi_sio bluetooth snd_seq snd_ac97_codec usblp
v4l1_compat fw_core snd_rawmidi sr_mod snd_pcm_oss snd_mixer_oss ac97_bus
snd_util_mem usbserial e100 serio_raw snd_seq_device snd_hwdep snd_pcm
emu10k1_gp cdrom mii snd_timer gameport snd soundcore iTCO_wdt snd_page_alloc
i2c_i801 iTCO_vendor_support pcspkr i2c_core floppy sg joydev usb_storage
ata_piix ata_generic libata sd_mod scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd
uhci_hcd
  11.
      CPU:    0
  12.
      EIP:    0060:[<f8a1740a>]    Not tainted VLI
  13.
      EFLAGS: 00010246   (2.6.21-1.3194.fc7 #1)
  14.
      EIP is at ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio]
  15.
      eax: 00000000   ebx: f583f400   ecx: f8a17b34   edx: f8a173d6
  16.
      esi: f8a1dae0   edi: 00000040   ebp: f8a1dae0   esp: f582acdc
  17.
      ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
  18.
      Process modprobe (pid: 935, ti=f582a000 task=f5913150 task.ti=f582a000)
  19.
      Stack: f791e464 00000246 f598fb00 f5e823c0 f8a160b5 f898690a f898855b f8a18f6f
  20.
             f5ea06d0 f8a194fa f5ea0600 f5ea4800 f8a1dae0 00000000 00000000 00000001
  21.
             00000001 f583f400 00000000 c1806d60 00000001 00000001 00000001 00000000
  22.
      Call Trace:
  23.
       [<f8a160b5>] ftdi_sio_attach+0xf/0x12 [ftdi_sio]
  24.
       [<f898690a>] usb_serial_probe+0x97b/0xdd1 [usbserial]
  25.
       [<c042e748>] lock_timer_base+0x19/0x35
  26.
       [<c042e7a8>] try_to_del_timer_sync+0x44/0x4a
  27.
       [<c05692c8>] usb_resume_both+0xa1/0xb7
  28.
       [<c056947c>] usb_autopm_do_device+0xb3/0xbd
  29.
       [<c04ad4dd>] sysfs_create_link+0x128/0x13f
  30.
       [<c0568fd2>] usb_match_one_id+0x1c/0x71
  31.
       [<c0569d2d>] usb_probe_interface+0x81/0xb2
  32.
       [<c05529ab>] really_probe+0xc6/0x14f
  33.
       [<c0552a78>] driver_probe_device+0x44/0xa5
  34.
       [<c0552b72>] __driver_attach+0x0/0xa5
  35.
       [<c0552be2>] __driver_attach+0x70/0xa5
  36.
       [<c0551ffb>] bus_for_each_dev+0x37/0x59
  37.
       [<c055282a>] driver_attach+0x16/0x18
  38.
       [<c0552b72>] __driver_attach+0x0/0xa5
  39.
       [<c05522ad>] bus_add_driver+0x5e/0x15f
  40.
       [<c056985c>] usb_register_driver+0x6d/0xd4
  41.
       [<f89857b5>] usb_serial_register+0x1ed/0x1f6 [usbserial]
  42.
       [<f8806091>] ftdi_init+0x91/0xbe [ftdi_sio]
  43.
       [<c04432e4>] sys_init_module+0x16c3/0x17fa
  44.
       [<c04755f8>] do_sync_read+0xc7/0x10a
  45.
       [<c0468484>] do_mmap_pgoff+0x593/0x6f3
  46.
       [<c05507e5>] device_remove_file+0x0/0x25
  47.
       [<c0475531>] do_sync_read+0x0/0x10a
  48.
       [<c0475e85>] vfs_read+0xa6/0x152
  49.
       [<c0404f70>] syscall_call+0x7/0xb
  50.
       =======================
  51.
      Code: ee a1 f8 00 74 1c c7 44 24 08 a4 86 a1 f8 c7 44 24 04 b7 88 a1 f8 c7
04 24 d5 88 a1 f8 e8 49 03 a1 c7 8b 43 14 8b 80 8c 01 00 00 <83> 48 14 30 c7 40
08 4d 00 00 00 c7 80 80 00 00 00 0f 00 00 00
  52.
      EIP: [<f8a1740a>] ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio] SS:ESP
0068:f582acdc
Comment 1 Anonymous Emailer 2007-06-01 12:44:18 UTC
Reply-To: akpm@linux-foundation.org

On Fri, 1 Jun 2007 11:31:30 -0700
bugme-daemon@bugzilla.kernel.org wrote:
>

(please followup via emailed reply-to-all, not via the bugzilla web
interface)

> http://bugzilla.kernel.org/show_bug.cgi?id=8564
> 
>            Summary: ftdi_sio: BUG: unable to handle kernel NULL pointer
>                     dereference at virtual address
>     Kernel Version: 2.6.21-1.3194.fc7
>             Status: NEW
>           Severity: blocking
>              Owner: greg@kroah.com
>          Submitter: mistamaila@gmail.com
> 
> 
> Fedora 7
> USB-UIRT
> 
>    1.
>       drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI
> USB Serial Device
>    2.
>       ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
>    3.
>       BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000014
>    4.
>        printing eip:
>    5.
>       f8a1740a
>    6.
>       *pde = 00000000
>    7.
>       Oops: 0002 [#1]
>    8.
>       SMP
>    9.
>       last sysfs file: /devices/pci0000:00/0000:00:1d.7/usb5/idVendor
>   10.
>       Modules linked in: ftdi_sio bluetooth snd_seq snd_ac97_codec usblp
> v4l1_compat fw_core snd_rawmidi sr_mod snd_pcm_oss snd_mixer_oss ac97_bus
> snd_util_mem usbserial e100 serio_raw snd_seq_device snd_hwdep snd_pcm
> emu10k1_gp cdrom mii snd_timer gameport snd soundcore iTCO_wdt snd_page_alloc
> i2c_i801 iTCO_vendor_support pcspkr i2c_core floppy sg joydev usb_storage
> ata_piix ata_generic libata sd_mod scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd
> uhci_hcd
>   11.
>       CPU:    0
>   12.
>       EIP:    0060:[<f8a1740a>]    Not tainted VLI
>   13.
>       EFLAGS: 00010246   (2.6.21-1.3194.fc7 #1)
>   14.
>       EIP is at ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio]
>   15.
>       eax: 00000000   ebx: f583f400   ecx: f8a17b34   edx: f8a173d6
>   16.
>       esi: f8a1dae0   edi: 00000040   ebp: f8a1dae0   esp: f582acdc
>   17.
>       ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
>   18.
>       Process modprobe (pid: 935, ti=f582a000 task=f5913150 task.ti=f582a000)
>   19.
>       Stack: f791e464 00000246 f598fb00 f5e823c0 f8a160b5 f898690a f898855b f8a18f6f
>   20.
>              f5ea06d0 f8a194fa f5ea0600 f5ea4800 f8a1dae0 00000000 00000000 00000001
>   21.
>              00000001 f583f400 00000000 c1806d60 00000001 00000001 00000001 00000000
>   22.
>       Call Trace:
>   23.
>        [<f8a160b5>] ftdi_sio_attach+0xf/0x12 [ftdi_sio]
>   24.
>        [<f898690a>] usb_serial_probe+0x97b/0xdd1 [usbserial]
>   25.
>        [<c042e748>] lock_timer_base+0x19/0x35
>   26.
>        [<c042e7a8>] try_to_del_timer_sync+0x44/0x4a
>   27.
>        [<c05692c8>] usb_resume_both+0xa1/0xb7
>   28.
>        [<c056947c>] usb_autopm_do_device+0xb3/0xbd
>   29.
>        [<c04ad4dd>] sysfs_create_link+0x128/0x13f
>   30.
>        [<c0568fd2>] usb_match_one_id+0x1c/0x71
>   31.
>        [<c0569d2d>] usb_probe_interface+0x81/0xb2
>   32.
>        [<c05529ab>] really_probe+0xc6/0x14f
>   33.
>        [<c0552a78>] driver_probe_device+0x44/0xa5
>   34.
>        [<c0552b72>] __driver_attach+0x0/0xa5
>   35.
>        [<c0552be2>] __driver_attach+0x70/0xa5
>   36.
>        [<c0551ffb>] bus_for_each_dev+0x37/0x59
>   37.
>        [<c055282a>] driver_attach+0x16/0x18
>   38.
>        [<c0552b72>] __driver_attach+0x0/0xa5
>   39.
>        [<c05522ad>] bus_add_driver+0x5e/0x15f
>   40.
>        [<c056985c>] usb_register_driver+0x6d/0xd4
>   41.
>        [<f89857b5>] usb_serial_register+0x1ed/0x1f6 [usbserial]
>   42.
>        [<f8806091>] ftdi_init+0x91/0xbe [ftdi_sio]
>   43.
>        [<c04432e4>] sys_init_module+0x16c3/0x17fa
>   44.
>        [<c04755f8>] do_sync_read+0xc7/0x10a
>   45.
>        [<c0468484>] do_mmap_pgoff+0x593/0x6f3
>   46.
>        [<c05507e5>] device_remove_file+0x0/0x25
>   47.
>        [<c0475531>] do_sync_read+0x0/0x10a
>   48.
>        [<c0475e85>] vfs_read+0xa6/0x152
>   49.
>        [<c0404f70>] syscall_call+0x7/0xb
>   50.
>        =======================
>   51.
>       Code: ee a1 f8 00 74 1c c7 44 24 08 a4 86 a1 f8 c7 44 24 04 b7 88 a1 f8 c7
> 04 24 d5 88 a1 f8 e8 49 03 a1 c7 8b 43 14 8b 80 8c 01 00 00 <83> 48 14 30 c7 40
> 08 4d 00 00 00 c7 80 80 00 00 00 0f 00 00 00
>   52.
>       EIP: [<f8a1740a>] ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio] SS:ESP
> 0068:f582acdc
> 

It looks like the `serial' argument to ftdi_HE_TIRA1_setup() is NULL, and
we went oops reading serial->port[0]).

John, are you able to identify an earlier kernel version which did not
have this bug?

Thanks.

Comment 2 Ted Logan 2007-06-01 13:14:07 UTC
WEll, I had 2.6.20 before I upgraded from fc6 to fedora 7, and it worked then:)

On 6/1/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Fri, 1 Jun 2007 11:31:30 -0700
> bugme-daemon@bugzilla.kernel.org wrote:
> >
>
> (please followup via emailed reply-to-all, not via the bugzilla web
> interface)
>
> > http://bugzilla.kernel.org/show_bug.cgi?id=8564
> >
> >            Summary: ftdi_sio: BUG: unable to handle kernel NULL pointer
> >                     dereference at virtual address
> >     Kernel Version: 2.6.21-1.3194.fc7
> >             Status: NEW
> >           Severity: blocking
> >              Owner: greg@kroah.com
> >          Submitter: mistamaila@gmail.com
> >
> >
> > Fedora 7
> > USB-UIRT
> >
> >    1.
> >       drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI
> > USB Serial Device
> >    2.
> >       ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
> >    3.
> >       BUG: unable to handle kernel NULL pointer dereference at virtual address
> > 00000014
> >    4.
> >        printing eip:
> >    5.
> >       f8a1740a
> >    6.
> >       *pde = 00000000
> >    7.
> >       Oops: 0002 [#1]
> >    8.
> >       SMP
> >    9.
> >       last sysfs file: /devices/pci0000:00/0000:00:1d.7/usb5/idVendor
> >   10.
> >       Modules linked in: ftdi_sio bluetooth snd_seq snd_ac97_codec usblp
> > v4l1_compat fw_core snd_rawmidi sr_mod snd_pcm_oss snd_mixer_oss ac97_bus
> > snd_util_mem usbserial e100 serio_raw snd_seq_device snd_hwdep snd_pcm
> > emu10k1_gp cdrom mii snd_timer gameport snd soundcore iTCO_wdt snd_page_alloc
> > i2c_i801 iTCO_vendor_support pcspkr i2c_core floppy sg joydev usb_storage
> > ata_piix ata_generic libata sd_mod scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd
> > uhci_hcd
> >   11.
> >       CPU:    0
> >   12.
> >       EIP:    0060:[<f8a1740a>]    Not tainted VLI
> >   13.
> >       EFLAGS: 00010246   (2.6.21-1.3194.fc7 #1)
> >   14.
> >       EIP is at ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio]
> >   15.
> >       eax: 00000000   ebx: f583f400   ecx: f8a17b34   edx: f8a173d6
> >   16.
> >       esi: f8a1dae0   edi: 00000040   ebp: f8a1dae0   esp: f582acdc
> >   17.
> >       ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
> >   18.
> >       Process modprobe (pid: 935, ti=f582a000 task=f5913150 task.ti=f582a000)
> >   19.
> >       Stack: f791e464 00000246 f598fb00 f5e823c0 f8a160b5 f898690a f898855b f8a18f6f
> >   20.
> >              f5ea06d0 f8a194fa f5ea0600 f5ea4800 f8a1dae0 00000000 00000000 00000001
> >   21.
> >              00000001 f583f400 00000000 c1806d60 00000001 00000001 00000001 00000000
> >   22.
> >       Call Trace:
> >   23.
> >        [<f8a160b5>] ftdi_sio_attach+0xf/0x12 [ftdi_sio]
> >   24.
> >        [<f898690a>] usb_serial_probe+0x97b/0xdd1 [usbserial]
> >   25.
> >        [<c042e748>] lock_timer_base+0x19/0x35
> >   26.
> >        [<c042e7a8>] try_to_del_timer_sync+0x44/0x4a
> >   27.
> >        [<c05692c8>] usb_resume_both+0xa1/0xb7
> >   28.
> >        [<c056947c>] usb_autopm_do_device+0xb3/0xbd
> >   29.
> >        [<c04ad4dd>] sysfs_create_link+0x128/0x13f
> >   30.
> >        [<c0568fd2>] usb_match_one_id+0x1c/0x71
> >   31.
> >        [<c0569d2d>] usb_probe_interface+0x81/0xb2
> >   32.
> >        [<c05529ab>] really_probe+0xc6/0x14f
> >   33.
> >        [<c0552a78>] driver_probe_device+0x44/0xa5
> >   34.
> >        [<c0552b72>] __driver_attach+0x0/0xa5
> >   35.
> >        [<c0552be2>] __driver_attach+0x70/0xa5
> >   36.
> >        [<c0551ffb>] bus_for_each_dev+0x37/0x59
> >   37.
> >        [<c055282a>] driver_attach+0x16/0x18
> >   38.
> >        [<c0552b72>] __driver_attach+0x0/0xa5
> >   39.
> >        [<c05522ad>] bus_add_driver+0x5e/0x15f
> >   40.
> >        [<c056985c>] usb_register_driver+0x6d/0xd4
> >   41.
> >        [<f89857b5>] usb_serial_register+0x1ed/0x1f6 [usbserial]
> >   42.
> >        [<f8806091>] ftdi_init+0x91/0xbe [ftdi_sio]
> >   43.
> >        [<c04432e4>] sys_init_module+0x16c3/0x17fa
> >   44.
> >        [<c04755f8>] do_sync_read+0xc7/0x10a
> >   45.
> >        [<c0468484>] do_mmap_pgoff+0x593/0x6f3
> >   46.
> >        [<c05507e5>] device_remove_file+0x0/0x25
> >   47.
> >        [<c0475531>] do_sync_read+0x0/0x10a
> >   48.
> >        [<c0475e85>] vfs_read+0xa6/0x152
> >   49.
> >        [<c0404f70>] syscall_call+0x7/0xb
> >   50.
> >        =======================
> >   51.
> >       Code: ee a1 f8 00 74 1c c7 44 24 08 a4 86 a1 f8 c7 44 24 04 b7 88 a1 f8 c7
> > 04 24 d5 88 a1 f8 e8 49 03 a1 c7 8b 43 14 8b 80 8c 01 00 00 <83> 48 14 30 c7 40
> > 08 4d 00 00 00 c7 80 80 00 00 00 0f 00 00 00
> >   52.
> >       EIP: [<f8a1740a>] ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio] SS:ESP
> > 0068:f582acdc
> >
>
> It looks like the `serial' argument to ftdi_HE_TIRA1_setup() is NULL, and
> we went oops reading serial->port[0]).
>
> John, are you able to identify an earlier kernel version which did not
> have this bug?
>
> Thanks.
>

Comment 3 Ted Logan 2007-06-02 12:31:54 UTC
It worked with 2.6.20 from fedora 6.

Is there any way to "patch" this for now, so I can get it working
again?  I need ftdi-sio for my usb-uirt as I am about to go out of
town for quite some time and can't use myth without it.  I mean, is
there some hack I can use?



On 6/1/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Fri, 1 Jun 2007 11:31:30 -0700
> bugme-daemon@bugzilla.kernel.org wrote:
> >
>
> (please followup via emailed reply-to-all, not via the bugzilla web
> interface)
>
> > http://bugzilla.kernel.org/show_bug.cgi?id=8564
> >
> >            Summary: ftdi_sio: BUG: unable to handle kernel NULL pointer
> >                     dereference at virtual address
> >     Kernel Version: 2.6.21-1.3194.fc7
> >             Status: NEW
> >           Severity: blocking
> >              Owner: greg@kroah.com
> >          Submitter: mistamaila@gmail.com
> >
> >
> > Fedora 7
> > USB-UIRT
> >
> >    1.
> >       drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI
> > USB Serial Device
> >    2.
> >       ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
> >    3.
> >       BUG: unable to handle kernel NULL pointer dereference at virtual address
> > 00000014
> >    4.
> >        printing eip:
> >    5.
> >       f8a1740a
> >    6.
> >       *pde = 00000000
> >    7.
> >       Oops: 0002 [#1]
> >    8.
> >       SMP
> >    9.
> >       last sysfs file: /devices/pci0000:00/0000:00:1d.7/usb5/idVendor
> >   10.
> >       Modules linked in: ftdi_sio bluetooth snd_seq snd_ac97_codec usblp
> > v4l1_compat fw_core snd_rawmidi sr_mod snd_pcm_oss snd_mixer_oss ac97_bus
> > snd_util_mem usbserial e100 serio_raw snd_seq_device snd_hwdep snd_pcm
> > emu10k1_gp cdrom mii snd_timer gameport snd soundcore iTCO_wdt snd_page_alloc
> > i2c_i801 iTCO_vendor_support pcspkr i2c_core floppy sg joydev usb_storage
> > ata_piix ata_generic libata sd_mod scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd
> > uhci_hcd
> >   11.
> >       CPU:    0
> >   12.
> >       EIP:    0060:[<f8a1740a>]    Not tainted VLI
> >   13.
> >       EFLAGS: 00010246   (2.6.21-1.3194.fc7 #1)
> >   14.
> >       EIP is at ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio]
> >   15.
> >       eax: 00000000   ebx: f583f400   ecx: f8a17b34   edx: f8a173d6
> >   16.
> >       esi: f8a1dae0   edi: 00000040   ebp: f8a1dae0   esp: f582acdc
> >   17.
> >       ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
> >   18.
> >       Process modprobe (pid: 935, ti=f582a000 task=f5913150 task.ti=f582a000)
> >   19.
> >       Stack: f791e464 00000246 f598fb00 f5e823c0 f8a160b5 f898690a f898855b f8a18f6f
> >   20.
> >              f5ea06d0 f8a194fa f5ea0600 f5ea4800 f8a1dae0 00000000 00000000 00000001
> >   21.
> >              00000001 f583f400 00000000 c1806d60 00000001 00000001 00000001 00000000
> >   22.
> >       Call Trace:
> >   23.
> >        [<f8a160b5>] ftdi_sio_attach+0xf/0x12 [ftdi_sio]
> >   24.
> >        [<f898690a>] usb_serial_probe+0x97b/0xdd1 [usbserial]
> >   25.
> >        [<c042e748>] lock_timer_base+0x19/0x35
> >   26.
> >        [<c042e7a8>] try_to_del_timer_sync+0x44/0x4a
> >   27.
> >        [<c05692c8>] usb_resume_both+0xa1/0xb7
> >   28.
> >        [<c056947c>] usb_autopm_do_device+0xb3/0xbd
> >   29.
> >        [<c04ad4dd>] sysfs_create_link+0x128/0x13f
> >   30.
> >        [<c0568fd2>] usb_match_one_id+0x1c/0x71
> >   31.
> >        [<c0569d2d>] usb_probe_interface+0x81/0xb2
> >   32.
> >        [<c05529ab>] really_probe+0xc6/0x14f
> >   33.
> >        [<c0552a78>] driver_probe_device+0x44/0xa5
> >   34.
> >        [<c0552b72>] __driver_attach+0x0/0xa5
> >   35.
> >        [<c0552be2>] __driver_attach+0x70/0xa5
> >   36.
> >        [<c0551ffb>] bus_for_each_dev+0x37/0x59
> >   37.
> >        [<c055282a>] driver_attach+0x16/0x18
> >   38.
> >        [<c0552b72>] __driver_attach+0x0/0xa5
> >   39.
> >        [<c05522ad>] bus_add_driver+0x5e/0x15f
> >   40.
> >        [<c056985c>] usb_register_driver+0x6d/0xd4
> >   41.
> >        [<f89857b5>] usb_serial_register+0x1ed/0x1f6 [usbserial]
> >   42.
> >        [<f8806091>] ftdi_init+0x91/0xbe [ftdi_sio]
> >   43.
> >        [<c04432e4>] sys_init_module+0x16c3/0x17fa
> >   44.
> >        [<c04755f8>] do_sync_read+0xc7/0x10a
> >   45.
> >        [<c0468484>] do_mmap_pgoff+0x593/0x6f3
> >   46.
> >        [<c05507e5>] device_remove_file+0x0/0x25
> >   47.
> >        [<c0475531>] do_sync_read+0x0/0x10a
> >   48.
> >        [<c0475e85>] vfs_read+0xa6/0x152
> >   49.
> >        [<c0404f70>] syscall_call+0x7/0xb
> >   50.
> >        =======================
> >   51.
> >       Code: ee a1 f8 00 74 1c c7 44 24 08 a4 86 a1 f8 c7 44 24 04 b7 88 a1 f8 c7
> > 04 24 d5 88 a1 f8 e8 49 03 a1 c7 8b 43 14 8b 80 8c 01 00 00 <83> 48 14 30 c7 40
> > 08 4d 00 00 00 c7 80 80 00 00 00 0f 00 00 00
> >   52.
> >       EIP: [<f8a1740a>] ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio] SS:ESP
> > 0068:f582acdc
> >
>
> It looks like the `serial' argument to ftdi_HE_TIRA1_setup() is NULL, and
> we went oops reading serial->port[0]).
>
> John, are you able to identify an earlier kernel version which did not
> have this bug?
>
> Thanks.
>

Comment 4 Anonymous Emailer 2007-06-02 12:42:29 UTC
Reply-To: akpm@linux-foundation.org

On Sat, 2 Jun 2007 14:28:19 -0500 "John H." <mistamaila@gmail.com> wrote:

> It worked with 2.6.20 from fedora 6.
> 
> Is there any way to "patch" this for now, so I can get it working
> again?  I need ftdi-sio for my usb-uirt as I am about to go out of
> town for quite some time and can't use myth without it.  I mean, is
> there some hack I can use?
> 

Dunno.  You could perhaps try removing the .port_probe and .port_remove
fields from ftdi_sio_device (line 649) but that's just a random poke.

I suspect you'll need to stick with 2.6.20 for now.

I'm suspecting it was Jim's 12bdbe03c8db7139de1de5c622cb0609d259cece which
caused this regression..

Comment 5 Ted Logan 2007-06-02 12:44:17 UTC
I'll try removing those.  I don't really have option of downgrading
kernel as some other f7 stuff is dependent on 2.6.21.

So I can just comment out that line altogether?

On 6/2/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Sat, 2 Jun 2007 14:28:19 -0500 "John H." <mistamaila@gmail.com> wrote:
>
> > It worked with 2.6.20 from fedora 6.
> >
> > Is there any way to "patch" this for now, so I can get it working
> > again?  I need ftdi-sio for my usb-uirt as I am about to go out of
> > town for quite some time and can't use myth without it.  I mean, is
> > there some hack I can use?
> >
>
> Dunno.  You could perhaps try removing the .port_probe and .port_remove
> fields from ftdi_sio_device (line 649) but that's just a random poke.
>
> I suspect you'll need to stick with 2.6.20 for now.
>
> I'm suspecting it was Jim's 12bdbe03c8db7139de1de5c622cb0609d259cece which
> caused this regression..
>

Comment 6 Ted Logan 2007-06-02 14:40:46 UTC
Did you mean 639?

   .port_probe =           ftdi_sio_port_probe,
        .port_remove =          ftdi_sio_port_remove,

On 6/2/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Sat, 2 Jun 2007 14:28:19 -0500 "John H." <mistamaila@gmail.com> wrote:
>
> > It worked with 2.6.20 from fedora 6.
> >
> > Is there any way to "patch" this for now, so I can get it working
> > again?  I need ftdi-sio for my usb-uirt as I am about to go out of
> > town for quite some time and can't use myth without it.  I mean, is
> > there some hack I can use?
> >
>
> Dunno.  You could perhaps try removing the .port_probe and .port_remove
> fields from ftdi_sio_device (line 649) but that's just a random poke.
>
> I suspect you'll need to stick with 2.6.20 for now.
>
> I'm suspecting it was Jim's 12bdbe03c8db7139de1de5c622cb0609d259cece which
> caused this regression..
>

Comment 7 Ted Logan 2007-06-02 15:09:42 UTC
:(
Here is what I did

/*      .port_probe =           ftdi_sio_port_probe,
        .port_remove =          ftdi_sio_port_remove,*/


On lines 638 and 639, and am using new module.  Here's what it said on boot...

drivers/usb/serial/usb-serial.c: USB Serial support registered for
FTDI USB Serial Device
ftdi_sio 4-2:1.0: FTDI USB Serial Device converter detected
BUG: unable to handle kernel NULL pointer dereference at virtual
address 00000014
 printing eip:
f8a57beb
*pde = 00000000
Oops: 0002 [#1]
SMP
last sysfs file: /devices/pci0000:00/0000:00:1d.7/usb5/idVendor
Modules linked in: ftdi_sio(U) snd_seq_dummy snd_emu10k1 snd_seq_oss
snd_ac97_codec ivtv(F)(U) i2c_algo_bit snd_seq_midi_event
snd_usb_audio e100 cx2341x snd_seq fw_ohci snd_usb_lib tveeprom
hci_usb gspca(F)(U) usbserial fw_core ac97_bus nvidia(PF)(U) bluetooth
videodev emu10k1_gp snd_util_mem snd_pcm_oss snd_mixer_oss mii
snd_rawmidi snd_seq_device usblp v4l2_common serio_raw gameport
v4l1_compat snd_hwdep snd_pcm snd_timer floppy snd i2c_i801 iTCO_wdt
soundcore iTCO_vendor_support snd_page_alloc sr_mod i2c_core cdrom
joydev pcspkr sg ata_piix ata_generic libata sd_mod scsi_mod ext3 jbd
mbcache ehci_hcd ohci_hcd uhci_hcd
CPU:    0
EIP:    0060:[<f8a57beb>]    Tainted: PF      VLI
EFLAGS: 00010246   (2.6.21-1.3194.fc7 #1)
EIP is at ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio]
eax: 00000000   ebx: f1c855c0   ecx: f8a58268   edx: f8a57bb7
esi: f8a5dea0   edi: 00000040   ebp: f8a5dea0   esp: f23e5cdc
ds: 007b   es: 007b   fs: 00d8  gs: 0033  ss: 0068
Process modprobe (pid: 924, ti=f23e5000 task=f2327110 task.ti=f23e5000)
Stack: f7f993e4 00000246 f1c85d00 f1c85580 f8a570b5 f8a1a90a f8a1c55b f8a59692
       f2136cd0 f8a59ced f2136c00 f2bc6c00 f8a5dea0 00000000 00000000 00000001
       00000001 f1c855c0 ffffffff 00000000 00000001 00000001 00000001 00000000
Call Trace:
 [<f8a570b5>] ftdi_sio_attach+0xf/0x12 [ftdi_sio]
 [<f8a1a90a>] usb_serial_probe+0x97b/0xdd1 [usbserial]
 [<c043c220>] clockevents_program_event+0xb2/0xb9
 [<c042e748>] lock_timer_base+0x19/0x35
 [<c042e7a8>] try_to_del_timer_sync+0x44/0x4a
 [<c05692c8>] usb_resume_both+0xa1/0xb7
 [<c056947c>] usb_autopm_do_device+0xb3/0xbd
 [<c04ad4dd>] sysfs_create_link+0x128/0x13f
 [<c0568fd2>] usb_match_one_id+0x1c/0x71
 [<c0569d2d>] usb_probe_interface+0x81/0xb2
 [<c05529ab>] really_probe+0xc6/0x14f
 [<c0552a78>] driver_probe_device+0x44/0xa5
 [<c0552b72>] __driver_attach+0x0/0xa5
 [<c0552be2>] __driver_attach+0x70/0xa5
 [<c0551ffb>] bus_for_each_dev+0x37/0x59
 [<c055282a>] driver_attach+0x16/0x18
 [<c0552b72>] __driver_attach+0x0/0xa5
 [<c05522ad>] bus_add_driver+0x5e/0x15f
 [<c056985c>] usb_register_driver+0x6d/0xd4
 [<f8a197b5>] usb_serial_register+0x1ed/0x1f6 [usbserial]
 [<f8806091>] ftdi_init+0x91/0xbe [ftdi_sio]
 [<c04432e4>] sys_init_module+0x16c3/0x17fa
 [<c04755f8>] do_sync_read+0xc7/0x10a
 [<c0472227>] __kmalloc+0x0/0x7d
 [<c0475531>] do_sync_read+0x0/0x10a
 [<c0475e85>] vfs_read+0xa6/0x152
 [<c0404f70>] syscall_call+0x7/0xb
 [<c0600000>] __sched_text_start+0x6e8/0x89e
 =======================
Code: f2 a5 f8 00 74 1c c7 44 24 08 a0 90 a5 f8 c7 44 24 04 18 92 a5
f8 c7 04 24 6c 92 a5 f8 e8 68 fb 9c c7 8b 43 14 8b 80 8c 01 00 00 <83>
48 14 30 c7 40 08 4d 00 00 00 c7 80 80 00 00 00 0f 00 00 00
EIP: [<f8a57beb>] ftdi_USB_UIRT_setup+0x34/0x4e [ftdi_sio] SS:ESP 0068:f23e5cdc
fw_core: created new fw device fw0 (0 config rom retries)



Any other ideas?
On 6/2/07, John H. <mistamaila@gmail.com> wrote:
> Did you mean 639?
>
>    .port_probe =           ftdi_sio_port_probe,
>         .port_remove =          ftdi_sio_port_remove,
>
> On 6/2/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> > On Sat, 2 Jun 2007 14:28:19 -0500 "John H." <mistamaila@gmail.com> wrote:
> >
> > > It worked with 2.6.20 from fedora 6.
> > >
> > > Is there any way to "patch" this for now, so I can get it working
> > > again?  I need ftdi-sio for my usb-uirt as I am about to go out of
> > > town for quite some time and can't use myth without it.  I mean, is
> > > there some hack I can use?
> > >
> >
> > Dunno.  You could perhaps try removing the .port_probe and .port_remove
> > fields from ftdi_sio_device (line 649) but that's just a random poke.
> >
> > I suspect you'll need to stick with 2.6.20 for now.
> >
> > I'm suspecting it was Jim's 12bdbe03c8db7139de1de5c622cb0609d259cece which
> > caused this regression..
> >
>

Comment 8 Anonymous Emailer 2007-06-02 15:54:21 UTC
Reply-To: oliver@neukum.org

Am Freitag, 1. Juni 2007 21:40 schrieb Andrew Morton:
> It looks like the `serial' argument to ftdi_HE_TIRA1_setup() is NULL, and
> we went oops reading serial->port[0]).
> 
	priv = usb_get_serial_port_data(serial->port[0]);
	priv->flags |= ASYNC_SPD_CUST;

It bombs in priv->flags, as usb_get_serial_port_data() is used in a quirk
handler for the whole device before the ports are registered with the driver
core which would call ftdi_sio_port_probe() which calls
usb_set_serial_port_data()

	Regards
		Oliver

Comment 9 Ted Logan 2007-06-02 15:56:53 UTC
Oliver, can you tell me what I might do to get it working again for
now?  I can't use usb-uirt without it.


On 6/2/07, Oliver Neukum <oliver@neukum.org> wrote:
> Am Freitag, 1. Juni 2007 21:40 schrieb Andrew Morton:
> > It looks like the `serial' argument to ftdi_HE_TIRA1_setup() is NULL, and
> > we went oops reading serial->port[0]).
> >
>         priv = usb_get_serial_port_data(serial->port[0]);
>         priv->flags |= ASYNC_SPD_CUST;
>
> It bombs in priv->flags, as usb_get_serial_port_data() is used in a quirk
> handler for the whole device before the ports are registered with the driver
> core which would call ftdi_sio_port_probe() which calls
> usb_set_serial_port_data()
>
>         Regards
>                 Oliver
>

Comment 11 Anonymous Emailer 2007-06-04 02:27:17 UTC
Reply-To: oliver@neukum.org

Am Sonntag, 3. Juni 2007 00:53 schrieb John H.:
> Oliver, can you tell me what I might do to get it working again for
> now?  I can't use usb-uirt without it.

Does this patch fix the issue?

	Regards
		Oliver
----

--- linux-2.6.22-rc3/drivers/usb/serial/ftdi_sio.c.alt	2007-06-04 10:38:45.000000000 +0200
+++ linux-2.6.22-rc3/drivers/usb/serial/ftdi_sio.c	2007-06-04 11:06:27.000000000 +0200
@@ -271,26 +271,58 @@ static int debug;
 static __u16 vendor = FTDI_VID;
 static __u16 product;
 
+struct ftdi_private {
+	ftdi_chip_type_t chip_type;
+				/* type of the device, either SIO or FT8U232AM */
+	int baud_base;		/* baud base clock for divisor setting */
+	int custom_divisor;	/* custom_divisor kludge, this is for baud_base (different from what goes to the chip!) */
+	__u16 last_set_data_urb_value ;
+				/* the last data state set - needed for doing a break */
+        int write_offset;       /* This is the offset in the usb data block to write the serial data -
+				 * it is different between devices
+				 */
+	int flags;		/* some ASYNC_xxxx flags are supported */
+	unsigned long last_dtr_rts;	/* saved modem control outputs */
+        wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
+	char prev_status, diff_status;        /* Used for TIOCMIWAIT */
+	__u8 rx_flags;		/* receive state flags (throttling) */
+	spinlock_t rx_lock;	/* spinlock for receive state */
+	struct delayed_work rx_work;
+	struct usb_serial_port *port;
+	int rx_processed;
+	unsigned long rx_bytes;
+
+	__u16 interface;	/* FT2232C port interface (0 for FT232/245) */
+
+	int force_baud;		/* if non-zero, force the baud rate to this value */
+	int force_rtscts;	/* if non-zero, force RTS-CTS to always be enabled */
+
+	spinlock_t tx_lock;	/* spinlock for transmit state */
+	unsigned long tx_bytes;
+	unsigned long tx_outstanding_bytes;
+	unsigned long tx_outstanding_urbs;
+};
+
 /* struct ftdi_sio_quirk is used by devices requiring special attention. */
 struct ftdi_sio_quirk {
 	int (*probe)(struct usb_serial *);
-	void (*setup)(struct usb_serial *); /* Special settings during startup. */
+	void (*port_probe)(struct ftdi_private *); /* Special settings for probed ports. */
 };
 
 static int   ftdi_olimex_probe		(struct usb_serial *serial);
-static void  ftdi_USB_UIRT_setup	(struct usb_serial *serial);
-static void  ftdi_HE_TIRA1_setup	(struct usb_serial *serial);
+static void  ftdi_USB_UIRT_setup	(struct ftdi_private *priv);
+static void  ftdi_HE_TIRA1_setup	(struct ftdi_private *priv);
 
 static struct ftdi_sio_quirk ftdi_olimex_quirk = {
 	.probe	= ftdi_olimex_probe,
 };
 
 static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
-	.setup = ftdi_USB_UIRT_setup,
+	.port_probe = ftdi_USB_UIRT_setup,
 };
 
 static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
-	.setup = ftdi_HE_TIRA1_setup,
+	.port_probe = ftdi_HE_TIRA1_setup,
 };
 
 /*
@@ -566,38 +598,6 @@ static const char *ftdi_chip_name[] = {
 #define THROTTLED		0x01
 #define ACTUALLY_THROTTLED	0x02
 
-struct ftdi_private {
-	ftdi_chip_type_t chip_type;
-				/* type of the device, either SIO or FT8U232AM */
-	int baud_base;		/* baud base clock for divisor setting */
-	int custom_divisor;	/* custom_divisor kludge, this is for baud_base (different from what goes to the chip!) */
-	__u16 last_set_data_urb_value ;
-				/* the last data state set - needed for doing a break */
-        int write_offset;       /* This is the offset in the usb data block to write the serial data -
-				 * it is different between devices
-				 */
-	int flags;		/* some ASYNC_xxxx flags are supported */
-	unsigned long last_dtr_rts;	/* saved modem control outputs */
-        wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
-	char prev_status, diff_status;        /* Used for TIOCMIWAIT */
-	__u8 rx_flags;		/* receive state flags (throttling) */
-	spinlock_t rx_lock;	/* spinlock for receive state */
-	struct delayed_work rx_work;
-	struct usb_serial_port *port;
-	int rx_processed;
-	unsigned long rx_bytes;
-
-	__u16 interface;	/* FT2232C port interface (0 for FT232/245) */
-
-	int force_baud;		/* if non-zero, force the baud rate to this value */
-	int force_rtscts;	/* if non-zero, force RTS-CTS to always be enabled */
-
-	spinlock_t tx_lock;	/* spinlock for transmit state */
-	unsigned long tx_bytes;
-	unsigned long tx_outstanding_bytes;
-	unsigned long tx_outstanding_urbs;
-};
-
 /* Used for TIOCMIWAIT */
 #define FTDI_STATUS_B0_MASK	(FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD)
 #define FTDI_STATUS_B1_MASK	(FTDI_RS_BI)
@@ -608,7 +608,6 @@ struct ftdi_private {
 
 /* function prototypes for a FTDI serial converter */
 static int  ftdi_sio_probe	(struct usb_serial *serial, const struct usb_device_id *id);
-static int  ftdi_sio_attach		(struct usb_serial *serial);
 static void ftdi_shutdown		(struct usb_serial *serial);
 static int  ftdi_sio_port_probe	(struct usb_serial_port *port);
 static int  ftdi_sio_port_remove	(struct usb_serial_port *port);
@@ -662,7 +661,6 @@ static struct usb_serial_driver ftdi_sio
 	.ioctl =		ftdi_ioctl,
 	.set_termios =		ftdi_set_termios,
 	.break_ctl =		ftdi_break_ctl,
-	.attach =		ftdi_sio_attach,
 	.shutdown =		ftdi_shutdown,
 };
 
@@ -1197,6 +1195,8 @@ static int ftdi_sio_probe (struct usb_se
 static int ftdi_sio_port_probe(struct usb_serial_port *port)
 {
 	struct ftdi_private *priv;
+	struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial);
+
 
 	dbg("%s",__FUNCTION__);
 
@@ -1213,6 +1213,9 @@ static int ftdi_sio_port_probe(struct us
 	   than queue a task to deliver them */
 	priv->flags = ASYNC_LOW_LATENCY;
 
+	if (quirk && quirk->port_probe)
+		quirk->port_probe(priv);
+
 	/* Increase the size of read buffers */
 	kfree(port->bulk_in_buffer);
 	port->bulk_in_buffer = kmalloc (BUFSZ, GFP_KERNEL);
@@ -1243,29 +1246,13 @@ static int ftdi_sio_port_probe(struct us
 	return 0;
 }
 
-/* attach subroutine */
-static int ftdi_sio_attach (struct usb_serial *serial)
-{
-	/* Check for device requiring special set up. */
-	struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial);
-
-	if (quirk && quirk->setup)
-		quirk->setup(serial);
-
-	return 0;
-} /* ftdi_sio_attach */
-
-
 /* Setup for the USB-UIRT device, which requires hardwired
  * baudrate (38400 gets mapped to 312500) */
 /* Called from usbserial:serial_probe */
-static void ftdi_USB_UIRT_setup (struct usb_serial *serial)
+static void ftdi_USB_UIRT_setup (struct ftdi_private *priv)
 {
-	struct ftdi_private *priv;
-
 	dbg("%s",__FUNCTION__);
 
-	priv = usb_get_serial_port_data(serial->port[0]);
 	priv->flags |= ASYNC_SPD_CUST;
 	priv->custom_divisor = 77;
 	priv->force_baud = B38400;
@@ -1273,13 +1260,10 @@ static void ftdi_USB_UIRT_setup (struct 
 
 /* Setup for the HE-TIRA1 device, which requires hardwired
  * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled.  */
-static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
+static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv)
 {
-	struct ftdi_private *priv;
-
 	dbg("%s",__FUNCTION__);
 
-	priv = usb_get_serial_port_data(serial->port[0]);
 	priv->flags |= ASYNC_SPD_CUST;
 	priv->custom_divisor = 240;
 	priv->force_baud = B38400;

Comment 12 Ted Logan 2007-06-04 13:01:31 UTC
Sorry, I can't really try it.  I have fedora's 2.6.21 kernel and I
have to leave the machine working for 2 months, so I can't
experiment:)

However, I did try 2.6.21.3 and it had same problem.


On 6/4/07, Oliver Neukum <oliver@neukum.org> wrote:
> Am Sonntag, 3. Juni 2007 00:53 schrieb John H.:
> > Oliver, can you tell me what I might do to get it working again for
> > now?  I can't use usb-uirt without it.
>
> Does this patch fix the issue?
>
>         Regards
>                 Oliver
> ----
>
> --- linux-2.6.22-rc3/drivers/usb/serial/ftdi_sio.c.alt  2007-06-04 10:38:45.000000000 +0200
> +++ linux-2.6.22-rc3/drivers/usb/serial/ftdi_sio.c      2007-06-04 11:06:27.000000000 +0200
> @@ -271,26 +271,58 @@ static int debug;
>  static __u16 vendor = FTDI_VID;
>  static __u16 product;
>
> +struct ftdi_private {
> +       ftdi_chip_type_t chip_type;
> +                               /* type of the device, either SIO or FT8U232AM */
> +       int baud_base;          /* baud base clock for divisor setting */
> +       int custom_divisor;     /* custom_divisor kludge, this is for baud_base (different from what goes to the chip!) */
> +       __u16 last_set_data_urb_value ;
> +                               /* the last data state set - needed for doing a break */
> +        int write_offset;       /* This is the offset in the usb data block to write the serial data -
> +                                * it is different between devices
> +                                */
> +       int flags;              /* some ASYNC_xxxx flags are supported */
> +       unsigned long last_dtr_rts;     /* saved modem control outputs */
> +        wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
> +       char prev_status, diff_status;        /* Used for TIOCMIWAIT */
> +       __u8 rx_flags;          /* receive state flags (throttling) */
> +       spinlock_t rx_lock;     /* spinlock for receive state */
> +       struct delayed_work rx_work;
> +       struct usb_serial_port *port;
> +       int rx_processed;
> +       unsigned long rx_bytes;
> +
> +       __u16 interface;        /* FT2232C port interface (0 for FT232/245) */
> +
> +       int force_baud;         /* if non-zero, force the baud rate to this value */
> +       int force_rtscts;       /* if non-zero, force RTS-CTS to always be enabled */
> +
> +       spinlock_t tx_lock;     /* spinlock for transmit state */
> +       unsigned long tx_bytes;
> +       unsigned long tx_outstanding_bytes;
> +       unsigned long tx_outstanding_urbs;
> +};
> +
>  /* struct ftdi_sio_quirk is used by devices requiring special attention. */
>  struct ftdi_sio_quirk {
>         int (*probe)(struct usb_serial *);
> -       void (*setup)(struct usb_serial *); /* Special settings during startup. */
> +       void (*port_probe)(struct ftdi_private *); /* Special settings for probed ports. */
>  };
>
>  static int   ftdi_olimex_probe         (struct usb_serial *serial);
> -static void  ftdi_USB_UIRT_setup       (struct usb_serial *serial);
> -static void  ftdi_HE_TIRA1_setup       (struct usb_serial *serial);
> +static void  ftdi_USB_UIRT_setup       (struct ftdi_private *priv);
> +static void  ftdi_HE_TIRA1_setup       (struct ftdi_private *priv);
>
>  static struct ftdi_sio_quirk ftdi_olimex_quirk = {
>         .probe  = ftdi_olimex_probe,
>  };
>
>  static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
> -       .setup = ftdi_USB_UIRT_setup,
> +       .port_probe = ftdi_USB_UIRT_setup,
>  };
>
>  static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
> -       .setup = ftdi_HE_TIRA1_setup,
> +       .port_probe = ftdi_HE_TIRA1_setup,
>  };
>
>  /*
> @@ -566,38 +598,6 @@ static const char *ftdi_chip_name[] = {
>  #define THROTTLED              0x01
>  #define ACTUALLY_THROTTLED     0x02
>
> -struct ftdi_private {
> -       ftdi_chip_type_t chip_type;
> -                               /* type of the device, either SIO or FT8U232AM */
> -       int baud_base;          /* baud base clock for divisor setting */
> -       int custom_divisor;     /* custom_divisor kludge, this is for baud_base (different from what goes to the chip!) */
> -       __u16 last_set_data_urb_value ;
> -                               /* the last data state set - needed for doing a break */
> -        int write_offset;       /* This is the offset in the usb data block to write the serial data -
> -                                * it is different between devices
> -                                */
> -       int flags;              /* some ASYNC_xxxx flags are supported */
> -       unsigned long last_dtr_rts;     /* saved modem control outputs */
> -        wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
> -       char prev_status, diff_status;        /* Used for TIOCMIWAIT */
> -       __u8 rx_flags;          /* receive state flags (throttling) */
> -       spinlock_t rx_lock;     /* spinlock for receive state */
> -       struct delayed_work rx_work;
> -       struct usb_serial_port *port;
> -       int rx_processed;
> -       unsigned long rx_bytes;
> -
> -       __u16 interface;        /* FT2232C port interface (0 for FT232/245) */
> -
> -       int force_baud;         /* if non-zero, force the baud rate to this value */
> -       int force_rtscts;       /* if non-zero, force RTS-CTS to always be enabled */
> -
> -       spinlock_t tx_lock;     /* spinlock for transmit state */
> -       unsigned long tx_bytes;
> -       unsigned long tx_outstanding_bytes;
> -       unsigned long tx_outstanding_urbs;
> -};
> -
>  /* Used for TIOCMIWAIT */
>  #define FTDI_STATUS_B0_MASK    (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI | FTDI_RS0_RLSD)
>  #define FTDI_STATUS_B1_MASK    (FTDI_RS_BI)
> @@ -608,7 +608,6 @@ struct ftdi_private {
>
>  /* function prototypes for a FTDI serial converter */
>  static int  ftdi_sio_probe     (struct usb_serial *serial, const struct usb_device_id *id);
> -static int  ftdi_sio_attach            (struct usb_serial *serial);
>  static void ftdi_shutdown              (struct usb_serial *serial);
>  static int  ftdi_sio_port_probe        (struct usb_serial_port *port);
>  static int  ftdi_sio_port_remove       (struct usb_serial_port *port);
> @@ -662,7 +661,6 @@ static struct usb_serial_driver ftdi_sio
>         .ioctl =                ftdi_ioctl,
>         .set_termios =          ftdi_set_termios,
>         .break_ctl =            ftdi_break_ctl,
> -       .attach =               ftdi_sio_attach,
>         .shutdown =             ftdi_shutdown,
>  };
>
> @@ -1197,6 +1195,8 @@ static int ftdi_sio_probe (struct usb_se
>  static int ftdi_sio_port_probe(struct usb_serial_port *port)
>  {
>         struct ftdi_private *priv;
> +       struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial);
> +
>
>         dbg("%s",__FUNCTION__);
>
> @@ -1213,6 +1213,9 @@ static int ftdi_sio_port_probe(struct us
>            than queue a task to deliver them */
>         priv->flags = ASYNC_LOW_LATENCY;
>
> +       if (quirk && quirk->port_probe)
> +               quirk->port_probe(priv);
> +
>         /* Increase the size of read buffers */
>         kfree(port->bulk_in_buffer);
>         port->bulk_in_buffer = kmalloc (BUFSZ, GFP_KERNEL);
> @@ -1243,29 +1246,13 @@ static int ftdi_sio_port_probe(struct us
>         return 0;
>  }
>
> -/* attach subroutine */
> -static int ftdi_sio_attach (struct usb_serial *serial)
> -{
> -       /* Check for device requiring special set up. */
> -       struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial);
> -
> -       if (quirk && quirk->setup)
> -               quirk->setup(serial);
> -
> -       return 0;
> -} /* ftdi_sio_attach */
> -
> -
>  /* Setup for the USB-UIRT device, which requires hardwired
>   * baudrate (38400 gets mapped to 312500) */
>  /* Called from usbserial:serial_probe */
> -static void ftdi_USB_UIRT_setup (struct usb_serial *serial)
> +static void ftdi_USB_UIRT_setup (struct ftdi_private *priv)
>  {
> -       struct ftdi_private *priv;
> -
>         dbg("%s",__FUNCTION__);
>
> -       priv = usb_get_serial_port_data(serial->port[0]);
>         priv->flags |= ASYNC_SPD_CUST;
>         priv->custom_divisor = 77;
>         priv->force_baud = B38400;
> @@ -1273,13 +1260,10 @@ static void ftdi_USB_UIRT_setup (struct
>
>  /* Setup for the HE-TIRA1 device, which requires hardwired
>   * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled.  */
> -static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
> +static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv)
>  {
> -       struct ftdi_private *priv;
> -
>         dbg("%s",__FUNCTION__);
>
> -       priv = usb_get_serial_port_data(serial->port[0]);
>         priv->flags |= ASYNC_SPD_CUST;
>         priv->custom_divisor = 240;
>         priv->force_baud = B38400;
>

Comment 13 Anonymous Emailer 2007-06-05 00:51:50 UTC
Reply-To: oliver@neukum.org

Am Montag, 4. Juni 2007 21:57 schrieb John H.:
> Sorry, I can't really try it.  I have fedora's 2.6.21 kernel and I
> have to leave the machine working for 2 months, so I can't
> experiment:)
> 
> However, I did try 2.6.21.3 and it had same problem.

Can you please post the oops with that version?

	Regards
		Oliver

Comment 14 Ted Logan 2007-06-06 00:41:18 UTC
Sorry, I will not have access to that machine for months.  That's why
I had to get it working before I left.

On 6/5/07, Oliver Neukum <oliver@neukum.org> wrote:
> Am Montag, 4. Juni 2007 21:57 schrieb John H.:
> > Sorry, I can't really try it.  I have fedora's 2.6.21 kernel and I
> > have to leave the machine working for 2 months, so I can't
> > experiment:)
> >
> > However, I did try 2.6.21.3 and it had same problem.
>
> Can you please post the oops with that version?
>
>         Regards
>                 Oliver
>

Comment 15 Anonymous Emailer 2007-06-06 01:34:03 UTC
Reply-To: oliver@neukum.org

Am Mittwoch, 6. Juni 2007 schrieb John H.:
> Sorry, I will not have access to that machine for months.  That's why
> I had to get it working before I left.
> 
> On 6/5/07, Oliver Neukum <oliver@neukum.org> wrote:
> > Am Montag, 4. Juni 2007 21:57 schrieb John H.:
> > > Sorry, I can't really try it.  I have fedora's 2.6.21 kernel and I
> > > have to leave the machine working for 2 months, so I can't
> > > experiment:)
> > >
> > > However, I did try 2.6.21.3 and it had same problem.
> >
> > Can you please post the oops with that version?

So you cannot and havn't tested patches?
But you can confirm that2.6.21.3 has the same bug you encountered
with an older kernel? You don't happen to have a spare device around?

	Regards
		Oliver
 

Comment 16 Terry Froy 2007-06-06 04:44:54 UTC
I have just been bitten by this bug and I believe that I have the exact same
device as John H.

(my device is a USB-UIRT2 and was purchased from
http://www.usbuirt.com/overview.htm - can't verify the relevant device IDs right
now as I upgraded all my boxen to Fedora 7 and then discovered that this didn't
work)

My kernel oops is 99% identical to that of John H's.

I am in the process of building a new kernel RPM using the patch which Oliver
kindly supplied and I'll be posting back here to report either success or
failure with my own USB-UIRT2.

I'm not subscribed to LKML so please either feel free to converse directly with
me via e-mail or via this Bugzilla entry.

Regards,
Terry
Comment 17 Ted Logan 2007-06-06 10:53:14 UTC
Before i left, I tested 2.21.3, which had a similar error, perhaps the
same, with BUG
and 2.20.12, which worked.

On 6/6/07, bugme-daemon@bugzilla.kernel.org
<bugme-daemon@bugzilla.kernel.org> wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=8564
>
>
>
>
>
> ------- Additional Comments From anonymous@kernel-bugs.osdl.org  2007-06-06 01:34 -------
> Reply-To: oliver@neukum.org
>
> Am Mittwoch, 6. Juni 2007 schrieb John H.:
> > Sorry, I will not have access to that machine for months.  That's why
> > I had to get it working before I left.
> >
> > On 6/5/07, Oliver Neukum <oliver@neukum.org> wrote:
> > > Am Montag, 4. Juni 2007 21:57 schrieb John H.:
> > > > Sorry, I can't really try it.  I have fedora's 2.6.21 kernel and I
> > > > have to leave the machine working for 2 months, so I can't
> > > > experiment:)
> > > >
> > > > However, I did try 2.6.21.3 and it had same problem.
> > >
> > > Can you please post the oops with that version?
>
> So you cannot and havn't tested patches?
> But you can confirm that2.6.21.3 has the same bug you encountered
> with an older kernel? You don't happen to have a spare device around?
>
>         Regards
>                 Oliver
>
>
>
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>

Comment 18 Shiro Hara 2007-06-08 23:17:24 UTC
Hi

I had a same problem on FC7 for using with my Tira-2.
So, I applied Oliver's patch.
This patch fix the issue!
(my rpm is based on 2.6.21.4 but I think you can use this patch for any 2.6.21.x)

many thanks.

Shiro H.

-------

--- linux-2.6.21/drivers/usb/serial/ftdi_sio.c.orig     2007-04-26
12:08:32.000000000 +0900
+++ linux-2.6.21/drivers/usb/serial/ftdi_sio.c  2007-06-09 11:21:45.000000000 +0900
@@ -271,20 +271,54 @@
 static __u16 vendor = FTDI_VID;
 static __u16 product;
 
+struct ftdi_private {
+       ftdi_chip_type_t chip_type;
+                               /* type of the device, either SIO or FT8U232AM */
+       int baud_base;          /* baud base clock for divisor setting */
+       int custom_divisor;     /* custom_divisor kludge, this is for baud_base
(different from what goes to the chip!) */
+       __u16 last_set_data_urb_value ;
+                               /* the last data state set - needed for doing a
break */
+        int write_offset;       /* This is the offset in the usb data block to
write the serial data -
+                                * it is different between devices
+                                */
+       int flags;              /* some ASYNC_xxxx flags are supported */
+       unsigned long last_dtr_rts;     /* saved modem control outputs */
+        wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
+       char prev_status, diff_status;        /* Used for TIOCMIWAIT */
+       __u8 rx_flags;          /* receive state flags (throttling) */
+       spinlock_t rx_lock;     /* spinlock for receive state */
+       struct delayed_work rx_work;
+       struct usb_serial_port *port;
+       int rx_processed;
+       unsigned long rx_bytes;
+
+       __u16 interface;        /* FT2232C port interface (0 for FT232/245) */
+
+       int force_baud;         /* if non-zero, force the baud rate to this value */
+       int force_rtscts;       /* if non-zero, force RTS-CTS to always be
enabled */
+
+       spinlock_t tx_lock;     /* spinlock for transmit state */
+       unsigned long tx_bytes;
+       unsigned long tx_outstanding_bytes;
+       unsigned long tx_outstanding_urbs;
+};
+
+
+
 /* struct ftdi_sio_quirk is used by devices requiring special attention. */
 struct ftdi_sio_quirk {
-       void (*setup)(struct usb_serial *); /* Special settings during startup. */
+       void (*port_probe)(struct ftdi_private *); /* Special settings for
probed ports. */
 };
 
-static void  ftdi_USB_UIRT_setup       (struct usb_serial *serial);
-static void  ftdi_HE_TIRA1_setup       (struct usb_serial *serial);
+static void  ftdi_USB_UIRT_setup       (struct ftdi_private *priv);
+static void  ftdi_HE_TIRA1_setup       (struct ftdi_private *priv);
 
 static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
-       .setup = ftdi_USB_UIRT_setup,
+       .port_probe = ftdi_USB_UIRT_setup,
 };
 
 static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
-       .setup = ftdi_HE_TIRA1_setup,
+       .port_probe = ftdi_HE_TIRA1_setup,
 };
 
 /*
@@ -555,38 +589,6 @@
 #define THROTTLED              0x01
 #define ACTUALLY_THROTTLED     0x02
 
-struct ftdi_private {
-       ftdi_chip_type_t chip_type;
-                               /* type of the device, either SIO or FT8U232AM */
-       int baud_base;          /* baud base clock for divisor setting */
-       int custom_divisor;     /* custom_divisor kludge, this is for baud_base
(different from what goes to the chip!) */
-       __u16 last_set_data_urb_value ;
-                               /* the last data state set - needed for doing a
break */
-        int write_offset;       /* This is the offset in the usb data block to
write the serial data -
-                                * it is different between devices
-                                */
-       int flags;              /* some ASYNC_xxxx flags are supported */
-       unsigned long last_dtr_rts;     /* saved modem control outputs */
-        wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
-       char prev_status, diff_status;        /* Used for TIOCMIWAIT */
-       __u8 rx_flags;          /* receive state flags (throttling) */
-       spinlock_t rx_lock;     /* spinlock for receive state */
-       struct delayed_work rx_work;
-       struct usb_serial_port *port;
-       int rx_processed;
-       unsigned long rx_bytes;
-
-       __u16 interface;        /* FT2232C port interface (0 for FT232/245) */
-
-       int force_baud;         /* if non-zero, force the baud rate to this value */
-       int force_rtscts;       /* if non-zero, force RTS-CTS to always be
enabled */
-
-       spinlock_t tx_lock;     /* spinlock for transmit state */
-       unsigned long tx_bytes;
-       unsigned long tx_outstanding_bytes;
-       unsigned long tx_outstanding_urbs;
-};
-
 /* Used for TIOCMIWAIT */
 #define FTDI_STATUS_B0_MASK    (FTDI_RS0_CTS | FTDI_RS0_DSR | FTDI_RS0_RI |
FTDI_RS0_RLSD)
 #define FTDI_STATUS_B1_MASK    (FTDI_RS_BI)
@@ -597,7 +599,6 @@
 
 /* function prototypes for a FTDI serial converter */
 static int  ftdi_sio_probe     (struct usb_serial *serial, const struct
usb_device_id *id);
-static int  ftdi_sio_attach            (struct usb_serial *serial);
 static void ftdi_shutdown              (struct usb_serial *serial);
 static int  ftdi_sio_port_probe        (struct usb_serial_port *port);
 static int  ftdi_sio_port_remove       (struct usb_serial_port *port);
@@ -651,7 +652,6 @@
        .ioctl =                ftdi_ioctl,
        .set_termios =          ftdi_set_termios,
        .break_ctl =            ftdi_break_ctl,
-       .attach =               ftdi_sio_attach,
        .shutdown =             ftdi_shutdown,
 };
 
@@ -1178,6 +1178,8 @@
 static int ftdi_sio_port_probe(struct usb_serial_port *port)
 {
        struct ftdi_private *priv;
+       struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial);
+
 
        dbg("%s",__FUNCTION__);
 
@@ -1193,6 +1195,9 @@
        /* This will push the characters through immediately rather
           than queue a task to deliver them */
        priv->flags = ASYNC_LOW_LATENCY;
+       if (quirk && quirk->port_probe)
+               quirk->port_probe(priv);
+
 
        /* Increase the size of read buffers */
        kfree(port->bulk_in_buffer);
@@ -1224,29 +1229,13 @@
        return 0;
 }
 
-/* attach subroutine */
-static int ftdi_sio_attach (struct usb_serial *serial)
-{
-       /* Check for device requiring special set up. */
-       struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial);
-
-       if (quirk && quirk->setup)
-               quirk->setup(serial);
-
-       return 0;
-} /* ftdi_sio_attach */
-
-
 /* Setup for the USB-UIRT device, which requires hardwired
  * baudrate (38400 gets mapped to 312500) */
 /* Called from usbserial:serial_probe */
-static void ftdi_USB_UIRT_setup (struct usb_serial *serial)
+static void ftdi_USB_UIRT_setup (struct ftdi_private *priv)
 {
-       struct ftdi_private *priv;
-
        dbg("%s",__FUNCTION__);
 
-       priv = usb_get_serial_port_data(serial->port[0]);
        priv->flags |= ASYNC_SPD_CUST;
        priv->custom_divisor = 77;
        priv->force_baud = B38400;
@@ -1254,13 +1243,10 @@
 
 /* Setup for the HE-TIRA1 device, which requires hardwired
  * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled.  */
-static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
+static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv)
 {
-       struct ftdi_private *priv;
-
        dbg("%s",__FUNCTION__);
 
-       priv = usb_get_serial_port_data(serial->port[0]);
        priv->flags |= ASYNC_SPD_CUST;
        priv->custom_divisor = 240;
        priv->force_baud = B38400;
Comment 19 Pádraig Brady 2007-07-11 09:27:32 UTC
I notice that this is still not in Linus' tree,
(and 2.6.22 has been released already).
I have a Tira-2 which crashed with F7.
I will test the above patch, and reply if it doesn't work.
Comment 20 Chuck Ebbert 2007-07-19 14:04:16 UTC
Fix committed in mainline: 0ffbbe25a73db12792a05f725aa39f8a5de2c882

I don't have the power to close this...
Comment 21 Ted Logan 2007-08-12 01:10:12 UTC
The problem still exists, albeit in a different form,
Linux home 2.6.22.1-41.fc7 #1 SMP Fri Jul 27 18:10:34 EDT 2007 i686 i686 i386 GNU/Linux

lircd: tty_setdtr: ioctl(TIOCMGET) failed
lircd: tty_setdtr: Bad address
lircd: uirt2_raw: could not set DTR
lircd: tty_setdtr: ioctl(TIOCMGET) failed
lircd: tty_setdtr: Bad address
lircd: caught signal
Terminated

The lirc author says
This is a problem of the ftdi_sio driver.
> ftdi_tiocmget is obviously not implemented for your hardware.
> You should report this to the driver authors.
>
> Christoph

Is there at least some patch that enables me to use the device again for now?
Comment 22 Ted Logan 2007-08-16 00:32:02 UTC
This is from bill ryder, the original devel...

----
Actually I just downloaded the 2.6.22.2 kernel and had a look at that driver.

I'm pretty certain now you have a device I don't have and hence can't check out a fix for at all.

However - you can probably patch it yourself

First you want to

dmesg  | grep Detected

after you have plugged in whatever it is you are using (or after booting your system).

For my device I get:

drivers/usb/serial/ftdi_sio.c: Detected FT8U232AM

The chip type is FT8U232AM for me. That is supported.

I'm guessing you are a FT232RL

Maybe it will work just by adding

case FT232RL:

to the ftdi_tiocmget function  (under case FT2232C:)

If that doesn't work then you really are in trouble because the chip isn't talking in the same way as the other ones and FTDI may not have released the spec.

If all of that works you can just request that change to the linux usb developers mailing list since it's a safe one line change.

As I say I don't maintain the driver at all any more and don't have time to work on it (and only have very old devices for testing anyway).

Good luck!
Comment 23 Ted Logan 2007-08-16 21:30:48 UTC
So I again did what I specified in the bug report

Used the ftdi_sio.h and ftdi_sio.c from 
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.20.y.git;a=tree;f=drivers/usb/serial;h=535edb4ac2d4c6b03bd3ca641c44aae8013b4dd9;hb=fcfbb42bd476ed54b598d917d3b9b63d8835093e



With kernel
 uname -a
Linux home 2.6.22.1-41.fc7 #1 SMP Fri Jul 27 18:10:34 EDT 2007 i686 i686 i386 GNU/Linux

And it works with 2.6.22.1-41.  Apparently sometime after that kernel the driver has been broken for usb-uirt, pretty much ever since.
Comment 24 Richie 2007-10-19 19:40:12 UTC
original symptoms for lircd process (after starting irw):
# lircd --nodaemon /etc/lirc/lircd.conf
lircd: lircd(usb_uirt_raw) ready
lircd: accepted new client on /dev/lircd
lircd: uirt2_raw: did not receive results
lircd: uirt2_raw: UIRT version 0905 ok
lircd: uirt2_raw: could not set DTR
lircd: caught signal
Terminated

#modification of ftdi_tiocmget function from 2.6.22.6

static int ftdi_tiocmget (struct usb_serial_port *port, struct file *file)
{
        struct ftdi_private *priv = usb_get_serial_port_data(port);
        unsigned char buf[2];
        int ret;

        dbg("%s TIOCMGET", __FUNCTION__);
        switch (priv->chip_type) {
        case SIO:
                /* Request the status from the device */
                if ((ret = usb_control_msg(port->serial->dev,
                                           usb_rcvctrlpipe(port->serial->dev, 0),
                                           FTDI_SIO_GET_MODEM_STATUS_REQUEST,
                                           FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
                                           0, 0,
                                           buf, 1, WDR_TIMEOUT)) < 0 ) {
                        err("%s Could not get modem status of device - err: %d", __FUNCTION__,
                            ret);
                        return(ret);
                }
                break;

        case FT8U232AM:
        case FT232BM:
        case FT2232C:
	/* bill ryder suggested change */
	case FT232RL:
	/* end change */
                /* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same
                   format as the data returned from the in point */
                if ((ret = usb_control_msg(port->serial->dev,
                                           usb_rcvctrlpipe(port->serial->dev, 0),
                                           FTDI_SIO_GET_MODEM_STATUS_REQUEST,
                                           FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
                                           0, priv->interface,
                                           buf, 2, WDR_TIMEOUT)) < 0 ) {
                        err("%s Could not get modem status of device - err: %d", __FUNCTION__,
                            ret);
                        return(ret);
                }
                break;
        default:
                return -EFAULT;
                break;
        }

        return  (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
                (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
                (buf[0]  & FTDI_SIO_RI_MASK  ? TIOCM_RI  : 0) |
                (buf[0]  & FTDI_SIO_RLSD_MASK ? TIOCM_CD  : 0) |
                priv->last_dtr_rts;
}

term 1
# lircd --nodaemon /etc/lirc/lircd.conf 
lircd: lircd(usb_uirt_raw) ready
lircd: accepted new client on /dev/lircd
lircd: uirt2_raw: did not receive results
lircd: uirt2_raw: UIRT version 0905 ok

term 2
# irw
00000000000017a5 00 OK Hauppauge_350
00000000000017a5 01 OK Hauppauge_350
00000000000017a5 02 OK Hauppauge_350
0000000000001797 00 Right Hauppauge_350
0000000000001797 01 Right Hauppauge_350

Now it appears to work but I've posted to this bug because I do a "did not receive results" message and more importantly i'm sure there are others out there that would like to see a final fix (if not already in latter
kernels)