01 May, 2015

1 commit


29 Apr, 2015

6 commits


28 Apr, 2015

2 commits

  • The OSS emulation in synth-emux helper has a potential AB/BA deadlock
    at the simultaneous closing and opening:

    close ->
    snd_seq_release() ->
    sne_seq_free_client() ->
    snd_seq_delete_all_ports(): takes client->ports_mutex ->
    port_delete() ->
    snd_emux_unuse(): takes emux->register_mutex

    open ->
    snd_seq_oss_open() ->
    snd_emux_open_seq_oss(): takes emux->register_mutex ->
    snd_seq_event_port_attach() ->
    snd_seq_create_port(): takes client->ports_mutex

    This patch addresses the deadlock by reducing the rance taking
    emux->register_mutex in snd_emux_open_seq_oss(). The lock is needed
    for the refcount handling, so move it locally. The calls in
    emux_seq.c are already with the mutex, thus they are replaced with the
    version without mutex lock/unlock.

    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Current code uses wrong mask when setting RT5645_DMIC_2_DP_GPIO12 bit,
    fix it.

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin
     

27 Apr, 2015

6 commits

  • Reported by coverity CID 1296024.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The emux-synth driver has a possible AB/BA mutex deadlock at unloading
    the emu10k1 driver:

    snd_emux_free() ->
    snd_emux_detach_seq(): mutex_lock(&emu->register_mutex) ->
    snd_seq_delete_kernel_client() ->
    snd_seq_free_client(): mutex_lock(®ister_mutex)

    snd_seq_release() ->
    snd_seq_free_client(): mutex_lock(®ister_mutex) ->
    snd_seq_delete_all_ports() ->
    snd_emux_unuse(): mutex_lock(&emu->register_mutex)

    Basically snd_emux_detach_seq() doesn't need a protection of
    emu->register_mutex as it's already being unregistered. So, we can
    get rid of this for avoiding the deadlock.

    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Some models provide too long string for the shortname that has 32bytes
    including the terminator, and it results in a non-terminated string
    exposed to the user-space. This isn't too critical, though, as the
    string is stopped at the succeeding longname string.

    This patch fixes such entries by dropping "SB" prefix (it's enough to
    fit within 32 bytes, so far). Meanwhile, it also changes strcpy()
    with strlcpy() to make sure that this kind of problem won't happen in
    future, too.

    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This patch adds the missing flag to enable "Mute-LED Mode" mixer enum
    ctl for Thinkpads that have also the software mute-LED control.

    Reported-and-tested-by: Pali Rohár
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The mute-LED mode control has the fixed on/off states that are
    supposed to remain on/off regardless of the master switch. However,
    this doesn't work actually because the vmaster hook is called in the
    vmaster code itself.

    This patch fixes it by calling the hook indirectly after checking the
    mute LED mode.

    Reported-and-tested-by: Pali Rohár
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Dell XPS13 produces a click noise at boot up, and Gabriele spotted out
    that it's triggered by the initial pin control of the mic (NID 0x19).
    This has to be set to Hi-Z Vref while the driver initializes to Vref
    80% as a normal mic.

    This patch fixes the generic parser code not to override the target
    vref if it has been already set by the driver, and adds a proper
    initialization of the target vref for this pin in the Realtek driver
    side.

    Reported-and-tested-by: Gabriele Mazzotta
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

25 Apr, 2015

2 commits

  • Pull sound fixes from Takashi Iwai:
    "Here are a few fixes that have been pending since the previous pull
    request: a regression fix for HD-audio multiple SPDIF / HDMI devices,
    several ALC256 codec fixes, a couple of i915 HDMI audio fixes, and
    various small fixes.

    Nothing exciting, just boring, but things good to have"

    * tag 'sound-fix-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda - fix headset mic detection problem for one more machine
    ALSA: hda/realtek - Fix Headphone Mic doesn't recording for ALC256
    ALSA: hda - fix "num_steps = 0" error on ALC256
    ALSA: usb-audio: Fix audio output on Roland SC-D70 sound module
    ALSA: hda - add AZX_DCAPS_I915_POWERWELL to Baytrail
    ALSA: hda - only sync BCLK to the display clock for Haswell & Broadwell
    ALSA: hda - Mute headphone pin on suspend on XPS13 9333
    sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND)
    ALSA: asound.h - use SNDRV_CTL_ELEM_ID_NAME_MAXLEN
    ALSA: hda - potential (but unlikely) uninitialized variable
    ALSA: hda - Fix regression for slave SPDIF setups
    ALSA: intel8x0: Check pci_iomap() success for DEVICE_ALI
    ALSA: hda - simplify azx_has_pm_runtime

    Linus Torvalds
     
  • Pull slave-dmaengine updates from Vinod Koul:

    - new drivers for:
    - Ingenic JZ4780 controller
    - APM X-Gene controller
    - Freescale RaidEngine device
    - Renesas USB Controller

    - remove device_alloc_chan_resources dummy handlers

    - sh driver cleanups for peri peri and related emmc and asoc patches
    as well

    - fixes and enhancements spread over the drivers

    * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits)
    dmaengine: dw: don't prompt for DW_DMAC_CORE
    dmaengine: shdmac: avoid unused variable warnings
    dmaengine: fix platform_no_drv_owner.cocci warnings
    dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe()
    dmaengine: at_xdmac: unlock spin lock before return
    dmaengine: xgene: devm_ioremap() returns NULL on error
    dmaengine: xgene: buffer overflow in xgene_dma_init_channels()
    dmaengine: usb-dmac: Fix dereferencing freed memory 'desc'
    dmaengine: sa11x0: report slave capabilities to upper layers
    dmaengine: vdma: Fix compilation warnings
    dmaengine: fsl_raid: statify fsl_re_chan_probe
    dmaengine: Driver support for FSL RaidEngine device.
    dmaengine: xgene_dma_init_ring_mngr() can be static
    Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding
    arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes
    dmaengine: Add support for APM X-Gene SoC DMA engine driver
    dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver
    dmaengine: renesas,usb-dmac: Add device tree bindings documentation
    dmaengine: edma: fixed wrongly initialized data parameter to the edma callback
    dmaengine: ste_dma40: fix implicit conversion
    ...

    Linus Torvalds
     

24 Apr, 2015

3 commits


23 Apr, 2015

2 commits


22 Apr, 2015

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here's the big char/misc driver patchset for 4.1-rc1.

    Lots of different driver subsystem updates here, nothing major, full
    details are in the shortlog.

    All of this has been in linux-next for a while"

    * tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (133 commits)
    mei: trace: remove unused TRACE_SYSTEM_STRING
    DTS: ARM: OMAP3-N900: Add lis3lv02d support
    Documentation: DT: lis302: update wakeup binding
    lis3lv02d: DT: add wakeup unit 2 and wakeup threshold
    lis3lv02d: DT: use s32 to support negative values
    Drivers: hv: hv_balloon: correctly handle num_pages>INT_MAX case
    Drivers: hv: hv_balloon: correctly handle val.freeram directory
    coresight-tmc: Adding a status interface to sysfs
    coresight: remove the unnecessary configuration coresight-default-sink
    ...

    Linus Torvalds
     

21 Apr, 2015

3 commits

  • The ALC256 does not have a mixer nid at 0x0b, and there's no
    loopback path (the output pins are directly connected to the DACs).

    This commit fixes an "num_steps = 0 for NID=0xb (ctl = Beep Playback Volume)"
    error (and as a result, problems with amixer/alsamixer).

    If there's pcbeep functionality, it certainly isn't controlled by setting an
    amp on 0x0b, so disable beep functionality (at least for now).

    Cc: stable@vger.kernel.org
    BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1446517
    Signed-off-by: David Henningsson
    Signed-off-by: Takashi Iwai

    David Henningsson
     
  • Roland SC-D70 reports its device class as vendor specific class and
    the quirk QUIRK_AUDIO_FIXED_ENDPOINT was used for audio output.

    In the quirks table the sampling rate was hard-coded to 44100 Hz
    and therefore not worked when the sound module was in 48000 Hz mode.

    In this change the quirk is changed to QUIRK_AUDIO_STANDARD_INTERFACE
    but as the sound module reports incorrect bSubframeSize in its
    descriptors, additional change is made in format.c to detect it and
    to override it (which uses the existing code for Edirol SD-90).

    Tested both when the sound module was in 44100 Hz mode and 48000 Hz
    mode and both audio input and output. MIDI related part of the driver
    is not touched.

    Signed-off-by: Takamichi Horikawa
    Signed-off-by: Takashi Iwai

    Takamichi Horikawa
     
  • This patch addes AZX_DCAPS_I915_POWERWELL to BYT (Baytrail).

    Like Braswell and Skylake, the HDMI codec on Bytrail is also in the shared
    power well with GPU. This power well must be turned on before we reset link
    to probe the codec, to avoid communication failure with the codec.

    The side effect is that this power is always ON in S0 because the BYT HDMI
    codec does not support EPSS or D3ClkStop and so the controller doesn't enter
    D3 at runtime, and the HDMI codec and analog codec share a single physical
    HD-A link and so we cannot reset the HD-A link freely when we re-enable the
    power to use the HDMI codec.

    Next step is to test if an AGP reset or double AGP reset on BYT HDMI codec is
    okay to bring the HDMI codec back to a functional state after restoring the
    power. If okay, we can bind the power on/off with the HDMI codec PM without
    interrupting the analog audio.

    Signed-off-by: Mengdong Lin
    Signed-off-by: Takashi Iwai

    Mengdong Lin
     

20 Apr, 2015

2 commits

  • Only Intel Haswell and Broadwell have a separate HD-A controller (PCI device 3)
    for display audio, which needs to get 24MHz HD-A link BCLK from the variable
    display core clock through vendor specific registers EM4 & EM5. Other platforms
    (Baytrail, Braswell and Skylake) don't have this feature.

    So this patch checks the PCI device ID of the controller in haswell_set_bclk()
    and only sync BCLK for HSW and BDW.

    Signed-off-by: Mengdong Lin
    Signed-off-by: Takashi Iwai

    Mengdong Lin
     
  • Muting the headphone output pin right before the codec suspension
    prevents pop noises when headphones are plugged in (except for a
    barely audible click noise).
    This solution allows to truly save some power when headphones are
    plugged in unlike the previous solution (033b0a7ca9c:
    "ALSA: hda - Pop noises fix for XPS13 9333")

    Signed-off-by: Gabriele Mazzotta
    Signed-off-by: Takashi Iwai

    Gabriele Mazzotta
     

18 Apr, 2015

1 commit

  • A deadlock can be initiated by userspace via ioctl(SNDCTL_SEQ_OUTOFBAND)
    on /dev/sequencer with TMR_ECHO midi event.

    In this case the control flow is:
    sound_ioctl()
    -> case SND_DEV_SEQ:
    case SND_DEV_SEQ2:
    sequencer_ioctl()
    -> case SNDCTL_SEQ_OUTOFBAND:
    spin_lock_irqsave(&lock,flags);
    play_event();
    -> case EV_TIMING:
    seq_timing_event()
    -> case TMR_ECHO:
    seq_copy_to_input()
    -> spin_lock_irqsave(&lock,flags);

    It seems that spin_lock_irqsave() around play_event() is not necessary,
    because the only other call location in seq_startplay() makes the call
    without acquiring spinlock.

    So, the patch just removes spinlocks around play_event().
    By the way, it removes unreachable code in seq_timing_event(),
    since (seq_mode == SEQ_2) case is handled in the beginning.

    Compile tested only.

    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Alexey Khoroshilov
    Signed-off-by: Takashi Iwai

    Alexey Khoroshilov
     

17 Apr, 2015

8 commits

  • It's not necessary to free memory allocated with devm_kzalloc
    and using kfree leads to a double free.

    Signed-off-by: Wei Yongjun
    Acked-by: Jarkko Nikula
    Signed-off-by: Mark Brown

    Wei Yongjun
     
  • This function is a bit unusual because it accepts negative values as
    "conn_len". It's theoretically possible for both "cache_len" and
    "conn_len" to be -ENOSPC and in that case we would oops trying to run
    memcmp() on the uninitialized "list" pointer.

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

    Dan Carpenter
     
  • In case of error, the function devm_ioremap_resource() returns
    ERR_PTR() and never returns NULL. The NULL test in the return
    value check should be replaced with IS_ERR().

    Signed-off-by: Wei Yongjun
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Wei Yongjun
     
  • In case of error, the function devm_kzalloc() returns NULL
    not ERR_PTR(). The IS_ERR() test in the return value check
    should be replaced with NULL test.

    Signed-off-by: Wei Yongjun
    Acked-by: Peter Rosin
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Wei Yongjun
     
  • We should check whether platform_get_irq() returns a negative number and
    propagate the error in this case.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Mark Brown

    Fabio Estevam
     
  • Merge third patchbomb from Andrew Morton:

    - various misc things

    - a couple of lib/ optimisations

    - provide DIV_ROUND_CLOSEST_ULL()

    - checkpatch updates

    - rtc tree

    - befs, nilfs2, hfs, hfsplus, fatfs, adfs, affs, bfs

    - ptrace fixes

    - fork() fixes

    - seccomp cleanups

    - more mmap_sem hold time reductions from Davidlohr

    * emailed patches from Andrew Morton : (138 commits)
    proc: show locks in /proc/pid/fdinfo/X
    docs: add missing and new /proc/PID/status file entries, fix typos
    drivers/rtc/rtc-at91rm9200.c: make IO endian agnostic
    Documentation/spi/spidev_test.c: fix warning
    drivers/rtc/rtc-s5m.c: allow usage on device type different than main MFD type
    .gitignore: ignore *.tar
    MAINTAINERS: add Mediatek SoC mailing list
    tomoyo: reduce mmap_sem hold for mm->exe_file
    powerpc/oprofile: reduce mmap_sem hold for exe_file
    oprofile: reduce mmap_sem hold for mm->exe_file
    mips: ip32: add platform data hooks to use DS1685 driver
    lib/Kconfig: fix up HAVE_ARCH_BITREVERSE help text
    x86: switch to using asm-generic for seccomp.h
    sparc: switch to using asm-generic for seccomp.h
    powerpc: switch to using asm-generic for seccomp.h
    parisc: switch to using asm-generic for seccomp.h
    mips: switch to using asm-generic for seccomp.h
    microblaze: use asm-generic for seccomp.h
    arm: use asm-generic for seccomp.h
    seccomp: allow COMPAT sigreturn overrides
    ...

    Linus Torvalds
     
  • Now that the kernel provides DIV_ROUND_CLOSEST_ULL(), drop the internal
    implementation and use the kernel one.

    Signed-off-by: Javi Merino
    Reported-by: kbuild test robot
    Cc: Peter Rosin
    Acked-by: Mark Brown
    Cc: Liam Girdwood
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javi Merino
     
  • Pull powerpc updates from Michael Ellerman:

    - Numerous minor fixes, cleanups etc.

    - More EEH work from Gavin to remove its dependency on device_nodes.

    - Memory hotplug implemented entirely in the kernel from Nathan
    Fontenot.

    - Removal of redundant CONFIG_PPC_OF by Kevin Hao.

    - Rewrite of VPHN parsing logic & tests from Greg Kurz.

    - A fix from Nish Aravamudan to reduce memory usage by clamping
    nodes_possible_map.

    - Support for pstore on powernv from Hari Bathini.

    - Removal of old powerpc specific byte swap routines by David Gibson.

    - Fix from Vasant Hegde to prevent the flash driver telling you it was
    flashing your firmware when it wasn't.

    - Patch from Ben Herrenschmidt to add an OPAL heartbeat driver.

    - Fix for an oops causing get/put_cpu_var() imbalance in perf by Jan
    Stancek.

    - Some fixes for migration from Tyrel Datwyler.

    - A new syscall to switch the cpu endian by Michael Ellerman.

    - Large series from Wei Yang to implement SRIOV, reviewed and acked by
    Bjorn.

    - A fix for the OPAL sensor driver from Cédric Le Goater.

    - Fixes to get STRICT_MM_TYPECHECKS building again by Michael Ellerman.

    - Large series from Daniel Axtens to make our PCI hooks per PHB rather
    than per machine.

    - Small patch from Sam Bobroff to explicitly abort non-suspended
    transactions on syscalls, plus a test to exercise it.

    - Numerous reworks and fixes for the 24x7 PMU from Sukadev Bhattiprolu.

    - Small patch to enable the hard lockup detector from Anton Blanchard.

    - Fix from Dave Olson for missing L2 cache information on some CPUs.

    - Some fixes from Michael Ellerman to get Cell machines booting again.

    - Freescale updates from Scott: Highlights include BMan device tree
    nodes, an MSI erratum workaround, a couple minor performance
    improvements, config updates, and misc fixes/cleanup.

    * tag 'powerpc-4.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (196 commits)
    powerpc/powermac: Fix build error seen with powermac smp builds
    powerpc/pseries: Fix compile of memory hotplug without CONFIG_MEMORY_HOTREMOVE
    powerpc: Remove PPC32 code from pseries specific find_and_init_phbs()
    powerpc/cell: Fix iommu breakage caused by controller_ops change
    powerpc/eeh: Fix crash in eeh_add_device_early() on Cell
    powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
    powerpc/perf/hv-24x7: Fail 24x7 initcall if create_events_from_catalog() fails
    powerpc/pseries: Correct memory hotplug locking
    powerpc: Fix missing L2 cache size in /sys/devices/system/cpu
    powerpc: Add ppc64 hard lockup detector support
    oprofile: Disable oprofile NMI timer on ppc64
    powerpc/perf/hv-24x7: Add missing put_cpu_var()
    powerpc/perf/hv-24x7: Break up single_24x7_request
    powerpc/perf/hv-24x7: Define update_event_count()
    powerpc/perf/hv-24x7: Whitespace cleanup
    powerpc/perf/hv-24x7: Define add_event_to_24x7_request()
    powerpc/perf/hv-24x7: Rename hv_24x7_event_update
    powerpc/perf/hv-24x7: Move debug prints to separate function
    powerpc/perf/hv-24x7: Drop event_24x7_request()
    powerpc/perf/hv-24x7: Use pr_devel() to log message
    ...

    Conflicts:
    tools/testing/selftests/powerpc/Makefile
    tools/testing/selftests/powerpc/tm/Makefile

    Linus Torvalds
     

16 Apr, 2015

3 commits