[regression] Kobil card reader doesn't work with Hardy

Bug #183109 reported by Harald Seipp
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Stefan Bader

Bug Description

The USB-attached Kobil Kaan Standard Plus cardreader that worked with all pre-Gusty releases does no longer work with Hardy - tested with Alpha 3. Note that it only worked on Gutsy with a patch - for details see #128228.
With Hardy Alpha 3, the driver does not load with the following error:
[ 88.125806] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for KOBIL USB smart card terminal
[ 88.125858] kobil: probe of 4-1:1.0 failed with error -5
[ 88.125880] usbcore: registered new interface driver kobil
[ 88.125885] /build/buildd/linux-2.6.24/drivers/usb/serial/kobil_sct.c: 21/05/2004 KOBIL Systems GmbH - http://www.kobil.com
[ 88.125890] /build/buildd/linux-2.6.24/drivers/usb/serial/kobil_sct.c: KOBIL USB Smart Card Terminal Driver (experimental)

Note that on the same machine, the device works perfectly with the patched Gutsy Kernel.

Revision history for this message
Harald Seipp (hseipp) wrote :
Revision history for this message
Harald Seipp (hseipp) wrote :
Revision history for this message
Harald Seipp (hseipp) wrote :
Revision history for this message
Harald Seipp (hseipp) wrote :
Revision history for this message
Harald Seipp (hseipp) wrote :
Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Ben Collins (ben-collins) wrote :

There seems to be only one functional change in that diff:

+ port->tty->termios->c_cflag &= ~CMSPAR;
+ tty_encode_baud_rate(port->tty, speed, speed);

Stefan, could you try commenting this out and providing a test build for the bug submitter, to see if that actually fixes the problem?

Changed in linux:
assignee: ubuntu-kernel-team → stefan-bader-canonical
status: Triaged → In Progress
Revision history for this message
Harald Seipp (hseipp) wrote :

Ben, thanks for your investigations. I actually see one more functional difference, the new code added setting the speed variable within the baud rate case statement in kobil_set_termios().

- case 9600:
   default:
+ speed = 9600;
+ case 9600:

It looks like the speed variable was never properly initialized within that function - maybe the latest code is broken because the lines Ben pointed out above now _really use_ that variable?
A patched binary kernel module (generic kernel on IX86) for testing would be perfect as I can only test with the Hardy live CD. I would then unload the driver loaded during boot and then load the patched one.
If it's possible to properly build the Hardy kernel on a Gutsy machine, I can do that on my own. I would pull the Hardy kernel source using the live CD and copy the code together with the Hardy kernel configuration from /boot to my Gutsy system, then compile the kernel there. Finally I would unload/load the kernel module on the Hardy Live CD system.

Revision history for this message
Harald Seipp (hseipp) wrote :

Forget my previous post, I overlooked that the speed variable is set by the tty_get_baud_rate() function.
However, I was able to set up a build system with the Hardy live CD to test commenting out the lines as recommended by Ben above. That _did not_ change anything - still getting the error.
When loading the kobil_sct as well as the usb-serial module with debug options, I got the following more detailed error message:
Jan 24 07:24:51 ubuntu kernel: [ 1671.564211] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for KOBIL USB smart card terminal
Jan 24 07:24:51 ubuntu kernel: [ 1671.564245] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: static descriptor matches
Jan 24 07:24:51 ubuntu kernel: [ 1671.564255] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: found interrupt out on endpoint 0
Jan 24 07:24:51 ubuntu kernel: [ 1671.564261] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: found interrupt in on endpoint 1
Jan 24 07:24:51 ubuntu kernel: [ 1671.564266] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: wrong number of endpoints
Jan 24 07:24:51 ubuntu kernel: [ 1671.564276] kobil: probe of 4-1:1.0 failed with error -5

Revision history for this message
Harald Seipp (hseipp) wrote :

Debug level log on the same system using Gutsy:
Jan 24 08:59:57 localhost kernel: [ 583.811810] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: USB Serial support registered for KOBIL USB smart card terminal
Jan 24 08:59:57 localhost kernel: [ 583.812179] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: static descriptor matches
Jan 24 08:59:57 localhost kernel: [ 583.812184] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: found interrupt out on endpoint 0
Jan 24 08:59:57 localhost kernel: [ 583.812186] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: found interrupt in on endpoint 1
Jan 24 08:59:57 localhost kernel: [ 583.812189] kobil 4-1:1.0: KOBIL USB smart card terminal converter detected
Jan 24 08:59:57 localhost kernel: [ 583.812191] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: usb_serial_probe - setting up 1 port structures for this device
Jan 24 08:59:57 localhost kernel: [ 583.812196] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: the device claims to support interrupt out transfers, but write_int_callback is not defined
Jan 24 08:59:57 localhost kernel: [ 583.812200] KOBIL KAAN Standard Plus / SecOVID Reader Plus detected
Jan 24 08:59:57 localhost kernel: [ 583.812202] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: get_free_serial 1
Jan 24 08:59:57 localhost kernel: [ 583.812204] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: get_free_serial - minor base = 0
Jan 24 08:59:57 localhost kernel: [ 583.812207] /build/buildd/linux-source-2.6.22-2.6.22/drivers/usb/serial/usb-serial.c: usb_serial_probe - registering ttyUSB0
Jan 24 08:59:57 localhost kernel: [ 583.812844] usb 4-1: KOBIL USB smart card terminal converter now attached to ttyUSB0
Jan 24 08:59:57 localhost kernel: [ 583.812858] usbcore: registered new interface driver kobil
Jan 24 08:59:57 localhost kernel: [ 583.812861] /home/harald/tmp/linux-source-2.6.22/drivers/usb/serial/kobil_sct.c: 21/05/2004 KOBIL Systems GmbH - http://www.k obil.com
Jan 24 08:59:57 localhost kernel: [ 583.812863] /home/harald/tmp/linux-source-2.6.22/drivers/usb/serial/kobil_sct.c: KOBIL USB Smart Card Terminal Driver (experi mental)

Revision history for this message
Stefan Bader (smb) wrote :

If I am looking at the code correctly this might be a problem with the num_interrupts_out set in the driver. The num_interrupt_in is set to NUM_DONT_CARE but the other field will be automatically set to 0. Since you can test compile yourself, could you make the following change to kobil_sct.c? Let me know whether this helps.

Revision history for this message
Harald Seipp (hseipp) wrote :

Stefan, that did the trick!

Jan 24 20:26:13 ubuntu kernel: [ 795.453861] usbcore: registered new interface driver usbserial_generic
Jan 24 20:26:13 ubuntu kernel: [ 795.453866] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial Driver core
Jan 24 20:26:30 ubuntu kernel: [ 811.606289] kobil_sct: no version for "struct_module" found: kernel tainted.
Jan 24 20:26:30 ubuntu kernel: [ 811.610050] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for KOBIL USB smart card terminal
Jan 24 20:26:30 ubuntu kernel: [ 811.610103] kobil 4-1:1.0: KOBIL USB smart card terminal converter detected
Jan 24 20:26:30 ubuntu kernel: [ 811.610310] usb 4-1: KOBIL USB smart card terminal converter now attached to ttyUSB0
Jan 24 20:26:30 ubuntu kernel: [ 811.610331] usbcore: registered new interface driver kobil
Jan 24 20:26:30 ubuntu kernel: [ 811.610335] drivers/usb/serial/kobil_sct.c: 21/05/2004 KOBIL Systems GmbH - http://www.kobil.com
Jan 24 20:26:30 ubuntu kernel: [ 811.610344] drivers/usb/serial/kobil_sct.c: KOBIL USB Smart Card Terminal Driver (experimental)

Even the userspace card test application is now running successfully (here: reset):
Going to call CT_init
CT_init (Port 1): 0
CT_Reset: 0
CT_data Aufruf mit: 20 10 00 00
CT_data: 0
Antwort: 90 00

Revision history for this message
Harald Seipp (hseipp) wrote :

Just tested Stefan's patch with a high-level application (Moneyplex 2004) - works fine! I hope the patch will still make it into Hardy Alpha 4!

Revision history for this message
Stefan Bader (smb) wrote :

Found and fixed one missing field in usb_serial_driver. Fix committed as "UBUNTU: Fix usb_serial_driver structure for Kobil cardreader driver."

Changed in linux:
status: In Progress → Fix Committed
Revision history for this message
Harald Seipp (hseipp) wrote :

Tested (kubuntu) Hardy Alpha 4 - the fix is _not_ included.
Behavior is Identical to Alpha 3 :-(

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (52.1 KiB)

This bug was fixed in the package linux - 2.6.24-6.10

---------------
linux (2.6.24-6.10) hardy; urgency=low

  [Alessio Igor Bogani]

  * rt: Synced with upstream, removed old kvm related patches and updated
    configurations files.

  [Chuck Short]

  * SAUCE: Enable Xen

  [Soren Hansen]

  * Update kvm driver to kvm-60.
  * Added CONFIG_ARCH_SUPPORTS_KVM=y for lpia, i386, and amd64
  * Add rtl8139 driver to -virtual flavour

  [Stefan Bader]

  * Fix usb_serial_driver structure for Kobil cardreader driver.
    - LP: #183109
  * Lower warning level of pci resource allocation messages.
    - LP: #159241

  [Tim Gardner]

  * Enabled CONFIG_BLK_DEV_IDE_PMAC
    - LP: #185862
  * Add virtio config options to lpiacompat.
  * SAUCE: Export symbols for aufs (in lum).
  * Enabled Xen

  [Upstream Kernel Changes]

  * KVM: mmu: add missing dirty page tracking cases
  * KVM: Move virtualization deactivation from CPU_DEAD state to
    CPU_DOWN_PREPARE
  * KVM: Cosmetics
  * KVM: vmx: hack set_cr0_no_modeswitch() to actually do modeswitch
  * KVM: Use ARRAY_SIZE macro instead of manual calculation.
  * KVM: Use page_private()/set_page_private() apis
  * KVM: add MSR based hypercall API
  * KVM: Add host hypercall support for vmx
  * KVM: Add hypercall host support for svm
  * KVM: Wire up hypercall handlers to a central arch-independent location
  * KVM: svm: init cr0 with the wp bit set
  * KVM: SVM: intercept SMI to handle it at host level
  * KVM: More 0 -> NULL conversions
  * kvm, dirty pages log: adding some calls to mark_page_dirty()
  * KVM: Add internal filesystem for generating inodes
  * KVM: Create an inode per virtual machine
  * KVM: Rename some kvm_dev_ioctl_*() functions to kvm_vm_ioctl_*()
  * KVM: Move kvm_vm_ioctl_create_vcpu() around
  * KVM: Per-vcpu inodes
  * KVM: Bump API version
  * .gitignore: ignore emacs backup files (*~)
  * kvm: dirty pages log: fix bitmap size/access calculation
  * kvm: move do_remove_write_access() up
  * kvm: dirty page logging: remove write access permissions when
    dirty-page-logging is enabled
  * KVM: Add missing calls to mark_page_dirty()
  * KVM: Fix dirty page log bitmap size/access calculation
  * kvm: move do_remove_write_access() up
  * KVM: Remove write access permissions when dirty-page-logging is enabled
  * KVM: Fix bogus failure in kvm.ko module initialization
  * KVM: Move kvmfs magic number to <linux/magic.h>
  * KVM: Unset kvm_arch_ops if arch module loading failed
  * KVM: Fix guest register corruption on paravirt hypercall
  * KVM: Use the generic skip_emulated_instruction() in hypercall code
  * KVM: Use own minor number
  * KVM: Fix guest sysenter on vmx
  * KVM: Export <linux/kvm.h>
  * KVM: Fix bogus sign extension in mmu mapping audit
  * KVM: MMU: Fix guest writes to nonpae pde
  * KVM: MMU: Fix host memory corruption on i386 with >= 4GB ram
  * KVM: trivial whitespace fixes
  * KVM: always reload segment selectors
  * KVM: Remove extraneous guest entry on mmio read
  * added KVM_GET_MEM_MAP ioctl to get the memory bitmap for a memory slot
  * KVM: Prevent system selectors leaking into guest on real->protected
    mode transition on vmx
  * KVM: Use a shared page for ker...

Changed in linux:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.