25 Oct, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (365 commits)
    ALSA: hda - Disable sticky PCM stream assignment for AD codecs
    ALSA: usb - Creative USB X-Fi volume knob support
    ALSA: ca0106: Use card specific dac id for mute controls.
    ALSA: ca0106: Allow different sound cards to use different SPI channel mappings.
    ALSA: ca0106: Create a nice spot for mapping channels to dacs.
    ALSA: ca0106: Move enabling of front dac out of hardcoded setup sequence.
    ALSA: ca0106: Pull out dac powering routine into separate function.
    ALSA: ca0106 - add Sound Blaster 5.1vx info.
    ASoC: tlv320dac33: Use usleep_range for delays
    ALSA: usb-audio: add Novation Launchpad support
    ALSA: hda - Add workarounds for CT-IBG controllers
    ALSA: hda - Fix wrong TLV mute bit for STAC/IDT codecs
    ASoC: tpa6130a2: Error handling for broken chip
    ASoC: max98088: Staticise m98088_eq_band
    ASoC: soc-core: Fix codec->name memory leak
    ALSA: hda - Apply ideapad quirk to Acer laptops with Cxt5066
    ALSA: hda - Add some workarounds for Creative IBG
    ALSA: hda - Fix wrong SPDIF NID assignment for CA0110
    ALSA: hda - Fix codec rename rules for ALC662-compatible codecs
    ALSA: hda - Add alc_init_jacks() call to other codecs
    ...

    Linus Torvalds
     

23 Oct, 2010

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (31 commits)
    driver core: Display error codes when class suspend fails
    Driver core: Add section count to memory_block struct
    Driver core: Add mutex for adding/removing memory blocks
    Driver core: Move find_memory_block routine
    hpilo: Despecificate driver from iLO generation
    driver core: Convert link_mem_sections to use find_memory_block_hinted.
    driver core: Introduce find_memory_block_hinted which utilizes kset_find_obj_hinted.
    kobject: Introduce kset_find_obj_hinted.
    driver core: fix build for CONFIG_BLOCK not enabled
    driver-core: base: change to new flag variable
    sysfs: only access bin file vm_ops with the active lock
    sysfs: Fail bin file mmap if vma close is implemented.
    FW_LOADER: fix kconfig dependency warning on HOTPLUG
    uio: Statically allocate uio_class and use class .dev_attrs.
    uio: Support 2^MINOR_BITS minors
    uio: Cleanup irq handling.
    uio: Don't clear driver data
    uio: Fix lack of locking in init_uio_class
    SYSFS: Allow boot time switching between deprecated and modern sysfs layout
    driver core: remove CONFIG_SYSFS_DEPRECATED_V2 but keep it for block devices
    ...

    Linus Torvalds
     
  • * 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    vfs: make no_llseek the default
    vfs: don't use BKL in default_llseek
    llseek: automatically add .llseek fop
    libfs: use generic_file_llseek for simple_attr
    mac80211: disallow seeks in minstrel debug code
    lirc: make chardev nonseekable
    viotape: use noop_llseek
    raw: use explicit llseek file operations
    ibmasmfs: use generic_file_llseek
    spufs: use llseek in all file operations
    arm/omap: use generic_file_llseek in iommu_debug
    lkdtm: use generic_file_llseek in debugfs
    net/wireless: use generic_file_llseek in debugfs
    drm: use noop_llseek

    Linus Torvalds
     
  • This patch removes the old CONFIG_SYSFS_DEPRECATED_V2 config option,
    but it keeps the logic around to handle block devices in the old manner
    as some people like to run new kernel versions on old (pre 2007/2008)
    distros.

    Signed-off-by: Kay Sievers
    Cc: Jens Axboe
    Cc: Stephen Hemminger
    Cc: "Eric W. Biederman"
    Cc: Alan Stern
    Cc: "James E.J. Bottomley"
    Cc: Andrew Morton
    Cc: Alexey Kuznetsov
    Cc: Randy Dunlap
    Cc: Tejun Heo
    Cc: "David S. Miller"
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

17 Oct, 2010

2 commits


15 Oct, 2010

1 commit

  • 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(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ 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)
    {

    }

    @ 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)
    {

    }

    @ 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: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann
     

11 Oct, 2010

3 commits


29 Sep, 2010

1 commit

  • The snd_ctl_new() function in sound/core/control.c allocates space for a
    snd_kcontrol struct by performing arithmetic operations on a
    user-provided size without checking for integer overflow. If a user
    provides a large enough size, an overflow will occur, the allocated
    chunk will be too small, and a second user-influenced value will be
    written repeatedly past the bounds of this chunk. This code is
    reachable by unprivileged users who have permission to open
    a /dev/snd/controlC* device (on many distros, this is group "audio") via
    the SNDRV_CTL_IOCTL_ELEM_ADD and SNDRV_CTL_IOCTL_ELEM_REPLACE ioctls.

    Signed-off-by: Dan Rosenberg
    Cc:
    Signed-off-by: Takashi Iwai

    Dan Rosenberg
     

17 Sep, 2010

2 commits


16 Sep, 2010

1 commit


14 Sep, 2010

1 commit


09 Sep, 2010

2 commits


08 Sep, 2010

1 commit

  • The error handling in snd_seq_oss_open() has several bad codes that
    do dereferecing released pointers and double-free of kmalloc'ed data.
    The object dp is release in free_devinfo() that is called via
    private_free callback. The rest shouldn't touch this object any more.

    The patch changes delete_port() to call kfree() in any case, and gets
    rid of unnecessary calls of destructors in snd_seq_oss_open().

    Fixes CVE-2010-3080.

    Reported-and-tested-by: Tavis Ormandy
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

07 Sep, 2010

1 commit


04 Sep, 2010

1 commit


28 Aug, 2010

1 commit

  • There were some new formats added in commit 15c0cee6c809 "ALSA: pcm:
    Define G723 3-bit and 5-bit formats". That commit increased
    SNDRV_PCM_FORMAT_LAST as well. My concern is that there are a couple
    places which do:

    for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
    if (dummy->pcm_hw.formats & (1ULL << i))
    snd_iprintf(buffer, " %s", snd_pcm_format_name(i));
    }

    I haven't tested these but it looks like if "i" were equal to
    SNDRV_PCM_FORMAT_G723_24 or higher then we might read past the end of
    the array.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     

19 Aug, 2010

1 commit

  • The current code in pcm_lib.c do all checks using only the position
    in the ring buffer. Unfortunately, where the interrupts gets delayed or
    merged into one, we need another timing source to check when the
    buffer size boundary overlaps to avoid the wrong updating of the
    ring buffer pointers.

    This code uses jiffies to check the right time window without any
    performance impact.

    Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     

18 Aug, 2010

2 commits

  • The current code in pcm_lib.c do all checks using only the position
    in the ring buffer. Unfortunately, where the interrupts gets delayed or
    merged into one, we need another timing source to check when the
    buffer size boundary overlaps to avoid the wrong updating of the
    ring buffer pointers.

    This code uses jiffies to check the right time window without any
    performance impact.

    Signed-off-by: Jaroslav Kysela
    Signed-off-by: Takashi Iwai

    Jaroslav Kysela
     
  • With some hardware combinations, the PCM interrupts are acknowledged
    before the period boundary from the emu10k1 chip. The midlevel PCM code
    gets confused and the playback stream is interrupted.

    It seems that the interrupt processing shift by 2 samples is enough
    to fix this issue. This default value does not harm other,
    non-affected hardware.

    More information: Kernel bugzilla bug#16300

    [A copmile warning fixed by tiwai]

    Signed-off-by: Jaroslav Kysela
    Cc:
    Signed-off-by: Takashi Iwai

    Jaroslav Kysela
     

08 Aug, 2010

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (214 commits)
    ALSA: hda - Add pin-fix for HP dc5750
    ALSA: als4000: Fix potentially invalid DMA mode setup
    ALSA: als4000: enable burst mode
    ALSA: hda - Fix initial capsrc selection in patch_alc269()
    ASoC: TWL4030: Capture route runtime DAPM ordering fix
    ALSA: hda - Add PC-beep whitelist for an Intel board
    ALSA: hda - More relax for pending period handling
    ALSA: hda - Define AC_FMT_* constants
    ALSA: hda - Fix beep frequency on IDT 92HD73xx and 92HD71Bxx codecs
    ALSA: hda - Add support for HDMI HBR passthrough
    ALSA: hda - Set Stream Type in Stream Format according to AES0
    ALSA: hda - Fix Thinkpad X300 so SPDIF is not exposed
    ALSA: hda - FIX to not expose SPDIF on Thinkpad X301, since it does not have the ability to use SPDIF
    ASoC: wm9081: fix resource reclaim in wm9081_register error path
    ASoC: wm8978: fix a memory leak if a wm8978_register fail
    ASoC: wm8974: fix a memory leak if another WM8974 is registered
    ASoC: wm8961: fix resource reclaim in wm8961_register error path
    ASoC: wm8955: fix resource reclaim in wm8955_register error path
    ASoC: wm8940: fix a memory leak if wm8940_register return error
    ASoC: wm8904: fix resource reclaim in wm8904_register error path
    ...

    Linus Torvalds
     

19 Jul, 2010

3 commits


05 Jul, 2010

1 commit


28 Jun, 2010

1 commit

  • When using poll() to wait for the next period -- or avail_min samples --
    one gets a consistent delay for each system call that is usually just a
    little short of the selected period time. However, When using
    snd_pcm_read/write(), one gets a jittery delay that alternates between
    less than a millisecond and approximately two period times. This is
    caused by snd_pcm_lib_{read,write}1() transferring any available samples
    to the user's buffer and adjusting the application pointer prior to
    sleeping to the end of the current period. When the next period
    interrupt occurs, there is then less than avail_min samples remaining to
    be transferred in the period, so we end up sleeping until a second
    period occurs.

    This is solved by using runtime->twake as the number of samples needed
    for a wakeup in addition to selecting the proper wait queue to wake in
    snd_pcm_update_state(). This requires twake to be non-zero when used
    by snd_pcm_lib_{read,write}1() even if avail_min is zero.

    Signed-off-by: Dave Dillow
    Signed-off-by: Jaroslav Kysela

    David Dillow
     

31 May, 2010

1 commit

  • This defines the 24bps and 40bps (8khz sample rate) G.723 codec
    formats. They are going to be used once I submit the driver for
    an mpeg4/g723 compression card.

    I've updated the signed value to -1 as per Takashi's comments
    since these are non-linear formats.

    Signed-off-by: Ben Collins
    Signed-off-by: Takashi Iwai

    Ben Collins
     

26 May, 2010

1 commit

  • In the cleanup of the hw_ptr update functions in 2.6.33, the calculation
    of the delta value was changed to use the modulo operator to protect
    against a negative difference due to the pointer wrapping around at the
    boundary.

    However, the ptr variables are unsigned, so a negative difference would
    result in the two complement's value which has no relation to the actual
    difference relative to the boundary; the result is typically some value
    near LONG_MAX-boundary. Furthermore, even if the modulo operation would
    be done with signed types, the result of a negative dividend could be
    negative.

    The invalid delta value is then caught by the following checks, but this
    means that the pointer update is ignored.

    To fix this, use a range check as in the other pointer calculations.

    Signed-off-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

21 May, 2010

3 commits

  • Commit 7910b4a1db63fefc3d291853d33c34c5b6352e8e in 2.6.34 changed the
    runtime->boundary calculation to make this value a multiple of both the
    buffer_size and the period_size, because the latter is assumed by the
    runtime->hw_ptr_interrupt calculation.

    However, due to the lack of a ioctl that could read the software
    parameters before they are set, the kernel requires that alsa-lib
    calculates the boundary value, too. The changed algorithm leads to
    a different boundary value used by alsa-lib, which makes, e.g., mplayer
    fail to play a 44.1 kHz file because the silence_size parameter is now
    invalid; bug report:
    .

    This patch reverts the change to the boundary calculation, and instead
    fixes the hw_ptr_interrupt calculation to be period-aligned regardless
    of the boundary value.

    Signed-off-by: Clemens Ladisch
    Cc:
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (250 commits)
    ALSA: hda: Storage class should be before const qualifier
    ASoC: tpa6130a2: Remove CPVSS and HPVdd supplies
    ASoC: tpa6130a2: Define output pins with SND_SOC_DAPM_OUTPUT
    ASoC: sdp4430 - add sdp4430 pcm ops to DAI.
    ASoC: TWL6040: Enable earphone path in codec
    ASoC: SDP4430: Add support for Earphone speaker
    ASoC: SDP4430: Add sdp4430 machine driver
    ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
    ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
    ALSA: sound/pci/asihpi: Use kzalloc
    ALSA: hdmi - dont fail on extra nodes
    ALSA: intelhdmi - add id for the CougarPoint chipset
    ALSA: intelhdmi - user friendly codec name
    ALSA: intelhdmi - add dependency on SND_DYNAMIC_MINORS
    ALSA: asihpi: incorrect range check
    ALSA: asihpi: testing the wrong variable
    ALSA: es1688: add pedantic range checks
    ARM: McBSP: Add support for omap4 in McBSP driver
    ARM: McBSP: Fix request for irq in OMAP4
    OMAP: McBSP: Add 32-bit mode support
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PM: PM QOS update fix
    Freezer / cgroup freezer: Update stale locking comments
    PM / platform_bus: Allow runtime PM by default
    i2c: Fix bus-level power management callbacks
    PM QOS update
    PM / Hibernate: Fix block_io.c printk warning
    PM / Hibernate: Group swap ops
    PM / Hibernate: Move the first_sector out of swsusp_write
    PM / Hibernate: Separate block_io
    PM / Hibernate: Snapshot cleanup
    FS / libfs: Implement simple_write_to_buffer
    PM / Hibernate: document open(/dev/snapshot) side effects
    PM / Runtime: Add sysfs debug files
    PM: Improve device power management document
    PM: Update device power management document
    PM: Allow runtime_suspend methods to call pm_schedule_suspend()
    PM: pm_wakeup - switch to using bool

    Linus Torvalds
     

20 May, 2010

3 commits


12 May, 2010

1 commit

  • MIPS non-coherent archs need the noncached pgprot in mmap of PCM buffers.
    But, since the coherency needs to be checked dynamically via
    plat_device_is_coherent(), we need an ugly check dependent on MIPS
    in ALSA core code.

    This should be cleaned up in MIPS arch side (e.g. creating
    dma_mmap_coherent()) in near future.

    Tested-by: Wu Zhangjin
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

11 May, 2010

1 commit

  • This patch changes the string based list management to a handle base
    implementation to help with the hot path use of pm-qos, it also renames
    much of the API to use "request" as opposed to "requirement" that was
    used in the initial implementation. I did this because request more
    accurately represents what it actually does.

    Also, I added a string based ABI for users wanting to use a string
    interface. So if the user writes 0xDDDDDDDD formatted hex it will be
    accepted by the interface. (someone asked me for it and I don't think
    it hurts anything.)

    This patch updates some documentation input I got from Randy.

    Signed-off-by: markgross
    Signed-off-by: Rafael J. Wysocki

    Mark Gross