06 Jan, 2021

3 commits

  • [ Upstream commit 618de0f4ef11acd8cf26902e65493d46cc20cc89 ]

    The PCM hw_params core function tries to clear up the PCM buffer
    before actually using for avoiding the information leak from the
    previous usages or the usage before a new allocation. It performs the
    memset() with runtime->dma_bytes, but this might still leave some
    remaining bytes untouched; namely, the PCM buffer size is aligned in
    page size for mmap, hence runtime->dma_bytes doesn't necessarily cover
    all PCM buffer pages, and the remaining bytes are exposed via mmap.

    This patch changes the memory clearance to cover the all buffer pages
    if the stream is supposed to be mmap-ready (that guarantees that the
    buffer size is aligned in page size).

    Reviewed-by: Lars-Peter Clausen
    Link: https://lore.kernel.org/r/20201218145625.2045-3-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Sasha Levin

    Takashi Iwai
     
  • commit 88a06d6fd6b369d88cec46c62db3e2604a2f50d5 upstream.

    The runtime->avail field may be accessed concurrently while some
    places refer to it without taking the runtime->lock spinlock, as
    detected by KCSAN. Usually this isn't a big problem, but for
    consistency and safety, we should take the spinlock at each place
    referencing this field.

    Reported-by: syzbot+a23a6f1215c84756577c@syzkaller.appspotmail.com
    Reported-by: syzbot+3d367d1df1d2b67f5c19@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20201206083527.21163-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 4ebd47037027c4beae99680bff3b20fdee5d7c1e upstream.

    The snd_seq_queue struct contains various flags in the bit fields.
    Those are categorized to two different use cases, both of which are
    protected by different spinlocks. That implies that there are still
    potential risks of the bad operations for bit fields by concurrent
    accesses.

    For addressing the problem, this patch rearranges those flags to be
    a standard bool instead of a bit field.

    Reported-by: syzbot+63cbe31877bb80ef58f5@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20201206083456.21110-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

30 Dec, 2020

2 commits

  • commit 74c64efa1557fef731b59eb813f115436d18078e upstream.

    Since mmap for userspace is based on page alignment, add page alignment
    for iram alloc from pool, otherwise, some good data located in the same
    page of dmab->area maybe touched wrongly by userspace like pulseaudio.

    Signed-off-by: Robin Gong
    Cc:
    Link: https://lore.kernel.org/r/1608221747-3474-1-git-send-email-yibin.gong@nxp.com
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Robin Gong
     
  • commit 11cb881bf075cea41092a20236ba708b18e1dbb2 upstream.

    There are a few places that call round{up|down}_pow_of_two() with the
    value zero, and this causes undefined behavior warnings. Avoid
    calling those macros if such a nonsense value is passed; it's a minor
    optimization as well, as we handle it as either an error or a value to
    be skipped, instead.

    Reported-by: syzbot+33ef0b6639a8d2d42b4c@syzkaller.appspotmail.com
    Cc:
    Link: https://lore.kernel.org/r/20201218161730.26596-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

21 Dec, 2020

1 commit

  • commit 175b8d89fe292796811fdee87fa39799a5b6b87a upstream.

    syzbot spotted a potential out-of-bounds shift in the PCM OSS layer
    where it calculates the buffer size with the arbitrary shift value
    given via an ioctl.

    Add a range check for avoiding the undefined behavior.
    As the value can be treated by a signed integer, the max shift should
    be 30.

    Reported-by: syzbot+df7dc146ebdd6435eea3@syzkaller.appspotmail.com
    Cc:
    Link: https://lore.kernel.org/r/20201209084552.17109-2-tiwai@suse.de
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

13 Nov, 2020

1 commit

  • When processing request to add/replace user-defined element set, check
    of given element identifier and decision of numeric identifier is done
    in "__snd_ctl_add_replace()" helper function. When the result of check
    is wrong, the helper function returns error code. The error code shall
    be returned to userspace application.

    Current implementation includes bug to return zero to userspace application
    regardless of the result. This commit fixes the bug.

    Cc:
    Fixes: e1a7bfe38079 ("ALSA: control: Fix race between adding and removing a user element")
    Signed-off-by: Takashi Sakamoto
    Link: https://lore.kernel.org/r/20201113092043.16148-1-o-takashi@sakamocchi.jp
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

26 Oct, 2020

1 commit

  • Kernel-doc markups should use this format:
    identifier - description

    There is a common comment marked, instead, with kernel-doc
    notation.

    Some identifiers have different names between their prototypes
    and the kernel-doc markup.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Mark Brown
    Link: https://lore.kernel.org/r/535182d6f55d7a7de293dda9676df68f5f60afc6.1603469755.git.mchehab+huawei@kernel.org
    Signed-off-by: Takashi Iwai

    Mauro Carvalho Chehab
     

23 Sep, 2020

1 commit

  • Recently we applied a fix to cover the whole OSS sequencer ioctls with
    the mutex for dealing with the possible races. This works fine in
    general, but in theory, this may lead to unexpectedly long stall if an
    ioctl like SNDCTL_SEQ_SYNC is issued and an event with the far future
    timestamp was queued.

    For fixing such a potential stall, this patch changes the mutex lock
    applied conditionally excluding such an ioctl command. Also, change
    the mutex_lock() with the interruptible version for user to allow
    escaping from the big-hammer mutex.

    Fixes: 80982c7e834e ("ALSA: seq: oss: Serialize ioctls")
    Suggested-by: Pavel Machek
    Link: https://lore.kernel.org/r/20200922083856.28572-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

22 Sep, 2020

1 commit

  • The recent change in lockdep for read lock caused the deadlock
    warnings in ALSA control code which uses the read_lock() for
    notification and else while write_lock_irqsave() is used for adding
    and removing the list entry. Although a deadlock would practically
    never hit in a real usage (the addition and the deletion can't happen
    with the notification), it's better to fix the read_lock() usage in a
    semantically correct way.

    This patch replaces the read_lock() calls with read_lock_irqsave()
    version for avoiding a reported deadlock. The notification code path
    takes the irq disablement in anyway, and other code paths are very
    short execution, hence there shouldn't be any big performance hit by
    this change.

    Fixes: e918188611f0 ("locking: More accurate annotations for read_lock()")
    Reported-by: syzbot+561a74f84100162990b2@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20200922084953.29018-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

21 Sep, 2020

1 commit

  • Using compat_alloc_user_space() tends to add complexity
    to the ioctl handling, so I am trying to remove it everywhere.

    The two callers in sound/core can rewritten to just call
    the same code that operates on a kernel pointer as the
    native handler.

    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20200918095642.1446243-1-arnd@arndb.de
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     

10 Sep, 2020

2 commits

  • The tasklet is an old API that should be deprecated, usually can be
    converted to another decent API. In ALSA core timer API, the
    callbacks can be offlined to a tasklet when a flag is set in the timer
    backend. It can be achieved gracefully with a work queued in the
    high-prio system workqueue.

    This patch replaces the usage of tasklet in ALSA timer API with a
    simple work. Currently the tasklet feature is used only in the system
    timer and hrtimer backends, so both are patched to use the new flag
    name SNDRV_TIMER_HW_WORK, too.

    Link: https://lore.kernel.org/r/20200903104131.21097-3-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Back-merge to apply the tasklet conversion patches that are based
    on the already applied tasklet API changes on 5.9-rc4.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

03 Sep, 2020

9 commits

  • fix cppcheck:

    sound/core/rawmidi.c:1711:49: style:inconclusive: Function
    'snd_rawmidi_free' argument 1 names different: declaration 'rawmidi'
    definition 'rmidi'. [funcArgNamesDifferent]

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-16-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Follow recommendation in Documentation/scheduler/completion.rst and use
    macro to declare local 'struct completion'

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-9-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Fix cppcheck warning:

    sound/core/compress_offload.c:1044:6: style: Redundant initialization
    for 'ret'. The initialized value is overwritten before it is
    read. [redundantInitialization]

    ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS,
    ^
    sound/core/compress_offload.c:1034:10: note: ret is initialized
    int ret = -EINVAL;
    ^
    sound/core/compress_offload.c:1044:6: note: ret is overwritten
    ret = snd_register_device(SNDRV_DEVICE_TYPE_COMPRESS,
    ^

    Signed-off-by: Pierre-Louis Bossart
    Acked-by: Vinod Koul
    Link: https://lore.kernel.org/r/20200902212133.30964-8-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Fix cppcheck warning and only dereference once the initial checks are
    done:

    sound/core/compress_offload.c:516:38: warning: Either the condition
    '!stream' is redundant or there is possible null pointer dereference:
    stream. [nullPointerRedundantCheck]
    struct snd_compr_runtime *runtime = stream->runtime;
    ^
    sound/core/compress_offload.c:518:17: note: Assuming that condition
    '!stream' is not redundant
    if (snd_BUG_ON(!(stream) || !(stream)->runtime))
    ^
    sound/core/compress_offload.c:516:38: note: Null pointer dereference
    struct snd_compr_runtime *runtime = stream->runtime;
    ^

    Signed-off-by: Pierre-Louis Bossart
    Acked-by: Vinod Koul
    Link: https://lore.kernel.org/r/20200902212133.30964-7-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • fix cppcheck warning:

    sound/core/timer.c:1286:9: style: Clarify calculation precedence for
    '&' and '?'. [clarifyCalculation]
    ? "running" : "stopped");
    ^

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-6-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Cppcheck complains about a possible NULL pointer dereference but it
    actually looks like the NULL assignment is not needed (same loop is
    used in other parts of the file without it).

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-5-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Fix cppcheck warnings:

    sound/core/pcm_memory.c:380:26: warning: Either the condition
    '!substream' is redundant or there is possible null pointer
    dereference: substream. [nullPointerRedundantCheck]
    struct snd_card *card = substream->pcm->card;
    ^
    sound/core/pcm_memory.c:384:6: note: Assuming that condition
    '!substream' is not redundant
    if (PCM_RUNTIME_CHECK(substream))
    ^
    sound/core/pcm_memory.c:380:26: note: Null pointer dereference
    struct snd_card *card = substream->pcm->card;
    ^
    sound/core/pcm_memory.c:433:26: warning: Either the condition
    '!substream' is redundant or there is possible null pointer
    dereference: substream. [nullPointerRedundantCheck]
    struct snd_card *card = substream->pcm->card;
    ^
    sound/core/pcm_memory.c:436:6: note: Assuming that condition
    '!substream' is not redundant
    if (PCM_RUNTIME_CHECK(substream))
    ^
    sound/core/pcm_memory.c:433:26: note: Null pointer dereference
    struct snd_card *card = substream->pcm->card;
    ^

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-4-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Fix cppcheck, the fallthrough only makes sense within the conditional
    block

    sound/core/memalloc.c:161:3: style:inconclusive: Statements following
    return, break, continue, goto or throw will never be
    executed. [unreachableCode]
    fallthrough;
    ^

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-3-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     
  • Fix sparse warning:

    sound/core/pcm.c:999:9: warning: context imbalance in
    'snd_pcm_detach_substream' - different lock contexts for basic block

    There's no real reason to test the same thing twice, and it's simpler
    have linear sequences.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200902212133.30964-2-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     

02 Sep, 2020

2 commits


01 Sep, 2020

1 commit

  • The PCM OSS mulaw plugin has a check of the format of the counter part
    whether it's a linear format. The check is with snd_BUG_ON() that
    emits WARN_ON() when the debug config is set, and it confuses
    syzkaller as if it were a serious issue. Let's drop snd_BUG_ON() for
    avoiding that.

    While we're at it, correct the error code to a more suitable, EINVAL.

    Reported-by: syzbot+23b22dc2e0b81cbfcc95@syzkaller.appspotmail.com
    Cc:
    Link: https://lore.kernel.org/r/20200901131802.18157-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

07 Aug, 2020

1 commit

  • Pull sound updates from Takashi Iwai:
    "This became wide and scattered updates all over the sound tree as
    diffstat shows: lots of (still ongoing) refactoring works in ASoC,
    fixes and cleanups caught by static analysis, inclusive term
    conversions as well as lots of new drivers. Below are highlights:

    ASoC core:
    - API cleanups and conversions to the unified mute_stream() call
    - Simplify I/O helper functions
    - Use helper macros to retrieve RTD from substreams

    ASoC drivers:
    - Lots of fixes and cleanups in Intel ASoC drivers
    - Lots of new stuff: Freescale MQS and i.MX6sx, Intel KeemBay I2S,
    Maxim MAX98360A and MAX98373 SoundWire, various Mediatek boards,
    nVidia Tegra 186 and 210, RealTek RL6231, Samsung Midas and Aries
    boards, TI J721e EVM

    ALSA core:
    - Minor code refacotring for SG-buffer handling

    HD-audio:
    - Generalization of mute-LED handling with LED classdev
    - Intel silent stream support for HDMI
    - Device-specific fixes: CA0132, Loongson-3

    Others:
    - Usual USB- and HD-audio quirks for various devices
    - Fixes for echoaudio DMA position handling
    - Various documents and trivial fixes for sparse warnings
    - Conversion to adopt inclusive terms"

    * tag 'sound-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (479 commits)
    ALSA: pci: delete repeated words in comments
    ALSA: isa: delete repeated words in comments
    ALSA: hda/tegra: Add 100us dma stop delay
    ALSA: hda: Add dma stop delay variable
    ASoC: hda/tegra: Set buffer alignment to 128 bytes
    ALSA: seq: oss: Serialize ioctls
    ALSA: hda/hdmi: Add quirk to force connectivity
    ALSA: usb-audio: add startech usb audio dock name
    ALSA: usb-audio: Add support for Lenovo ThinkStation P620
    Revert "ALSA: hda: call runtime_allow() for all hda controllers"
    ALSA: hda/ca0132 - Fix AE-5 microphone selection commands.
    ALSA: hda/ca0132 - Add new quirk ID for Recon3D.
    ALSA: hda/ca0132 - Fix ZxR Headphone gain control get value.
    ALSA: hda/realtek: Add alc269/alc662 pin-tables for Loongson-3 laptops
    ALSA: docs: fix typo
    ALSA: doc: use correct config variable name
    ASoC: core: Two step component registration
    ASoC: core: Simplify snd_soc_component_initialize declaration
    ASoC: core: Relocate and expose snd_soc_component_initialize
    ASoC: sh: Replace 'select' DMADEVICES 'with depends on'
    ...

    Linus Torvalds
     

05 Aug, 2020

2 commits

  • Some ioctls via OSS sequencer API may race and lead to UAF when the
    port create and delete are performed concurrently, as spotted by a
    couple of syzkaller cases. This patch is an attempt to address it by
    serializing the ioctls with the existing register_mutex.

    Basically OSS sequencer API is an obsoleted interface and was designed
    without much consideration of the concurrency. There are very few
    applications with it, and the concurrent performance isn't asked,
    hence this "big hammer" approach should be good enough.

    Reported-by: syzbot+1a54a94bd32716796edd@syzkaller.appspotmail.com
    Reported-by: syzbot+9d2abfef257f3e2d4713@syzkaller.appspotmail.com
    Suggested-by: Hillf Danton
    Cc:
    Link: https://lore.kernel.org/r/20200804185815.2453-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Pull uninitialized_var() macro removal from Kees Cook:
    "This is long overdue, and has hidden too many bugs over the years. The
    series has several "by hand" fixes, and then a trivial treewide
    replacement.

    - Clean up non-trivial uses of uninitialized_var()

    - Update documentation and checkpatch for uninitialized_var() removal

    - Treewide removal of uninitialized_var()"

    * tag 'uninit-macro-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    compiler: Remove uninitialized_var() macro
    treewide: Remove uninitialized_var() usage
    checkpatch: Remove awareness of uninitialized_var() macro
    mm/debug_vm_pgtable: Remove uninitialized_var() usage
    f2fs: Eliminate usage of uninitialized_var() macro
    media: sur40: Remove uninitialized_var() usage
    KVM: PPC: Book3S PR: Remove uninitialized_var() usage
    clk: spear: Remove uninitialized_var() usage
    clk: st: Remove uninitialized_var() usage
    spi: davinci: Remove uninitialized_var() usage
    ide: Remove uninitialized_var() usage
    rtlwifi: rtl8192cu: Remove uninitialized_var() usage
    b43: Remove uninitialized_var() usage
    drbd: Remove uninitialized_var() usage
    x86/mm/numa: Remove uninitialized_var() usage
    docs: deprecated.rst: Add uninitialized_var()

    Linus Torvalds
     

03 Aug, 2020

1 commit


21 Jul, 2020

1 commit

  • Pull sound fixes from Takashi Iwai:
    "This became fairly large, containing mostly the collection of ASoC
    fixes that slipped from the previous request, so I sent now a bit
    earlier than usual. But all changes look small and mostly
    device-specific, hence nothing to worry too much.

    Majority of changes are for x86 based platforms and their CODEC
    drivers, in order to address some issues hit by their recent tests and
    fuzzing. The rest are other ASoC device-specific fixes (imx, qcom,
    wm8974, amd, rockchip) as well as a trivial fix for a kernel WARNING
    hit by syzkaller"

    * tag 'sound-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (28 commits)
    ALSA: hda/realtek: Fixed ALC298 sound bug by adding quirk for Samsung Notebook Pen S
    ALSA: info: Drop WARN_ON() from buffer NULL sanity check
    ASoC: rt5682: Report the button event in the headset type only
    ASoC: Intel: bytcht_es8316: Add missed put_device()
    ASoC: rt5682: Enable Vref2 under using PLL2
    ASoC: rt286: fix unexpected interrupt happens
    ASoC: wm8974: remove unsupported clock mode
    ASoC: wm8974: fix Boost Mixer Aux Switch
    ASoC: SOF: core: fix null-ptr-deref bug during device removal
    ASoc: codecs: max98373: remove Idle_bias_on to let codec suspend
    ASoC: codecs: max98373: Removed superfluous volume control from chip default
    ASoC: topology: fix tlvs in error handling for widget_dmixer
    ASoC: topology: fix kernel oops on route addition error
    ASoC: SOF: imx: add min/max channels for SAI/ESAI on i.MX8/i.MX8M
    ASoC: Intel: bdw-rt5677: fix non BE conversion
    ASoC: soc-dai: set dai_link dpcm_ flags with a helper
    MAINTAINERS: Add Shengjiu to reviewer list of sound/soc/fsl
    ASoC: core: Remove only the registered component in devm functions
    MAINTAINERS: Change Maintainer for some at91 drivers
    ASoC: dt-bindings: simple-card: Fix 'make dt_binding_check' warnings
    ...

    Linus Torvalds
     

20 Jul, 2020

1 commit

  • Follow the recent inclusive terminology guidelines and replace the
    word "slave" in vmaster API. I chose the word "follower" at this time
    since it seems fitting for the purpose.

    Note that the word "master" is kept in API, since it refers rather to
    audio master volume control.

    Also, while we're at it, a typo in comments is corrected, too.

    Link: https://lore.kernel.org/r/20200717154517.27599-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

17 Jul, 2020

3 commits

  • snd_info_get_line() has a sanity check of NULL buffer -- both buffer
    itself being NULL and buffer->buffer being NULL. Basically both
    checks are valid and necessary, but the problem is that it's with
    snd_BUG_ON() macro that triggers WARN_ON(). The latter condition
    (NULL buffer->buffer) can be met arbitrarily by user since the buffer
    is allocated at the first write, so it means that user can trigger
    WARN_ON() at will.

    This patch addresses it by simply moving buffer->buffer NULL check out
    of snd_BUG_ON() so that spurious WARNING is no longer triggered.

    Reported-by: syzbot+e42d0746c3c3699b6061@syzkaller.appspotmail.com
    Cc:
    Link: https://lore.kernel.org/r/20200717084023.5928-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This reverts commit 3ad796cbc36a ("ALSA: pcm: Use SG-buffer only when
    direct DMA is available") also the modification commit 467fd0e82b62
    ("ALSA: pcm: Fix build error on m68k and others").

    Poking the DMA internal helper is a layer violation, so we should
    avoid that. Meanwhile the actual bug has been addressed by the
    Kconfig fix in commit dbed452a078d ("dma-pool: decouple DMA_REMAP from
    DMA_COHERENT_POOL"), so we can live without this hack.

    Link: https://lore.kernel.org/r/20200717064130.22957-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Using uninitialized_var() is dangerous as it papers over real bugs[1]
    (or can in the future), and suppresses unrelated compiler warnings
    (e.g. "unused variable"). If the compiler thinks it is uninitialized,
    either simply initialize the variable or make compiler changes.

    In preparation for removing[2] the[3] macro[4], remove all remaining
    needless uses with the following script:

    git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
    xargs perl -pi -e \
    's/\buninitialized_var\(([^\)]+)\)/\1/g;
    s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

    drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
    pathological white-space.

    No outstanding warnings were found building allmodconfig with GCC 9.3.0
    for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
    alpha, and m68k.

    [1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
    [2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
    [3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
    [4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

    Reviewed-by: Leon Romanovsky # drivers/infiniband and mlx4/mlx5
    Acked-by: Jason Gunthorpe # IB
    Acked-by: Kalle Valo # wireless drivers
    Reviewed-by: Chao Yu # erofs
    Signed-off-by: Kees Cook

    Kees Cook
     

09 Jul, 2020

2 commits

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200708203236.GA5112@embeddedor
    Signed-off-by: Takashi Iwai

    Gustavo A. R. Silva
     
  • Pull sound fixes from Takashi Iwai:
    "A collection of small, mostly device-specific fixes.

    The significant one is the regression fix for USB-audio implicit
    feedback devices due to the incorrect frame size calculation, which
    landed in 5.8 and stable trees.

    In addition, a few usual HD-audio and USB-audio quirks, Intel HDMI
    fixes, ASoC fsl and rt5682 fixes, as well as the fix in
    compress-offload partial drain operation"

    * tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: compress: fix partial_drain completion state
    ALSA: usb-audio: Add implicit feedback quirk for RTX6001
    ALSA: usb-audio: add quirk for MacroSilicon MS2109
    ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC
    ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC
    ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC
    ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id
    ALSA: hda/hdmi: improve debug traces for stream lookups
    ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later
    ALSA: opl3: fix infoleak in opl3
    ALSA: usb-audio: Replace s/frame/packet/ where appropriate
    ALSA: usb-audio: Fix packet size calculation
    AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module
    ALSA: hda - let hs_mic be picked ahead of hp_mic
    ASoC: rt5682: fix the pop noise while OMTP type headset plugin
    ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable
    ASoC: fsl_mqs: Don't check clock is NULL before calling clk API

    Linus Torvalds
     

07 Jul, 2020

3 commits

  • The commit 3ad796cbc36a ("ALSA: pcm: Use SG-buffer only when direct
    DMA is available") introduced a check of the DMA type and this caused
    a build error on m68k (and possibly some others) due to the lack of
    dma_is_direct() definition. Since the check is needed only for
    CONFIG_SND_DMA_SGBUF enablement (i.e. solely x86), use #ifdef instead
    of IS_ENABLED() for avoiding such a build error.

    Fixes: 3ad796cbc36a ("ALSA: pcm: Use SG-buffer only when direct DMA is available")
    Reported-by: kernel test robot
    Link: https://lore.kernel.org/r/20200707111225.26826-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • On partial_drain completion we should be in SNDRV_PCM_STATE_RUNNING
    state, so set that for partially draining streams in
    snd_compr_drain_notify() and use a flag for partially draining streams

    While at it, add locks for stream state change in
    snd_compr_drain_notify() as well.

    Fixes: f44f2a5417b2 ("ALSA: compress: fix drain calls blocking other compress functions (v6)")
    Reviewed-by: Srinivas Kandagatla
    Tested-by: Srinivas Kandagatla
    Reviewed-by: Charles Keepax
    Tested-by: Charles Keepax
    Signed-off-by: Vinod Koul
    Link: https://lore.kernel.org/r/20200629134737.105993-4-vkoul@kernel.org
    Signed-off-by: Takashi Iwai

    Vinod Koul
     
  • Fix W=1 warning. The kernel doc uses the hwparams type instead of the
    argument name.

    Signed-off-by: Pierre-Louis Bossart
    Link: https://lore.kernel.org/r/20200702193842.169215-1-pierre-louis.bossart@linux.intel.com
    Signed-off-by: Takashi Iwai

    Pierre-Louis Bossart
     

25 Jun, 2020

1 commit

  • The module argument passed to snd_card_new() must be a valid non-NULL
    pointer when the module support is enabled. Since ASoC driver passes
    the argument from each snd_soc_card definition, one may forget to set
    the owner field and lead to a NULL module easily.

    For catching such an overlook, add a WARN_ON() in snd_card_new().
    Also, put the card->module assignment in the ifdef block for a very
    minor optimization.

    Link: https://lore.kernel.org/r/20200624160300.21703-1-tiwai@suse.de
    Signed-off-by: Takashi Iwai

    Takashi Iwai