1. 06 7月, 2012 1 次提交
  2. 14 5月, 2012 1 次提交
    • H
      [media] v4l2-dev: add flag to have the core lock all file operations · 5126f259
      Hans Verkuil 提交于
      This used to be the default if the lock pointer was set, but now that lock is by
      default only used for ioctl serialization. Those drivers that already used
      core locking have this flag set explicitly, except for some drivers where
      it was obvious that there was no need to serialize any file operations other
      than ioctl.
      
      The drivers that didn't need this flag were:
      
      drivers/media/radio/dsbr100.c
      drivers/media/radio/radio-isa.c
      drivers/media/radio/radio-keene.c
      drivers/media/radio/radio-miropcm20.c
      drivers/media/radio/radio-mr800.c
      drivers/media/radio/radio-tea5764.c
      drivers/media/radio/radio-timb.c
      drivers/media/video/vivi.c
      sound/i2c/other/tea575x-tuner.c
      
      The other drivers that use core locking and where it was not immediately
      obvious that this flag wasn't needed were changed so that the flag is set
      together with a comment that that driver needs work to avoid having to
      set that flag. This will often involve taking the core lock in the fops
      themselves.
      
      Eventually this flag should go and it should not be used in new drivers.
      
      There are a few reasons why we want to avoid core locking of non-ioctl
      fops: in the case of mmap this can lead to a deadlock in rare situations
      since when mmap is called the mmap_sem is held and it is possible for
      other parts of the code to take that lock as well (copy_from_user()/copy_to_user()
      perform a down_read(&mm->mmap_sem) when a page fault occurs).
      
      It is very unlikely that that happens since the core lock serializes all
      fops, but the kernel warns about it if lock validation is turned on.
      
      For poll it is also undesirable to take the core lock as that can introduce
      increased latency. The same is true for read/write.
      
      While it was possible to make flags or something to turn on/off taking the
      core lock for each file operation, in practice it is much simpler to just
      not take it at all except for ioctl and leave it to the driver to take the
      lock. There are only a handful fops compared to the zillion ioctls we have.
      
      I also wanted to make it obvious which drivers still take the lock for all
      fops, so that's why I chose to have drivers set it explicitly.
      Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      5126f259
  3. 08 5月, 2012 1 次提交
  4. 28 7月, 2011 1 次提交
    • M
      [media] Stop using linux/version.h on most video drivers · 1990d50b
      Mauro Carvalho Chehab 提交于
      All the modified drivers didn't have any version increment since
      Jan, 1 2011. Several of them didn't have any version increment
      for a long time, even having new features and important bug fixes
      happening.
      
      As we're now filling the QUERYCAP version with the current Kernel
      Release, we don't need to maintain a per-driver version control
      anymore. So, let's just use the default.
      
      In order to preserve the Kernel module version history, a
      KERNEL_VERSION() macro were added to all modified drivers, and
      the extraver number were incremented.
      
      I opted to preserve the per-driver version control to a few
      pwc, pvrusb2, s2255, s5p-fimc and sh_vou.
      
      A few drivers are still using the legacy way to handle ioctl's.
      So, we can't do such change on them, otherwise, they'll break.
      Those are: uvc, et61x251 and sn9c102.
      
      The rationale is that the per-driver version control seems to be
      actively maintained on those.
      
      Yet, I think that the better for them would be to just use the
      default version numbering, instead of doing that by themselves.
      
      While here, removed a few uneeded include linux/version.h
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      1990d50b
  5. 26 5月, 2011 1 次提交
  6. 20 5月, 2011 1 次提交
  7. 23 3月, 2011 1 次提交
  8. 22 3月, 2011 1 次提交
  9. 19 1月, 2011 1 次提交
  10. 29 12月, 2010 1 次提交
  11. 21 10月, 2010 1 次提交
  12. 19 5月, 2010 1 次提交
  13. 16 12月, 2009 3 次提交
  14. 17 6月, 2009 1 次提交
  15. 30 3月, 2009 1 次提交
  16. 03 1月, 2009 2 次提交
  17. 30 12月, 2008 2 次提交
  18. 22 10月, 2008 1 次提交
    • H
      V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d · c6330fb8
      Hans Verkuil 提交于
      The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
      independent of the minor number. So instead of using the minor field
      of the video_device struct one has to use the num field: this always
      contains the kernel number of the device node.
      
      I forgot about this when I did the v4l2 core change, so this patch
      converts all drivers that use it in one go. Luckily the change is
      trivial.
      
      Cc: michael@mihu.de
      Cc: mchehab@infradead.org
      Cc: corbet@lwn.net
      Cc: luca.risolia@studio.unibo.it
      Cc: isely@pobox.com
      Cc: pe1rxq@amsat.org
      Cc: royale@zerezo.com
      Cc: mkrufky@linuxtv.org
      Cc: stoth@linuxtv.org
      Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      c6330fb8
  19. 12 10月, 2008 1 次提交
  20. 04 9月, 2008 2 次提交
  21. 27 7月, 2008 1 次提交
  22. 26 7月, 2008 1 次提交
  23. 24 7月, 2008 1 次提交
  24. 25 4月, 2008 1 次提交
  25. 22 10月, 2007 1 次提交
  26. 10 10月, 2007 1 次提交
  27. 19 7月, 2007 1 次提交
  28. 13 2月, 2007 1 次提交
  29. 01 7月, 2006 1 次提交
  30. 25 6月, 2006 2 次提交
    • J
      V4L/DVB (4154): Fix use-after-free bug in cpia2 driver · bafefc0c
      Jesper Juhl 提交于
      The coverity checker detected a use-after-free error in
      drivers/media/video/cpia2/cpia2_v4l.c::cpia2_close() (coverity
      error #1281).
      What happens is that we lock cam->busy_lock, then proceed to free
      resources, and in the case of (--cam->open_count == 0) we finish off by
      doing a kfree(cam) and then at the end of the function we do a
      mutex_unlock(&cam->busy_lock) which will explode since it'll dereference
      the free'd `cam' :
      ...
      mutex_lock(&cam->busy_lock);
      ...
      if (--cam->open_count == 0) {
          ...
          if (!cam->present) {
              video_unregister_device(dev);
              kfree(cam);
          }
      }
      mutex_unlock(&cam->busy_lock);   <--- PROBLEM, cam no longer around.
      ...
      Since this only happens in the case of open_count going down to zero I
      don't see a problem with just releasing the mutex after unregistering the
      device and just before the kfree().  In this case there is nothing around
      that we can race against; we are in the release method, open_count is zero,
      (!cam->present) and the device has just been unregistered, so letting go of
      the mutex at this point looks safe to me.
      Patch below to implement that solution.
      Acked-by: NRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
      bafefc0c
    • T
      657de3cd
  31. 25 3月, 2006 1 次提交
  32. 08 3月, 2006 1 次提交
  33. 03 3月, 2006 1 次提交
  34. 27 2月, 2006 1 次提交
    • A
      V4L/DVB (3376): Add cpia2 camera support · ab33d507
      Alan Cox 提交于
      There has been a CPIA2 driver out of kernel for a long time and it has
      been pretty clean for some time too. This is an import of the
      sourceforge driver which has been stripped of
      - 2.4 back compatibility
      - 2.4 old style MJPEG ioctls
      A couple of functions have been made static and the docs have been
      repackaged into Documentation/video4linux.  The rvmalloc/free functions now
      match the cpia driver again.  Other than that this is the code as is.
      Tested on x86-64 with a QX5 microscope.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
      ab33d507