[pvrusb2] ANOTHER New driver snapshot: pvrusb2-mci-20100425

Mike Isely isely at isely.net
Sun Apr 25 18:38:19 CDT 2010


A new pvrusb2 driver snapshot is available.  The changes are all bug
fixes - some latent issues, some triggered by the upcoming kernel
release:

  (+) Fix race condition during tear-down of the sysfs interface.
      This bug apparently has been present forever but only became
      malignant with the 2.6.34 kernel.  Nodes under
      /sys/class/pvrusb2 are represented by kernel device structures.
      The /sys/class/pvrusb2 head however is mapped by a kernel
      "class" structure.  Each underlying device structure points back
      to the class but there's no protection in the kernel against
      cases where the class might get deleted while the device
      instances are still around.  Thus the device instances can end
      up pointing to deleted memory if this is not guarded by the
      driver.  From looking at the kernel code there appears to be an
      assumption that a class definition is logically static compared
      to the device instances.  So, change the pvrusb2 driver to not
      delete the /sys/class/pvrusb2 parent until after everything else
      in the driver has been shut down first (and thus the device
      instances freed).

  (+) Increase sysfs attribute array size by one.  This is an array of
      pointers; its size is learned by the kernel by noticing a
      trailing null pointer.  We weren't allowing enough space for the
      worse case.  Again, this hadn't been causing any outward
      symptoms, yet.

  (+) Perform correct reference counting of the usb device pointer as
      referenced through the sysfs interface.  This hadn't been
      causing any outward symptoms, yet...

  (+) Call sysfs_attr_init() on all sysfs attributes - this is
      something new for kernel 2.6.34 or later.  Failing to do this
      generates a lot of noise in the kernel log.

  (+) Add missing #include <linux/slab.h> to pvrusb2-v4l2.c that
      apparently wasn't a real problem until compiling with the 2.6.34
      kernel.

Since this comes on the heels of another snapshot released yesterday,
here's the list for yesterday as well - these are also almost all bug
fixes:

  (+) Fix kernel oops caused by touching deleted memory after
      unregistration.  This bug was introduced when we had started
      using video_device_node_name() to generate the device name.
      Rearranged the code a bit to let video_device_node_name() to do
      its thing before we actually unregister the device.

  (+) Implement ability to mark support for specific devices as being
      experimental.  The Terratec Grabster AV400 is one such device
      (note that it isn't yet listed in any of the pvrusb2
      documentation either).

  (+) Avoid use of stack-allocated memory for USB buffer I/O.  The
      pvrusb2 driver has been doing this without issue for years; only
      now has this apparently become a problem in the Linux kernel.
      With the 2.6.34 kernel, stack-based USB buffers generate nasty
      messages to the kernel log.

  (+) Fix operation of RF tuner with Gotview hardware.  This bug was
      introduced back when the driver implemented the sub-device model
      of module control.  The root cause was that the tda9887 module
      needs to be explicitly loaded with the new model (with the old
      model it was automatic), and I had missed with this the Gotview
      device definition.

You'd think for a driver that's been around this long and which has
been reasonably stable that I wouldn't have such a sudden pile of bugs
to deal with here.  But, well, here it is...

There are still some other things I should be able to get into the
driver immediately (including a patch sent to me long ago and then
forgotten until a few hours ago).  There's also a few niggling little
details I'd like to fix up before proceeding with any bigger stuff,
but I thought it important enough to get these bug fixes out there
now.

As usual, the pvrusb2 web site can be found at:

  http://www.isely.net/pvrusb2/pvrusb2.html

  -Mike

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


More information about the pvrusb2 mailing list