06 Dec, 2018

1 commit

  • commit 7b69154171b407844c273ab4c10b5f0ddcd6aa29 upstream.

    Some spurious calls of snd_free_pages() have been overlooked and
    remain in the error paths of wss driver code. Since runtime->dma_area
    is managed by the PCM core helper, we shouldn't release manually.

    Drop the superfluous calls.

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

    Takashi Iwai
     

26 Sep, 2018

1 commit

  • [ Upstream commit 7c500f9ea139d0c9b80fdea5a9c911db3166ea54 ]

    The default sample sizes set by msnd driver are bogus; it sets ALSA
    PCM format, not the actual bit width.

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

    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
     

17 Aug, 2017

15 commits


15 Aug, 2017

1 commit


13 Aug, 2017

9 commits


04 Aug, 2017

1 commit


18 Jul, 2017

4 commits

  • We pass a long name from "codec->pcm->name" into the longname
    string of the same length:

    sound/isa/opti9xx/miro.c: In function 'snd_miro_probe':
    sound/isa/opti9xx/miro.c:1356:39: error: '%s' directive writing up to 79 bytes into a region of size between 35 and 72 [-Werror=format-overflow=]
    sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
    ^~
    sound/isa/opti9xx/miro.c:1356:26: note: using the range [0, 4294967295] for directive argument
    sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sound/isa/opti9xx/miro.c:1356:2: note: 'sprintf' output between 32 and 185 bytes into a destination of size 80
    sprintf(card->longname, "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d",

    There is no easy way to avoid the theoretical overflow in this case,
    but using snprintf() will turn it into a harmless truncation.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • The snd_pcm name is too long to fit into the card shortname
    or a part of the longname:

    sound/isa/ad1848/ad1848.c: In function 'snd_ad1848_probe':
    sound/isa/ad1848/ad1848.c:116:26: error: ' at 0x' directive writing 6 bytes into a region of size between 1 and 80 [-Werror=format-overflow=]
    sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sound/isa/ad1848/ad1848.c:116:2: note: 'sprintf' output between 22 and 128 bytes into a destination of size 80
    sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    chip->pcm->name, chip->port, irq[n], dma1[n]);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    This changes the code to use length-checking functions that truncate
    if necessary. The "[Thinkpad]" substring is now also part of the
    snprintf(), as that could also overflow the buffer.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • The snd_pcm name may overflow the card->longname total size:

    sound/isa/cs423x/cs4231.c: In function 'snd_cs4231_probe':
    sound/isa/cs423x/cs4231.c:115:26: error: ' at 0x' directive writing 6 bytes into a region of size between 1 and 80 [-Werror=format-overflow=] 0x%lx, irq %d, dma %d",
    sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    This changes the driver to use snprintf() so we truncate the string
    instead of overflowing into the next field if that happens.

    I decided to split out the second format string for the extra
    DMA channel to keep the code simpler.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     
  • The compiler sees that the format string might overflow for the longname:

    sound/isa/als100.c: In function 'snd_als100_pnp_detect':
    sound/isa/als100.c:225:27: error: ', dma ' directive writing 6 bytes into a region of size between 0 and 64 [-Werror=format-overflow=]
    sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    sound/isa/als100.c:225:3: note: 'sprintf' output between 24 and 113 bytes into a destination of size 80
    sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",

    Open-coding "shortname" here gets us below the limit, and using
    snprintf() is a good idea too.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Takashi Iwai

    Arnd Bergmann
     

15 Jul, 2017

1 commit

  • Pull sound fixes from Takashi Iwai:
    "Small last-minute fixes for 4.13-rc1: a couple of PCM fixes for m68k,
    a cleanup work for legacy ISA msnd driver, and a few HD-audio new IDs
    and quirks"

    * tag 'sound-fix-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda - Add hdmi id for a Geminilake variant
    ALSA: hda/realtek - New codec device ID for ALC1220
    ALSA: pcm: Simplify check for dma_mmap_coherent() availability
    ALSA: pcm: Protect call to dma_mmap_coherent() by check for HAS_DMA
    ALSA: msnd: Optimize / harden DSP and MIDI loops
    ALSA: hda/realtek - change the location for one of two front microphones
    ALSA: opl4: Move inline before return type

    Linus Torvalds
     

07 Jul, 2017

2 commits

  • The ISA msnd drivers have loops fetching the ring-buffer head, tail
    and size values inside the loops. Such codes are inefficient and
    fragile.

    This patch optimizes it, and also adds the sanity check to avoid the
    endless loops.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196131
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196133
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Pull sound updates from Takashi Iwai:
    "This development cycle resulted in a fair amount of changes in both
    core and driver sides. The most significant change in ALSA core is
    about PCM. Also the support of of-graph card and the new DAPM widget
    for DSP are noteworthy changes in ASoC core. And there're lots of
    small changes splat over the tree, as you can see in diffstat.

    Below are a few highlights:

    ALSA core:
    - Removal of set_fs() hackery from PCM core stuff, and the code
    reorganization / optimization thereafter
    - Improved support of PCM ack ops, and a new ABI for improved
    control/status mmap handling
    - Lots of constifications in various codes

    ASoC core:
    - The support of of-graph card, which may work as a better generic
    device for a replacement of simple-card
    - New widget types intended mainly for use with DSPs

    ASoC drivers:
    - New drivers for Allwinner V3s SoCs
    - Ensonic ES8316 codec support
    - More Intel SKL and KBL works
    - More device support for Intel SST Atom (mostly for cheap tablets
    and 2-in-1 devices)
    - Support for Rockchip PDM controllers
    - Support for STM32 I2S and S/PDIF controllers
    - Support for ZTE AUD96P22 codecs

    HD-audio:
    - Support of new Realtek codecs (ALC215/ALC285/ALC289), more quirks
    for HP and Dell machines
    - A few more fixes for i915 component binding"

    * tag 'sound-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (418 commits)
    ALSA: hda - Fix unbalance of i915 module refcount
    ASoC: Intel: Skylake: Remove driver debugfs exit
    ASoC: Intel: Skylake: explicitly add the headers sst-dsp.h
    ALSA: hda/realtek - Remove GPIO_MASK
    ALSA: hda/realtek - Fix typo of pincfg for Dell quirk
    ALSA: pcm: add a documentation for tracepoints
    ALSA: atmel: ac97c: fix error return code in atmel_ac97c_probe()
    ALSA: x86: fix error return code in hdmi_lpe_audio_probe()
    ASoC: Intel: Skylake: Add support to read firmware registers
    ASoC: Intel: Skylake: Add sram address to sst_addr structure
    ASoC: Intel: Skylake: Debugfs facility to dump module config
    ASoC: Intel: Skylake: Add debugfs support
    ASoC: fix semicolon.cocci warnings
    ASoC: rt5645: Add quirk override by module option
    ASoC: rsnd: make arrays path and cmd_case static const
    ASoC: audio-graph-card: add widgets and routing for external amplifier support
    ASoC: audio-graph-card: update bindings for amplifier support
    ASoC: rt5665: calibration should be done before jack detection
    ASoC: rsnd: constify dev_pm_ops structures.
    ASoC: nau8825: change crosstalk-bypass property to bool type
    ...

    Linus Torvalds
     

20 Jun, 2017

1 commit

  • Rename:

    wait_queue_t => wait_queue_entry_t

    'wait_queue_t' was always a slight misnomer: its name implies that it's a "queue",
    but in reality it's a queue *entry*. The 'real' queue is the wait queue head,
    which had to carry the name.

    Start sorting this out by renaming it to 'wait_queue_entry_t'.

    This also allows the real structure name 'struct __wait_queue' to
    lose its double underscore and become 'struct wait_queue_entry',
    which is the more canonical nomenclature for such data types.

    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

12 Jun, 2017

1 commit

  • Many drivers bind the sequencer stuff in off-load by another driver
    module, so that it's loaded only on demand. In the current code, this
    mechanism doesn't work when the driver is built-in while the sequencer
    is module. We check with IS_REACHABLE() and enable only when the
    sequencer is in the same level of build.

    However, this is basically a overshoot. The binder code
    (snd-seq-device) is an individual module from the sequencer core
    (snd-seq), and we just have to make the former a built-in while
    keeping the latter a module for allowing the scenario like the above.

    This patch achieves that by rewriting Kconfig slightly. Now, a driver
    that provides the manual sequencer device binding should select
    CONFIG_SND_SEQ_DEVICE in a way as
    select SND_SEQ_DEVICE if SND_SEQUENCER != n

    Note that the "!=n" is needed here to avoid the influence of the
    sequencer core is module while the driver is built-in.

    Also, since rawmidi.o may be linked with snd_seq_device.o when
    built-in, we have to shuffle the code to make the linker happy.
    (the kernel linker isn't smart enough yet to handle such a case.)
    That is, snd_seq_device.c is moved to sound/core from sound/core/seq,
    as well as Makefile.

    Last but not least, the patch replaces the code using IS_REACHABLE()
    with IS_ENABLED(), since now the condition meets always when enabled.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

10 Jun, 2017

2 commits

  • Instead of the non-standard way to enable the build of snd-emux-synth
    module inside Makefile, rewrite Kconfig to select the item explicitly
    from each driver (sbawe and emu10k1). This is the standard way.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • This is a slightly intensive rewrite of Kconfig and Makefile about
    ALSA sequencer stuff.

    The first major change is that the kconfig items for the sequencer are
    moved to sound/core/seq/Kconfig. OK, that's easy.

    The substantial change is that, instead of hackish top-level module
    selection in Makefile, we define a Kconfig item for each sequencer
    module. The driver that requires such sequencer components select
    exclusively the kconfig items. This is more straightforward and
    standard way.

    Signed-off-by: Takashi Iwai

    Takashi Iwai