1. 24 2月, 2018 1 次提交
  2. 23 2月, 2018 3 次提交
  3. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  4. 29 12月, 2017 2 次提交
  5. 28 12月, 2017 1 次提交
    • S
      media: videobuf2: Add new uAPI for DVB streaming I/O · 57868acc
      Satendra Singh Thakur 提交于
      Adds a new uAPI for DVB to use streaming I/O which is implemented
      based on videobuf2, using those new ioctls:
      
      - DMX_REQBUFS:  Request kernel to allocate buffers which count and size
      	        are dedicated by user.
      - DMX_QUERYBUF: Get the buffer information like a memory offset which
      		will mmap() and be shared with user-space.
      - DMX_EXPBUF:   Just for testing whether buffer-exporting success or not.
      - DMX_QBUF:     Pass the buffer to kernel-space.
      - DMX_DQBUF:    Get back the buffer which may contain TS data.
      
      Originally developed by: Junghak Sung <jh1009.sung@samsung.com>, as
      seen at:
      	https://patchwork.linuxtv.org/patch/31613/
      	https://patchwork.kernel.org/patch/7334301/
      
      The original patch was written before merging VB2-core functionalities
      upstream. When such series was added, several adjustments were made,
      fixing some issues with	V4L2, causing the original patch to be
      non-trivially rebased.
      
      After rebased, a few bugs in the patch were fixed. The patch was
      also enhanced it and polling functionality got added.
      
      The main changes over the original patch are:
      
      dvb_vb2_fill_buffer():
      	- Set the size of the outgoing buffer after while loop using
      	  vb2_set_plane_payload;
      
      	- Added NULL check for source buffer as per normal convention
      	  of demux driver, this is called twice, first time with valid
      	  buffer second time with NULL pointer, if its not handled,
      	  it will result in  crash
      
      	- Restricted spinlock for only list_* operations
      
      dvb_vb2_init():
      	- Restricted q->io_modes to only VB2_MMAP as its the only
      	  supported mode
      
      dvb_vb2_release():
      	- Replaced the && in if condiion with &, because otherwise
      	  it was always getting satisfied.
      
      dvb_vb2_stream_off():
      	- Added list_del code for enqueud buffers upon stream off
      
      dvb_vb2_poll():
      	- Added this new function in order to support polling
      
      dvb_demux_poll() and dvb_dvr_poll()
      	- dvb_vb2_poll() is now called from these functions
      
      - Ported this patch and latest videobuf2 to lower kernel versions and
        tested auto scan.
      Co-developed-by: NJunghak Sung <jh1009.sung@samsung.com>
      
      [mchehab@s-opensource.com: checkpatch fixes]
      Signed-off-by: NJunghak Sung <jh1009.sung@samsung.com>
      Signed-off-by: NGeunyoung Kim <nenggun.kim@samsung.com>
      Acked-by: NSeung-Woo Kim <sw0312.kim@samsung.com>
      Acked-by: NInki Dae <inki.dae@samsung.com>
      Signed-off-by: NSatendra Singh Thakur <satendra.t@samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      57868acc
  6. 28 11月, 2017 1 次提交
  7. 31 10月, 2017 1 次提交
  8. 05 9月, 2017 2 次提交
  9. 03 2月, 2017 1 次提交
  10. 27 1月, 2017 1 次提交
    • S
      [media] media: Drop FSF's postal address from the source code files · bcb63314
      Sakari Ailus 提交于
      Drop the FSF's postal address from the source code files that typically
      contain mostly the license text. Of the 628 removed instances, 578 are
      outdated.
      
      The patch has been created with the following command without manual edits:
      
      git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \
      	drivers/media/ include/media|while read i; do i=$i perl -e '
      open(F,"< $ENV{i}");
      $a=join("", <F>);
      $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m
      	&& $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m;
      close(F);
      open(F, "> $ENV{i}");
      print F $a;
      close(F);'; done
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      bcb63314
  11. 26 12月, 2016 1 次提交
    • T
      ktime: Cleanup ktime_set() usage · 8b0e1953
      Thomas Gleixner 提交于
      ktime_set(S,N) was required for the timespec storage type and is still
      useful for situations where a Seconds and Nanoseconds part of a time value
      needs to be converted. For anything where the Seconds argument is 0, this
      is pointless and can be replaced with a simple assignment.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      8b0e1953
  12. 25 12月, 2016 1 次提交
  13. 21 10月, 2016 2 次提交
  14. 09 7月, 2016 1 次提交
  15. 11 1月, 2016 1 次提交
  16. 07 10月, 2015 2 次提交
  17. 26 2月, 2015 1 次提交
  18. 14 2月, 2015 1 次提交
  19. 04 9月, 2014 1 次提交
  20. 02 9月, 2014 2 次提交
  21. 25 10月, 2013 1 次提交
  22. 19 6月, 2013 1 次提交
    • S
      [media] media: dmxdev: remove dvb_ringbuffer_flush() on writer side · 414abbd2
      Soeren Moch 提交于
      In dvb_ringbuffer lock-less synchronizationof reader and writer threads is done
      with separateread and write pointers. Sincedvb_ringbuffer_flush() modifies the
      read pointer, this function must not be called from the writer thread.
      This patch removes the dvb_ringbuffer_flush() calls in the dmxdev ringbuffer
      write functions, this fixes Oopses "Unable to handle kernel paging request"
      I could observe for the call chaindvb_demux_read ->dvb_dmxdev_buffer_read ->
      dvb_ringbuffer_read_user -> __copy_to_user (the reader side of the ringbuffer).
      The flush calls at the write side are not necessary anyway since ringbuffer_flush
      is also called in dvb_dmxdev_buffer_read() when an error condition is set in the
      ringbuffer.
      This patch should also be applied to stable kernels.
      Signed-off-by: NSoeren Moch <smoch@web.de>
      CC: <stable@vger.kernel.org>
      Reviewed-by: NSakari Ailus <sakari.ailus@iki.fi>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      414abbd2
  23. 08 4月, 2013 1 次提交
    • M
      [media] demux.h: Remove duplicated enum · fde04ab9
      Mauro Carvalho Chehab 提交于
      "enum dmx_ts_pes" and "typedef enum dmx_pes_type_t" are just the
      same enum declared twice, since Kernel (2.6.12). There's no reason
      to duplicate it there, and sparse complains about that:
      	drivers/media/dvb-core/dmxdev.c:600:55: warning: mixing different enum types
      So, remove the internal define, keeping just the external one.
      Internally, use only "enum dmx_ts_pes", as it is too late to drop
      dmx_pes_type_t from the userspace API.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      fde04ab9
  24. 05 3月, 2013 1 次提交
    • M
      [media] mb86a20s: change AGC tuning parameters · 17e67d4c
      Mauro Carvalho Chehab 提交于
      Use the AGC settings present on a newer device.
      The initial settings were taken from one of the first devices with
      mb86a20s, and there are several reports that this is not working
      properly on some places.
      So, instead of keeping using it, get the parameters taken from a
      newer device. Tests are welcomed.
      Tested also with cx231xx PixelView SBTVD Hybrid with no regressions
      noticed so far.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      17e67d4c
  25. 28 10月, 2012 1 次提交
  26. 14 8月, 2012 2 次提交
  27. 29 3月, 2012 1 次提交
  28. 29 12月, 2010 1 次提交
  29. 21 10月, 2010 1 次提交
  30. 19 10月, 2010 1 次提交
    • A
      dvb-core: kill the big kernel lock · 72024f1e
      Arnd Bergmann 提交于
      The dvb core only uses the big kernel lock in the open
      and ioctl functions, which means it can be replaced with
      a dvb specific mutex. Fortunately, all the ioctl functions
      go through dvb_usercopy, so we can move the serialization
      in there.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: linux-media@vger.kernel.org
      72024f1e
  31. 15 10月, 2010 1 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
  32. 03 8月, 2010 1 次提交
    • J
      V4L/DVB: DVB: fix dvr node refcounting · 1c488ea9
      Jiri Slaby 提交于
      In dvb_dvr_release, there is a test dvbdev->users==-1, but users are
      never negative. This error results in hung tasks:
        task                        PC stack   pid father
      bash          D ffffffffa000c948     0  3264   3170 0x00000000
       ffff88003aec5ce8 0000000000000086 0000000000011f80 0000000000011f80
       ffff88003aec5fd8 ffff88003aec5fd8 ffff88003b848670 0000000000011f80
       ffff88003aec5fd8 0000000000011f80 ffff88003e02a030 ffff88003b848670
      Call Trace:
       [<ffffffff813dd4a5>] dvb_dmxdev_release+0xc5/0x130
       [<ffffffff8107b750>] ? autoremove_wake_function+0x0/0x40
       [<ffffffffa00013a2>] dvb_usb_adapter_dvb_exit+0x42/0x70 [dvb_usb]
       [<ffffffffa0000525>] dvb_usb_exit+0x55/0xd0 [dvb_usb]
       [<ffffffffa00005ee>] dvb_usb_device_exit+0x4e/0x70 [dvb_usb]
       [<ffffffffa000a065>] af9015_usb_device_exit+0x55/0x60 [dvb_usb_af9015]
       [<ffffffff813a3f05>] usb_unbind_interface+0x55/0x1a0
       [<ffffffff81316000>] __device_release_driver+0x70/0xe0
      ...
      
      So check against 1 there instead.
      
      BTW why's the TODO there? Adding TODOs to the code without
      descriptions is like adding nothing.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      1c488ea9