1. 03 8月, 2009 1 次提交
    • L
      ALSA: pcm - Tell user that stream to be rewound is suspended · 51840409
      Lubomir Rintel 提交于
      Return STRPIPE instead of EBADF when userspace attempts to rewind
      of forward a stream that was suspended in meanwhile, so that it
      can be recovered by snd_pcm_recover().
      
      This was causing Pulseaudio to unload the ALSA sink module under a race
      condition when it attempted to rewind the stream right after resume from
      suspend, before writing to the stream which would cause it to revive the
      stream otherwise. Tested to work with Pulseaudio patched to attempt to
      snd_pcm_recover() upon receiving an error from snd_pcm_rewind().
      Signed-off-by: NLubomir Rintel <lkundrak@v3.sk>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      51840409
  2. 20 7月, 2009 1 次提交
    • J
      ALSA: OSS sequencer should be initialized after snd_seq_system_client_init · f96e0808
      Jaswinder Singh Rajput 提交于
      When build SND_SEQUENCER in kernel then OSS sequencer(alsa_seq_oss_init)
      is initialized before System (snd_seq_system_client_init) which leads to
      memory leak :
      
      unreferenced object 0xf6b0e680 (size 256):
        comm "swapper", pid 1, jiffies 4294670753
        backtrace:
          [<c108ac5c>] create_object+0x135/0x204
          [<c108adfe>] kmemleak_alloc+0x26/0x4c
          [<c1087de2>] kmem_cache_alloc+0x72/0xff
          [<c126d2ac>] seq_create_client1+0x22/0x160
          [<c126e3b6>] snd_seq_create_kernel_client+0x72/0xef
          [<c1485a05>] snd_seq_oss_create_client+0x86/0x142
          [<c1485920>] alsa_seq_oss_init+0xf6/0x155
          [<c1001059>] do_one_initcall+0x4f/0x111
          [<c14655be>] kernel_init+0x115/0x166
          [<c10032af>] kernel_thread_helper+0x7/0x10
          [<ffffffff>] 0xffffffff
      unreferenced object 0xf688a580 (size 64):
        comm "swapper", pid 1, jiffies 4294670753
        backtrace:
          [<c108ac5c>] create_object+0x135/0x204
          [<c108adfe>] kmemleak_alloc+0x26/0x4c
          [<c1087de2>] kmem_cache_alloc+0x72/0xff
          [<c126f964>] snd_seq_pool_new+0x1c/0xb8
          [<c126d311>] seq_create_client1+0x87/0x160
          [<c126e3b6>] snd_seq_create_kernel_client+0x72/0xef
          [<c1485a05>] snd_seq_oss_create_client+0x86/0x142
          [<c1485920>] alsa_seq_oss_init+0xf6/0x155
          [<c1001059>] do_one_initcall+0x4f/0x111
          [<c14655be>] kernel_init+0x115/0x166
          [<c10032af>] kernel_thread_helper+0x7/0x10
          [<ffffffff>] 0xffffffff
      unreferenced object 0xf6b0e480 (size 256):
        comm "swapper", pid 1, jiffies 4294670754
        backtrace:
          [<c108ac5c>] create_object+0x135/0x204
          [<c108adfe>] kmemleak_alloc+0x26/0x4c
          [<c1087de2>] kmem_cache_alloc+0x72/0xff
          [<c12725a0>] snd_seq_create_port+0x51/0x21c
          [<c126de50>] snd_seq_ioctl_create_port+0x57/0x13c
          [<c126d07a>] snd_seq_do_ioctl+0x4a/0x69
          [<c126d0de>] snd_seq_kernel_client_ctl+0x33/0x49
          [<c1485a74>] snd_seq_oss_create_client+0xf5/0x142
          [<c1485920>] alsa_seq_oss_init+0xf6/0x155
          [<c1001059>] do_one_initcall+0x4f/0x111
          [<c14655be>] kernel_init+0x115/0x166
          [<c10032af>] kernel_thread_helper+0x7/0x10
          [<ffffffff>] 0xffffffff
      
      The correct order should be :
      
      System (snd_seq_system_client_init) should be initialized before
      OSS sequencer(alsa_seq_oss_init) which is equivalent to :
      
      1. insmod sound/core/seq/snd-seq-device.ko
      2. insmod sound/core/seq/snd-seq.ko
      3. insmod sound/core/seq/snd-seq-midi-event.ko
      4. insmod sound/core/seq/oss/snd-seq-oss.ko
      
      Including sound/core/seq/oss/Makefile after other seq modules
      fixes the ordering and memory leak.
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f96e0808
  3. 22 6月, 2009 2 次提交
  4. 11 6月, 2009 1 次提交
    • K
      ALSA: use card device as parent for jack input-devices · 1f3fff7b
      Kay Sievers 提交于
      This moves the jack devices from the PCI device into the ALSA card device, which
      makes it easier for userspace to find all devices belonging to a specific card
      while granting access to logged-in users.
      
      Jack input devices from sound cards can now simply be matched with udev by doing:
        SUBSYSTEM="input", SUBSYSTEMS="sound", ...
      
       ls -l /sys/devices/pci0000:00/0000:00:1b.0/sound/card0
       controlC0
       device -> ../../../0000:00:1b.0
       id
       input10
       input11
       input8
       input9
       number
       pcmC0D0c
       pcmC0D0p
       pcmC0D1p
       power
       subsystem -> ../../../../../class/sound
       uevent
      
      Cc: Lennart Poettering <lennart@0pointer.de>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      1f3fff7b
  5. 08 6月, 2009 1 次提交
  6. 07 6月, 2009 2 次提交
  7. 05 6月, 2009 1 次提交
  8. 04 6月, 2009 2 次提交
    • J
      ALSA: Core - clean up snd_card_set_id* calls and remove possible id collision · 5fdc18d9
      Jaroslav Kysela 提交于
      Move locking outside snd_card_set_id_internal() function and rename it
      to snd_card_set_id_no_lock() for better function description.
      
      User defined id is just copied to card structure at allocation time.
      The real unique id procedure is called in snd_card_register() to
      ensure real atomicity.
      Signed-off-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      5fdc18d9
    • M
      ALSA: Fix double locking of card list in snd_card_register() · 872c7820
      Mark Brown 提交于
      The introduction of snd_card_set_id() added a lock on the card list
      to the old choose_default_id() function when using it to implement
      the new API call. This lock is needed to allow us to walk the list
      and check to see if our new name is a duplicate. Unfortunately this
      causes a lockup when called from snd_card_register() (in cases
      where no ID is supplied for the card) since the card list is already
      locked there.
      
      Fix this fairly hideously by factoring out the implementation and
      using a flag to indicate if the lock should be held. A better fix
      would probably be to refactor snd_card_register() to move the
      _set_id() outside the locking region but I can't immediately see
      anything I can convince myself is safe.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      872c7820
  9. 02 6月, 2009 1 次提交
    • J
      ALSA: Core - add snd_card_set_id() function · 10a8ebbb
      Jaroslav Kysela 提交于
      Introduce snd_card_set_id() function to allow lowlevel drivers to set
      default identification name for card slot. The function checks also
      for identification name collisions and tries to create unique name.
      
      Also, the snd_card_create() function is simplified, because this new
      function is used. As bonus, proper name collision checks are evaluated
      at the card create time.
      Signed-off-by: NJaroslav Kysela <perex@perex.cz>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      10a8ebbb
  10. 29 5月, 2009 5 次提交
  11. 27 5月, 2009 2 次提交
    • T
      ALSA: Enable PCM hw_ptr_jiffies check only in xrun_debug mode · c87d9732
      Takashi Iwai 提交于
      The PCM hw_ptr jiffies check results sometimes in problems when a
      hardware doesn't give smooth hw_ptr updates.  So far, au88x0 and some
      other drivers appear not working due to this strict check.
      However, this check is a nice debug tool, and the capability should be
      still kept.
      
      Hence, we disable this check now as default unless the user enables it
      by setting the xrun_debug mode to the specific stream via a proc file.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c87d9732
    • T
      ALSA: Fix invalid jiffies check after pause · 6af3fb72
      Takashi Iwai 提交于
      The hw_ptr_jiffies has to be reset properly to avoid the invalid
      check of jiffies delta in snd_pcm_update_hw_ptr*() functions.
      Especailly this patch fixes the bogus jiffies check after the puase
      and resume.
      
      This patch is a modified version of the original patch by Jaroslav.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      6af3fb72
  12. 05 5月, 2009 1 次提交
  13. 28 4月, 2009 1 次提交
    • T
      ALSA: pcm core - Avoid jiffies check for devices with BATCH flag · 3e5b5016
      Takashi Iwai 提交于
      The hardware devices with SNDRV_PCM_INFO_BATCH flag can't give the
      precise current position.  And such hardwares have often big FIFO
      in addition to the ring buffer, and it screws up the jiffies check
      in pcm_lib.c.
      
      This patch adds a simple check of info flag so that the driver skips
      the jiffies check in snd_pcm_period_elapsed() when BATCH flag is set.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3e5b5016
  14. 14 4月, 2009 2 次提交
  15. 10 4月, 2009 1 次提交
  16. 07 4月, 2009 1 次提交
  17. 31 3月, 2009 1 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
  18. 20 3月, 2009 1 次提交
  19. 19 3月, 2009 4 次提交
  20. 18 3月, 2009 3 次提交
  21. 16 3月, 2009 2 次提交
    • J
      Rationalize fasync return values · 60aa4924
      Jonathan Corbet 提交于
      Most fasync implementations do something like:
      
           return fasync_helper(...);
      
      But fasync_helper() will return a positive value at times - a feature used
      in at least one place.  Thus, a number of other drivers do:
      
           err = fasync_helper(...);
           if (err < 0)
                   return err;
           return 0;
      
      In the interests of consistency and more concise code, it makes sense to
      map positive return values onto zero where ->fasync() is called.
      
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      60aa4924
    • J
      Use f_lock to protect f_flags · db1dd4d3
      Jonathan Corbet 提交于
      Traditionally, changes to struct file->f_flags have been done under BKL
      protection, or with no protection at all.  This patch causes all f_flags
      changes after file open/creation time to be done under protection of
      f_lock.  This allows the removal of some BKL usage and fixes a number of
      longstanding (if microscopic) races.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      db1dd4d3
  22. 09 3月, 2009 4 次提交