20 Sep, 2018

1 commit

  • commit 16037643969e095509cd8446a3f8e406a6dc3a2c upstream.

    On AMD/ATI controllers, the HD-audio controller driver allows a bus
    reset upon the error recovery, and its procedure includes the
    cancellation of pending jack polling work as found in
    snd_hda_bus_codec_reset(). This works usually fine, but it becomes a
    problem when the reset happens from the jack poll work itself; then
    calling cancel_work_sync() from the work being processed tries to wait
    the finish endlessly.

    As a workaround, this patch adds the check of current_work() and
    applies the cancel_work_sync() only when it's not from the
    jackpoll_work.

    This doesn't fix the root cause of the reported error below, but at
    least, it eases the unexpected stall of the whole system.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200937
    Cc:
    Cc: Lukas Wunner
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

15 Sep, 2018

2 commits

  • commit ad0eaee6195db1db1749dd46b9e6f4466793d178 upstream.

    Add missing break statement in order to prevent the code from falling
    through to the default case.

    Addresses-Coverity-ID: 115050 ("Missing break in switch")
    Reported-by: Valdis Kletnieks
    Signed-off-by: Gustavo A. R. Silva
    Acked-by: Charles Keepax
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    [Gustavo: Backported to 3.16..4.18 - Remove code comment removal]
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     
  • [ Upstream commit f861e3e28a3016a2064d9f600eaa92a530b732b4 ]

    The driver expects to find the device id in rt5677_of_match.data, however
    it is currently assigned to rt5677_of_match.type. Fix this.

    The problem was found with the help of clang:
    sound/soc/codecs/rt5677.c:5010:36: warning: expression which evaluates to
    zero treated as a null pointer constant of type 'const void *'
    [-Wnon-literal-null-conversion]
    { .compatible = "realtek,rt5677", RT5677 },
    ^~~~~~

    Fixes: ddc9e69b9dc2 ("ASoC: rt5677: Hide platform data in the module sources")
    Signed-off-by: Matthias Kaehlcke
    Reviewed-by: Guenter Roeck
    Acked-by: Andy Shevchenko
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Matthias Kaehlcke
     

05 Sep, 2018

3 commits

  • commit ae1c696a480c67c45fb23b35162183f72c6be0e1 upstream.

    There is a potential execution path in which function
    platform_get_resource() returns NULL. If this happens,
    we will end up having a NULL pointer dereference.

    Fix this by replacing devm_ioremap with devm_ioremap_resource,
    which has the NULL check and the memory region request.

    This code was detected with the help of Coccinelle.

    Cc: stable@vger.kernel.org
    Fixes: 2bd8d1d5cf89 ("ASoC: sirf: Add audio usp interface driver")
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     
  • commit c889a45d229938a94b50aadb819def8bb11a6a54 upstream.

    zx-tdm driver sets the DAI driver definitions with the format bits
    wrongly set with SNDRV_PCM_FORMAT_*, instead of SNDRV_PCM_FMTBIT_*.

    This patch corrects the definitions.

    Spotted by a sparse warning:
    sound/soc/zte/zx-tdm.c:363:35: warning: restricted snd_pcm_format_t degrades to integer

    Fixes: 870e0ddc4345 ("ASoC: zx-tdm: add zte's tdm controller driver")
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 4febced15ac8ddb9cf3e603edb111842e4863d9a upstream.

    When merging codec formats, dpcm_runtime_base_format() should skip
    the codecs which are not supporting the current stream direction.

    At the moment, if a BE link has more than one codec, and only one
    of these codecs has no capture DAI, it becomes impossible to start
    a capture stream because the merged format would be 0.

    Skipping invalid codec DAI solves the problem.

    Fixes: b073ed4e2126 ("ASoC: soc-pcm: DPCM cares BE format")
    Signed-off-by: Jerome Brunet
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Jerome Brunet
     

24 Aug, 2018

1 commit

  • [ Upstream commit c9a4c63888dbb79ce4d068ca1dd8b05bc3f156b1 ]

    The kernel may spew a WARNING with UBSAN undefined behavior at
    handling ALSA sequencer ioctl SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT:

    UBSAN: Undefined behaviour in sound/core/seq/seq_clientmgr.c:2007:14
    signed integer overflow:
    2147483647 + 1 cannot be represented in type 'int'
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x122/0x1c8 lib/dump_stack.c:113
    ubsan_epilogue+0x12/0x86 lib/ubsan.c:159
    handle_overflow+0x1c2/0x21f lib/ubsan.c:190
    __ubsan_handle_add_overflow+0x2a/0x31 lib/ubsan.c:198
    snd_seq_ioctl_query_next_client+0x1ac/0x1d0 sound/core/seq/seq_clientmgr.c:2007
    snd_seq_ioctl+0x264/0x3d0 sound/core/seq/seq_clientmgr.c:2144
    ....

    It happens only when INT_MAX is passed there, as we're incrementing it
    unconditionally. So the fix is trivial, check the value with
    INT_MAX. Although the bug itself is fairly harmless, it's better to
    fix it so that fuzzers won't hit this again later.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200211
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

22 Aug, 2018

8 commits

  • commit 3acd3e3bab95ec3622ff98da313290ee823a0f68 upstream.

    The endian conversions used in vxp_dma_read() and vxp_dma_write() are
    superfluous and even wrong on big-endian machines, as inw() and outw()
    already do conversions. Kill them.

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

    Takashi Iwai
     
  • commit dfef01e150824b0e6da750cacda8958188d29aea upstream.

    snd_dma_alloc_pages_fallback() tries to allocate pages again when the
    allocation fails with reduced size. But the first try actually
    *increases* the size to power-of-two, which may give back a larger
    chunk than the requested size. This confuses the callers, e.g. sgbuf
    assumes that the size is equal or less, and it may result in a bad
    loop due to the underflow and eventually lead to Oops.

    The code of this function seems incorrectly assuming the usage of
    get_order(). We need to decrease at first, then align to
    power-of-two.

    Reported-and-tested-by: he, bo
    Reported-by: zhang jun
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 8e82a728792bf66b9f0a29c9d4c4b0630f7b9c79 upstream.

    I added the subsys product-id for the HDMI HDA device rather then for
    the PCH one, this commit fixes this.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104
    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit 69756930f2de0457d51db7d505a1e4f40e9fd116 upstream.

    One place in cs5535audio_build_dma_packets() does an extra conversion
    via cpu_to_le32(); namely jmpprd_addr is passed to setup_prd() ops,
    which writes the value via cs_writel(). That is, the callback does
    the conversion by itself, and we don't need to convert beforehand.

    This patch fixes that bogus conversion.

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

    Takashi Iwai
     
  • commit 50e9ffb1996a5d11ff5040a266585bad4ceeca0a upstream.

    The virmidi output trigger tries to parse the all available bytes and
    process sequencer events as much as possible. In a normal situation,
    this is supposed to be relatively short, but a program may give a huge
    buffer and it'll take a long time in a single spin lock, which may
    eventually lead to a soft lockup.

    This patch simply adds a workaround, a cond_resched() call in the loop
    if applicable. A better solution would be to move the event processor
    into a work, but let's put a duct-tape quickly at first.

    Reported-and-tested-by: Dae R. Jeong
    Reported-by: syzbot+619d9f40141d826b097e@syzkaller.appspotmail.com
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit fff71a4c050ba46e305d910c837b99ba1728135e upstream.

    The endian conversions used in vx2_dma_read() and vx2_dma_write() are
    superfluous and even wrong on big-endian machines, as inl() and outl()
    already do conversions. Kill them.

    Spotted by sparse, a warning like:
    sound/pci/vx222/vx222_ops.c:278:30: warning: incorrect type in argument 1 (different base types)

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

    Takashi Iwai
     
  • commit d77a4b4a5b0b2ebcbc9840995d91311ef28302ab upstream.

    As an equivalent codec with CX20724,
    CX8200 is also subject to the reboot bug.

    Late 2017 and 2018 LG Gram and some HP Spectre laptops are known victims
    to this issue, causing extremely loud noises upon reboot.

    Now that we know that this bug is subject to multiple codecs,
    fix the comment as well.

    Signed-off-by: Park Ju Hyung
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Park Ju Hyung
     
  • commit f59cf9a0551dd954ad8b752461cf19d9789f4b1d upstream.

    On rare occasions, we are still noticing that the internal speaker
    spitting out spurious noises even after adding the problematic codec
    to the list.

    Adding a 10ms artificial delay before rebooting fixes the issue entirely.

    Patch for Realtek codecs also adds the same amount of delay after
    entering D3.

    Signed-off-by: Park Ju Hyung
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Park Ju Hyung
     

18 Aug, 2018

3 commits

  • commit 3bbda5a38601f7675a214be2044e41d7749e6c7b upstream.

    If the ts3a227e audio accessory detection hardware is present and its
    driver probed, the jack needs to be created before enabling jack
    detection in the ts3a227e driver. With this patch, the jack is
    instantiated in the max98090 headset init function if the ts3a227e is
    present. This fixes a null pointer dereference as the jack detection
    enabling function in the ts3a driver was called before the jack is
    created.

    [minor correction to keep error handling on jack creation the same
    as before by Pierre Bossart]

    Signed-off-by: Thierry Escande
    Signed-off-by: Pierre-Louis Bossart
    Acked-By: Vinod Koul
    Signed-off-by: Mark Brown
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Thierry Escande
     
  • commit f53ee247ad546183fc13739adafc5579b9f0ebc0 upstream.

    The kcontrol for the third input (rxN_mix1_inp3) of both RX2
    and RX3 mixers are not using the correct control register. This simple
    patch fixes this.

    Signed-off-by: Jean-François Têtu
    Signed-off-by: Mark Brown
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Jean-François Têtu
     
  • commit b7165d26bf730567ab081bb9383aff82cd43d9ea upstream.

    Current ADG driver is over-writing flags. This patch fixes it.

    Reported-by: Hiroyuki Yokoyama
    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Mark Brown
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     

03 Aug, 2018

8 commits

  • [ Upstream commit 933e1c4a667103c4d10ebdc9505a0a6abd8c3fbd ]

    Clock gating parameter is a part of `dai_fmt`. It is supported by
    `alsa-lib` when creating a topology binary file, but ignored by kernel
    when loading this topology file.

    After applying this commit, the clock gating parameter is not ignored any
    more. This solution is backwards compatible. The existing behaviour is
    not broken, because by default the parameter value is 0 and is ignored.

    snd_soc_tplg_hw_config.clock_gated = 0 => no effect
    snd_soc_tplg_hw_config.clock_gated = 1 => SND_SOC_DAIFMT_GATED
    snd_soc_tplg_hw_config.clock_gated = 2 => SND_SOC_DAIFMT_CONT

    For example, the following config, based on
    alsa-lib/src/conf/topology/broadwell/broadwell.conf, is now supported:

    ~~~~
    SectionHWConfig."CodecHWConfig" {
    id "1"
    format "I2S" # physical audio format.
    pm_gate_clocks "true" # clock can be gated
    }

    SectionLink."Codec" {

    # used for binding to the physical link
    id "0"

    hw_configs [
    "CodecHWConfig"
    ]

    default_hw_conf_id "1"
    }
    ~~~~

    Signed-off-by: Kirill Marinushkin
    Reviewed-by: Pierre-Louis Bossart
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Mark Brown
    Cc: Pan Xiuli
    Cc: Liam Girdwood
    Cc: linux-kernel@vger.kernel.org
    Cc: alsa-devel@alsa-project.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Kirill Marinushkin
     
  • [ Upstream commit a941e2fab3207cb0d57dc4ec47b1b12c8ea78b84 ]

    The values of bclk and fsync are inverted WRT the codec. But the existing
    solution already works for Broadwell, see the alsa-lib config:

    `alsa-lib/src/conf/topology/broadwell/broadwell.conf`

    This commit provides the backwards-compatible solution to fix this misuse.

    Signed-off-by: Kirill Marinushkin
    Reviewed-by: Pierre-Louis Bossart
    Tested-by: Pan Xiuli
    Tested-by: Pierre-Louis Bossart
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Mark Brown
    Cc: Liam Girdwood
    Cc: linux-kernel@vger.kernel.org
    Cc: alsa-devel@alsa-project.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Kirill Marinushkin
     
  • [ Upstream commit 8e142e9e628975b0dddd05cf1b095331dff6e2de ]

    DECLARE_TLV_DB_SCALE (alias of SNDRV_CTL_TLVD_DECLARE_DB_SCALE) is used but
    tlv.h is not included. This causes build failure when local macro is
    defined by comment-out.

    This commit fixes the bug. At the same time, the alias macro is replaced
    with a destination macro added at a commit 46e860f76804 ("ALSA: rename
    TLV-related macros so that they're friendly to user applications")

    Reported-by: Connor McAdams
    Fixes: 44f0c9782cc6 ('ALSA: hda/ca0132: Add tuning controls')
    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Sakamoto
     
  • [ Upstream commit 377a879d9832f4ba69bd6a1fc996bb4181b1e504 ]

    retire_capture_urb() may print warning messages when the given URB
    doesn't align, and this may flood the system log easily.
    Put the rate limit to the message for avoiding it.

    Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1093485
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • [ Upstream commit 11d42c81036324697d367600bfc16f6dd37636fd ]

    The error messages at sanity checks of memory pages tend to repeat too
    many times once when it hits, and without the rate limit, it may flood
    and become unreadable. Replace such messages with the *_ratelimited()
    variant.

    Bugzilla: http://bugzilla.opensuse.org/show_bug.cgi?id=1093027
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • [ Upstream commit 9c0ac70ad24d76b873c1551e27790c7f6a815d5c ]

    In case, one BE is used by two FE1/FE2
    FE1--->BE-->
    |
    FE2----]
    when FE1/FE2 call dpcm_be_dai_hw_free() together
    the BE users will be 2 (> 1), hence cannot be hw_free
    the be state will leave at, ex. SND_SOC_DPCM_STATE_STOP

    later FE1/FE2 call dpcm_be_dai_shutdown(),
    will be skip due to wrong state.
    leaving the BE not being hw_free and shutdown.

    The BE dai will be hw_free later when calling
    dpcm_be_dai_shutdown() if still in invalid state.

    Signed-off-by: KaiChieh Chuang
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Kai Chieh Chuang
     
  • [ Upstream commit ef1ffbe7889e99f5b5cccb41c89e5c94f50f3218 ]

    When snd_ctl_add fails, the lack of error-handling code may
    cause unexpected results.

    This patch adds error-handling code after calling snd_ctl_add.

    Signed-off-by: Zhouyang Jia
    Acked-by: Andy Shevchenko
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Zhouyang Jia
     
  • [ Upstream commit 6d531e7b972cb62ded011c2dfcc2d9f72ea6c421 ]

    When snd_ctl_add fails, the lack of error-handling code may
    cause unexpected results.

    This patch adds error-handling code after calling snd_ctl_add.

    Signed-off-by: Zhouyang Jia
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Zhouyang Jia
     

25 Jul, 2018

3 commits

  • commit 9a6249d2a145226ec1b294116fcb08744cf7ab56 upstream.

    Audio mute led does not work on HP ProBook 455 G5,
    this can be fixed by using CXT_FIXUP_MUTE_LED_GPIO to support it.

    BugLink: https://bugs.launchpad.net/bugs/1781763
    Reported-by: James Buren
    Signed-off-by: Po-Hsu Lin
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Po-Hsu Lin
     
  • commit 0fca97a29b83e3f315c14ed2372cfd0f9ee0a006 upstream.

    This adds some required quirk when uses headset or headphone on
    Panasonic CF-SZ6.

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

    YOKOTA Hiroshi
     
  • commit 39675f7a7c7e7702f7d5341f1e0d01db746543a0 upstream.

    The SNDRV_RAWMIDI_IOCTL_PARAMS ioctl may resize the buffers and the
    current code is racy. For example, the sequencer client may write to
    buffer while it being resized.

    As a simple workaround, let's switch to the resized buffer inside the
    stream runtime lock.

    Reported-by: syzbot+52f83f0ea8df16932f7f@syzkaller.appspotmail.com
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

17 Jul, 2018

3 commits

  • commit aaa23f86001bdb82d2f937c5c7bce0a1e11a6c5b upstream.

    Obtaining the runtime pm wakeref can fail, especially in a hotplug
    scenario where i915.ko has been unloaded. If we do not catch the
    failure, we end up with an unbalanced pm.

    v2 additions by tiwai:
    hdmi_present_sense() checks the return value and handle only a
    negative error case and bails out only if it's really still suspended.
    Also, snd_hda_power_down() is called at the error path so that the
    refcount is balanced.

    Along with it, the spec->pcm_lock is taken outside
    hdmi_present_sense() in the caller side, so that it won't cause
    deadlock at reentrace via runtime resume.

    v3 fix by tiwai:
    Missing linux/pm_runtime.h is included.

    References: 222bde03881c ("ALSA: hda - Fix mutex deadlock at HDMI/DP hotplug")
    Signed-off-by: Chris Wilson
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Chris Wilson
     
  • commit c6b17f1020d956f4113d478cae6171b9093817ba upstream.

    We have two new lenovo desktop models which need to apply the fixup of
    ALC294_FIXUP_LENOVO_MIC_LOCATION, and they have the same pin cfg as
    the machine with subsystem id:0x17aa3136, now use the pincfg table
    to apply the fixup for them.

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

    Hui Wang
     
  • commit 5845e6155d8f4a4a9bae2d4c1d1bb4a4d9a925c2 upstream.

    preallocate pages should use platform device,
    since we set dma mask for platform device.

    Signed-off-by: KaiChieh Chuang
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Kai Chieh Chuang
     

03 Jul, 2018

8 commits

  • commit e41fc8c5bd41b96bfae5ce4c66bee6edabc932e8 upstream.

    We have 3 more Lenovo machines, they all have 2 front mics on them,
    so they need the fixup to change the location for one of two mics.

    Among these 3 Lenovo machines, one of them has the same pin cfg as the
    machine with subid 0x17aa3138, so use the pin cfg table to apply fixup
    for them. The rest machines don't share the same pin cfg, so far use
    the subid to apply fixup for them.

    Fixes: a3dafb2200bf ("ALSA: hda/realtek - adjust the location of one mic")
    Cc:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Hui Wang
     
  • commit 275ec0cb946cb75ac8977f662e608fce92f8b8a8 upstream.

    Fujitsu Seimens ESPRIMO Mobile U9210 requires the same fixup as H270
    for the correct pin configs.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200107
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit d5a6cabf02210b896a60eee7c04c670ee9ba6dca upstream.

    Some Lenovo laptops, e.g. Lenovo P50, showed the pop noise at resume
    or runtime resume. It turned out to be reduced by applying
    alc_no_shutup() just like TPT440 quirk does.

    Since there are many Lenovo models showing the same behavior, put this
    workaround in ALC269_FIXUP_THINKPAD_ACPI entry so that it's applied
    commonly to all such Lenovo machines.

    Reported-by: Hans de Goede
    Tested-by: Benjamin Berg
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit b41f794f284966fd6ec634111e3b40d241389f96 upstream.

    The kernel may spew a WARNING about UBSAN undefined behavior at
    handling ALSA timer ioctl SNDRV_TIMER_IOCTL_NEXT_DEVICE:

    UBSAN: Undefined behaviour in sound/core/timer.c:1524:19
    signed integer overflow:
    2147483647 + 1 cannot be represented in type 'int'
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x122/0x1c8 lib/dump_stack.c:113
    ubsan_epilogue+0x12/0x86 lib/ubsan.c:159
    handle_overflow+0x1c2/0x21f lib/ubsan.c:190
    __ubsan_handle_add_overflow+0x2a/0x31 lib/ubsan.c:198
    snd_timer_user_next_device sound/core/timer.c:1524 [inline]
    __snd_timer_user_ioctl+0x204d/0x2520 sound/core/timer.c:1939
    snd_timer_user_ioctl+0x67/0x95 sound/core/timer.c:1994
    ....

    It happens only when a value with INT_MAX is passed, as we're
    incrementing it unconditionally. So the fix is trivial, check the
    value with INT_MAX. Although the bug itself is fairly harmless, it's
    better to fix it so that fuzzers won't hit this again later.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200213
    Reported-and-tested-by: Team OWL337
    Cc:
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 5d302ed3cc80564fb835bed5fdba1e1250ecc9e5 upstream.

    According to "EP93xx User’s Guide", I2STXLinCtrlData and I2SRXLinCtrlData
    registers actually have different format. The only currently used bit
    (Left_Right_Justify) has different position. Fix this and simplify the
    whole setup taking into account the fact that both registers have zero
    default value.

    The practical effect of the above is repaired SND_SOC_DAIFMT_RIGHT_J
    support (currently unused).

    Signed-off-by: Alexander Sverdlin
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Alexander Sverdlin
     
  • commit 2d534113be9a2aa532a1ae127a57e83558aed358 upstream.

    The bit responsible for LRCLK polarity is i2s_tlrs (0), not i2s_trel (2)
    (refer to "EP93xx User's Guide").

    Previously card drivers which specified SND_SOC_DAIFMT_NB_IF actually got
    SND_SOC_DAIFMT_NB_NF, an adaptation is necessary to retain the old
    behavior.

    Signed-off-by: Alexander Sverdlin
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Alexander Sverdlin
     
  • commit 6a6ad7face95af0b9e6aaf1eb2261eb70240b89b upstream.

    Add the use_single_rw flag to regmap config since the
    device does not support bulk transactions over i2c.

    Signed-off-by: Paul Handrigan
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Paul Handrigan
     
  • commit ff2faf1289c1f81b5b26b9451dd1c2006aac8db8 upstream.

    dapm_kcontrol_data is freed as part of dapm_kcontrol_free(), leaving the
    paths pointer dangling in the list.

    This leads to system crash when we try to unload and reload sound card.
    I hit this bug during ADSP crash/reboot test case on Dragon board DB410c.

    Without this patch, on SLAB Poisoning enabled build, kernel crashes with
    "BUG kmalloc-128 (Tainted: G W ): Poison overwritten"

    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Srinivas Kandagatla