12 Feb, 2019

3 commits

  • In order to support multi-fifo sdma script, the audio driver need to send
    the fifo number to dma driver through dma_slave_config, and the cpu_dai
    driver should config fifo_num for the audio platform driver, then platform
    driver can config fifo_num to dma.
    So add new variable fifo_num for struct snd_dmaengine_dai_dma_data.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Robin Gong

    Shengjiu Wang
     
  • According to commit b073ed4e2126 ("ASoC: soc-pcm: DPCM cares BE format"),
    Current DPCM only care FE channel, but it will set unsupported channel to
    drivers.
    So add dpcm_merged_chan, which is used to merge the BE's codec
    channels configuration to FE if it exist in snd_soc_dai_link. And
    dpcm_runtime_base_chan function is to get the channel configuration of BE,
    which likes the dpcm_runtime_base_format function.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 19ff1095d4b68d17a5f68a2de5654be72b606809)

    Shengjiu Wang
     
  • cherry-pick below patch from imx_3.14.y
    ENGR00307835-2 ASoC: dmaengine: Add two function for dmaengine_pcm

    Add check_xrun and device_reset for dmaengine_pcm

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 405588f31e432e5c6634a0817e4d804ead87882b)

    Shengjiu Wang
     

13 Dec, 2018

1 commit

  • commit 5363857b916c1f48027e9b96ee8be8376bf20811 upstream.

    As addressed in alsa-lib (commit b420056604f0), we need to fix the
    case where the evaluation of PCM interval "(x x+1]" leading to
    -EINVAL. After applying rules, such an interval may be translated as
    "(x x+1)".

    Fixes: ff2d6acdf6f1 ("ALSA: pcm: Fix snd_interval_refine first/last with open min/max")
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

18 Oct, 2018

1 commit

  • [ Upstream commit 75383f8d39d4c0fb96083dd460b7b139fbdac492 ]

    Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
    1) sets bus->chip_init to prevent multiple entrances before device
    is stopped; 2) enables interrupt.

    We shouldn't use it for the purpose of resetting device only because
    1) when we really want to initialize device, we won't be able to do
    so; 2) we are ready to handle interrupt yet, and kernel crashes when
    interrupt comes in.

    Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
    device properly.

    Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
    Reviewed-by: Takashi Iwai
    Signed-off-by: Yu Zhao
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Yu Zhao
     

02 May, 2018

1 commit

  • commit 088e861edffb84879cf0c0d1b02eda078c3a0ffe upstream.

    As recently Smatch suggested, a few places in ALSA control core codes
    may expand the array directly from the user-space value with
    speculation:

    sound/core/control.c:1003 snd_ctl_elem_lock() warn: potential spectre issue 'kctl->vd'
    sound/core/control.c:1031 snd_ctl_elem_unlock() warn: potential spectre issue 'kctl->vd'
    sound/core/control.c:844 snd_ctl_elem_info() warn: potential spectre issue 'kctl->vd'
    sound/core/control.c:891 snd_ctl_elem_read() warn: potential spectre issue 'kctl->vd'
    sound/core/control.c:939 snd_ctl_elem_write() warn: potential spectre issue 'kctl->vd'

    Although all these seem doing only the first load without further
    reference, we may want to stay in a safer side, so hardening with
    array_index_nospec() would still make sense.

    In this patch, we put array_index_nospec() to the common
    snd_ctl_get_ioff*() helpers instead of each caller. These helpers are
    also referred from some drivers, too, and basically all usages are to
    calculate the array index from the user-space value, hence it's better
    to cover there.

    BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
    Reported-by: Dan Carpenter
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

24 Apr, 2018

1 commit

  • commit 40cab6e88cb0b6c56d3f30b7491a20e803f948f6 upstream.

    OSS PCM stream management isn't modal but it allows ioctls issued at
    any time for changing the parameters. In the previous hardening
    patch ("ALSA: pcm: Avoid potential races between OSS ioctls and
    read/write"), we covered these races and prevent the corruption by
    protecting the concurrent accesses via params_lock mutex. However,
    this means that some ioctls that try to change the stream parameter
    (e.g. channels or format) would be blocked until the read/write
    finishes, and it may take really long.

    Basically changing the parameter while reading/writing is an invalid
    operation, hence it's even more user-friendly from the API POV if it
    returns -EBUSY in such a situation.

    This patch adds such checks in the relevant ioctls with the addition
    of read/write access refcount.

    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

30 Nov, 2017

1 commit

  • commit d6c0615f510bc1ee26cfb2b9a3343ac99b9c46fb upstream.

    The previous fix for addressing the breakage in vmaster slave
    initialization, commit a91d66129fb9 ("ALSA: hda - Fix incorrect TLV
    callback check introduced during set_fs() removal"), introduced a new
    helper to process over each slave kctl. However, this helper passes
    only the original kctl, not the virtual slave kctl. As a result,
    HD-audio driver (which is the only user so far) couldn't initialize
    the slave correctly because it's trying to update the value directly
    with the original kctl, not with the mapped kctl.

    This patch fixes the situation again by passing both the mapped slaved
    and original slave kctls to the function. Luckily there is a single
    caller as of now, so changing the call signature is no big matter.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197959
    Fixes: a91d66129fb9 ("ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal")
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

10 Nov, 2017

1 commit

  • Pull sound fixes from Takashi Iwai:
    "The amount of the changes isn't as quite small as wished, nevertheless
    they are straight fixes that deserve merging to 4.14 final.

    Most of fixes are about ALSA core bugs spotted by fuzzer: a follow-up
    fix for the previous nested rwsem patch, a fix to avoid the resource
    hogs due to too many concurrent ALSA timer invocations, and a fix for
    a crash with SYSEX MIDI transfer over OSS sequencer emulation that is
    used by none but fuzzer.

    The rest are usual HD-audio and USB-audio device-specific quirks,
    which are safe to apply"

    * tag 'sound-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda - fix headset mic problem for Dell machines with alc274
    ALSA: seq: Fix OSS sysex delivery in OSS emulation
    ALSA: seq: Avoid invalid lockdep class warning
    ALSA: timer: Limit max instances per timer
    ALSA: usb-audio: support new Amanero Combo384 firmware version

    Linus Torvalds
     

07 Nov, 2017

1 commit

  • The recent fix for adding rwsem nesting annotation was using the given
    "hop" argument as the lock subclass key. Although the idea itself
    works, it may trigger a kernel warning like:
    BUG: looking up invalid subclass: 8
    ....
    since the lockdep has a smaller number of subclasses (8) than we
    currently allow for the hops there (10).

    The current definition is merely a sanity check for avoiding the too
    deep delivery paths, and the 8 hops are already enough. So, as a
    quick fix, just follow the max hops as same as the max lockdep
    subclasses.

    Fixes: 1f20f9ff57ca ("ALSA: seq: Fix nested rwsem annotation for lockdep splat")
    Reported-by: syzbot
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

06 Nov, 2017

1 commit

  • Currently we allow unlimited number of timer instances, and it may
    bring the system hogging way too much CPU when too many timer
    instances are opened and processed concurrently. This may end up with
    a soft-lockup report as triggered by syzkaller, especially when
    hrtimer backend is deployed.

    Since such insane number of instances aren't demanded by the normal
    use case of ALSA sequencer and it merely opens a risk only for abuse,
    this patch introduces the upper limit for the number of instances per
    timer backend. As default, it's set to 1000, but for the fine-grained
    timer like hrtimer, it's set to 100.

    Reported-by: syzbot
    Tested-by: Jérôme Glisse
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Oct, 2017

1 commit

  • The commit 99b5c5bb9a54 ("ALSA: hda - Remove the use of set_fs()")
    converted the get_kctl_0dB_offset() call for killing set_fs() usage in
    HD-audio codec code. The conversion assumed that the TLV callback
    used in HD-audio code is only snd_hda_mixer_amp() and applies the TLV
    calculation locally.

    Although this assumption is correct, and all slave kctls are actually
    with that callback, the current code is still utterly buggy; it
    doesn't hit this condition and falls back to the next check. It's
    because the function gets called after adding slave kctls to vmaster.
    By assigning a slave kctl, the slave kctl object is faked inside
    vmaster code, and the whole kctl ops are overridden. Thus the
    callback op points to a different value from what we've assumed.

    More badly, as reported by the KERNEXEC and UDEREF features of PaX,
    the code flow turns into the unexpected pitfall. The next fallback
    check is SNDRV_CTL_ELEM_ACCESS_TLV_READ access bit, and this always
    hits for each kctl with TLV. Then it evaluates the callback function
    pointer wrongly as if it were a TLV array. Although currently its
    side-effect is fairly limited, this incorrect reference may lead to an
    unpleasant result.

    For addressing the regression, this patch introduces a new helper to
    vmaster code, snd_ctl_apply_vmaster_slaves(). This works similarly
    like the existing map_slaves() in hda_codec.c: it loops over the slave
    list of the given master, and applies the given function to each
    slave. Then the initializer function receives the right kctl object
    and we can compare the correct pointer instead of the faked one.

    Also, for catching the similar breakage in future, give an error
    message when the unexpected TLV callback is found and bail out
    immediately.

    Fixes: 99b5c5bb9a54 ("ALSA: hda - Remove the use of set_fs()")
    Reported-by: PaX Team
    Cc: # v4.13
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

09 Oct, 2017

1 commit

  • The event handler in the virmidi sequencer code takes a read-lock for
    the linked list traverse, while it's calling snd_seq_dump_var_event()
    in the loop. The latter function may expand the user-space data
    depending on the event type. It eventually invokes copy_from_user(),
    which might be a potential dead-lock.

    The sequencer core guarantees that the user-space data is passed only
    with atomic=0 argument, but snd_virmidi_dev_receive_event() ignores it
    and always takes read-lock(). For avoiding the problem above, this
    patch introduces rwsem for non-atomic case, while keeping rwlock for
    atomic case.

    Also while we're at it: the superfluous irq flags is dropped in
    snd_virmidi_input_open().

    Reported-by: Jia-Ju Bai
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

06 Oct, 2017

1 commit

  • Pull sound fixes from Takashi Iwai:
    "A collection of small fixes, mostly with stable ones:

    - X32 ABI fix for PCM; likely not so many people suffer from it, but
    still better to fix

    - Two minor kernel warning fixes on USB audio devices spotted by
    syzkaller

    - Regression fix of echoaudio due to its inconsistent dimension

    - Fix for HBR support on Intel DP audio, on some recent chips

    - USB-audio quirk for yet another Plantronics devices

    - Fix for potential double-fetch in ASIHPI FIFO queue"

    * tag 'sound-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: usx2y: Suppress kernel warning at page allocation failures
    Revert "ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members"
    ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor
    ALSA: pcm: Fix structure definition for X32 ABI
    ALSA: usb-audio: Add sample rate quirk for Plantronics C310/C520-M
    ALSA: hda - program ICT bits to support HBR audio
    ALSA: asihpi: fix a potential double-fetch bug when copying puhm
    ALSA: compress: Remove unused variable

    Linus Torvalds
     

20 Sep, 2017

1 commit

  • On recent Intel platforms (Haswell, Broadwell, Skylake, ApolloLake,
    KabyLake, ...), the IEC Coding Type (ICT) bitfield in the Digital
    Converter Control #3 needs to be set explicitly for HDMI/DisplayPort
    High Bit Rate (HBR) audio playback to work. This was not required in
    earlier platforms when HBR was first introduced. The ICT bits are
    defined in Section 7.3.3.9 of the HDaudio 1.0a specification.

    Since the ICT bitfield was not specified for HDAudio 1.0 devices
    (before 2009), we only program it on machines more recent than
    Haswell.

    We tested that this fix is not needed on Baytrail-I (MinnowBoard
    Turbot) and believe by extension it also does not apply to Braswell.

    [ Moved AC_VERB_SET_DIGI_CONVERT_3 definition to the right place
    by tiwai ]

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98797

    Signed-off-by: Sriram Periyasamy
    Signed-off-by: Pierre-Louis Bossart
    Signed-off-by: Subhransu S. Prusty
    Acked-by: Vinod Koul
    Signed-off-by: Takashi Iwai

    Sriram Periyasamy
     

08 Sep, 2017

1 commit

  • Pull sound updates from Takashi Iwai:
    "We have touched quite a lot of files but with fewer changes at this
    cycle; as you can see, most of changes are trivial fixes, especially
    constification patches.

    Among the massive attacks by constification gangs, we had a few core
    changes (mostly for ASoC core), as well the fixes and the updates by
    major vendors.

    Some highlights:

    ALSA core:

    - Fix possible races in control API user-TLV codes

    - Small cleanup of PCM core

    ASoC:

    - Continued work for componentization; still half-baked, but we're
    certainly progressing

    - Use of devres for jack detection GPIOs, rather as a cleanup

    - Jack detection support for Qualcomm MSM8916

    - Support for Allwinner H3, Cirrus Logic CS43130, Intel Kabylake
    systems with RT5663, Realtek RT274, TI TLV320AIC32x6 and Wolfson
    WM8523"

    * tag 'sound-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (512 commits)
    ALSA: hda/ca0132 - Fix memory leak at error path
    ALSA: hda: Fix forget to free resource in error handling code path in hda_codec_driver_probe
    ASoC: cs43130: Fix unused compiler warnings for PM runtime
    ASoC: cs43130: Fix possible Oops with invalid dev_id
    ASoC: cs43130: fix spelling mistake: "irq_occurrance" -> "irq_occurrence"
    ALSA: atmel: Remove leftovers of AVR32 removal
    ALSA: atmel: convert AC97c driver to GPIO descriptor API
    ALSA: hda/realtek - Enable jack detection function for Intel ALC700
    ALSA: hda: Fix regression of hdmi eld control created based on invalid pcm
    ASoC: Intel: Skylake: Add IPC to configure the copier secondary pins
    ASoC: add missing compile rule for max98371
    ASoC: add missing compile rule for sirf-audio-codec
    ASoC: add missing compile rule for max98371
    ASoC: cs43130: Add devicetree bindings for CS43130
    ASoC: cs43130: Add support for CS43130 codec
    ASoC: make clock direction configurable in asoc-simple
    ALSA: ctxfi: Remove null check before kfree
    ASoC: max98927: Changed device property read function
    ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path
    ASoC: max98927: Added PM suspend and resume function
    ...

    Linus Torvalds
     

04 Sep, 2017

2 commits

  • ASoC: Updates for v4.14

    This is quite a large release by volume of patches and diff, a lot of
    that is mechanical cleanup patches but it's great to also see a range of
    vendors actively working on adding new features and fixing issues in
    their drivers. Intel and Realtek have been especially active here.

    - Continued work towards moving everything to the component model from
    Morimoto-san.
    - Use of devres for jack detection GPIOs, eliminating some potential
    resource leaks.
    - Jack detection support for Qualcomm MSM8916.
    - Support for Allwinner H3, Cirrus Logic CS43130, Intel Kabylake
    systems with RT5663, Realtek RT274, TI TLV320AIC32x6 and Wolfson
    WM8523.

    Takashi Iwai
     
  • The ALSA related include header files are left overs after the commit

    020c5260c2b1 ("ALSA: atmel: Remove AVR32 bits from the driver")

    Fixes: 020c5260c2b1 ("ALSA: atmel: Remove AVR32 bits from the driver")
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Takashi Iwai

    Andy Shevchenko
     

01 Sep, 2017

6 commits


31 Aug, 2017

5 commits

  • In current ALSA SoC, Codec only has set_jack feature.
    Codec will be merged into Component in next generation ALSA SoC,
    thus current Codec specific feature need to be merged into it.
    This is glue patch for it.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     
  • In current ALSA SoC, Codec only has set_pll feature.
    Codec will be merged into Component in next generation ALSA SoC,
    thus current Codec specific feature need to be merged into it.
    This is glue patch for it.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     
  • In current ALSA SoC, Codec only has set_sysclk feature.
    Codec will be merged into Component in next generation ALSA SoC,
    thus current Codec specific feature need to be merged into it.
    This is glue patch for it.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     
  • Linux 4.13-rc7

    Mark Brown
     
  • Currently we're taking power_lock at each card component for assuring
    the power-up sequence, but it doesn't help anything in the
    implementation at the moment: it just serializes unnecessarily the
    callers, but it doesn't protect about the power state change itself.
    It used to have some usefulness in the early days where we managed the
    PM manually. But now the suspend/resume core procedure is beyond our
    hands, and power_lock lost its meaning.

    This patch drops the power_lock from allover the places.
    There shouldn't be any issues by this change, as it's no helper
    regarding the power state change. Rather we'll get better performance
    by removing the serialization; which is the only slight concern of any
    behavior change, but it can't be a showstopper, after all.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

25 Aug, 2017

4 commits


16 Aug, 2017

1 commit


10 Aug, 2017

4 commits


07 Aug, 2017

1 commit