1. 08 5月, 2012 1 次提交
  2. 04 1月, 2012 1 次提交
  3. 10 3月, 2011 1 次提交
    • T
      sound: Use sound_register_*() for additional OSS minor devices · 848669da
      Takashi Iwai 提交于
      Since OSS driver creates the device entries for /dev/audio* and
      /dev/dspW* by itself without coping with sound_core, it leads to
      conflicts with others and let sysfs spewing warnings.
      
      This patch rewrites the registration part of OSS driver to use
      the standard method also for additional minor devices.
      
      Reported-by: Steven Rostedt <rostedt@goodmis.org> (with ktest.pl)
      Tested-by: Steven Rostedt <rostedt@goodmis.org> (with ktest.pl)
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      848669da
  4. 18 11月, 2010 1 次提交
  5. 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
  6. 12 7月, 2010 1 次提交
    • A
      sound: push BKL into open functions · 90dc763f
      Arnd Bergmann 提交于
      This moves the lock_kernel() call from soundcore_open
      to the individual OSS device drivers, where we can deal
      with it one driver at a time if needed, or just kill
      off the drivers.
      
      All core components in ALSA already provide
      adequate locking in their open()-functions
      and do not require the big kernel lock, so
      there is no need to add the BKL there.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      90dc763f
  7. 06 7月, 2010 1 次提交
  8. 15 1月, 2010 1 次提交
  9. 04 12月, 2009 1 次提交
  10. 20 9月, 2009 1 次提交
  11. 10 8月, 2009 2 次提交
    • T
      sound: make OSS device number claiming optional and schedule its removal · 93fe4483
      Tejun Heo 提交于
      If any OSS support is enabled, regardless of built-in or module,
      sound_core claims full OSS major number (that is, the old 0-255
      region) to trap open attempts and request sound modules using custom
      module aliases.  This feature is redundant as chrdev already has such
      mechanism.  This preemptive claiming prevents alternative OSS
      implementation.
      
      The custom module aliases are scheduled to be removed and the previous
      patch made soundcore emit the standard chrdev aliases too to help
      transition.
      
      This patch schedule the feature for removal in a year and makes it
      optional so that developers and distros can try new things in the
      meantime without rebuilding the kernel.  The pre-claiming can be
      turned off by using SOUND_OSS_CORE_PRECLAIM and/or kernel parameter
      soundcore.preclaim_oss.
      
      As this allows sound minors to be individually grabbed by other users,
      this patch updates sound_insert_unit() such that if registering
      individual device region fails, it tries the next available slot.
      
      For details on removal plan, please read the entry added by this patch
      in feature-removal-schedule.txt .
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      93fe4483
    • T
      sound: request char-major-* module aliases for missing OSS devices · 0a848680
      Tejun Heo 提交于
      Till now missing OSS devices emitted sound-slot/service-* module
      alises instead of the standard char-major-* if a missing device number
      is opened if soundcore is loaded.  The custom module aliases don't
      have any inherent benefit than backward compatibility.
      
      sound-slot/service-* module aliases is scheduled to be removed and to
      help the transition this patch makes soundcore emit the standard
      module alises along with the custom ones.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      0a848680
  12. 04 7月, 2009 1 次提交
  13. 16 6月, 2009 1 次提交
  14. 15 12月, 2008 1 次提交
  15. 21 11月, 2008 1 次提交
  16. 27 10月, 2008 1 次提交
  17. 17 10月, 2008 1 次提交
  18. 09 9月, 2008 1 次提交
  19. 29 8月, 2008 1 次提交
    • T
      sound: make OSS sound core optional · d886e87c
      Tejun Heo 提交于
      sound/sound_core.c implements soundcore.ko and contains two parts -
      sound_class which is shared by both ALSA and OSS and device
      redirection support for OSS.  It's always compiled when any sound
      support is enabled although it's necessary only when OSS (the actual
      one or emulation) is enabled.  This is slightly wasteful and as device
      redirection always registers character device region for major 14, it
      prevents alternative implementation.
      
      This patch introduces a new config SOUND_OSS_CORE which is selected
      iff OSS support is actually necessary and build the OSS core part
      conditionally.
      
      If OSS is disabled, soundcore merely contains sound_class but leaving
      it that way seems to be the simplest approach as otherwise sound_class
      should be in ALSA core file if OSS is disabled but should be in
      soundcore if OSS is enabled.  Also, there's also the user confusion
      factor.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NJaroslav Kysela <perex@perex.cz>
      d886e87c
  20. 22 7月, 2008 1 次提交
  21. 21 6月, 2008 1 次提交
  22. 13 2月, 2007 1 次提交
  23. 02 12月, 2006 1 次提交
  24. 04 10月, 2006 1 次提交
  25. 30 9月, 2006 1 次提交
  26. 01 7月, 2006 1 次提交
  27. 27 6月, 2006 1 次提交
  28. 29 3月, 2006 1 次提交
  29. 29 10月, 2005 1 次提交
  30. 30 8月, 2005 1 次提交
  31. 21 6月, 2005 1 次提交
  32. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4