05 Jan, 2020

1 commit

  • Apply const prefix to each possible place: the MIDI data definitions,
    the static tables for volume parameters, etc.

    Just for minor optimization and no functional changes.

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

    Takashi Iwai
     

03 Jan, 2020

2 commits

  • The snd_seq_oss_callback items are just copied to another struct
    as-is, hence they can be declared as const.

    There should be no functional changes by this patch.

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

    Takashi Iwai
     
  • Change the argument of snd_midi_process_event() to receive a const
    snd_midi_op pointer and its callers respectively. This allows further
    optimizations.

    There should be no functional changes by this patch.

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

    Takashi Iwai
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


06 May, 2019

1 commit


27 Mar, 2019

1 commit

  • It's a feature request for the ancient sutff, but it's still valid;
    the loading of a GUS-patch isn't available via hwdep device although
    it's supported over OSS sequencer. The only missing piece is the call
    of snd_soundfont_load_guspatch() in synth emux hwdep code.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

07 Feb, 2019

1 commit


13 Dec, 2018

1 commit

  • info.mode and info.port are indirectly controlled by user-space,
    hence leading to a potential exploitation of the Spectre variant 1
    vulnerability.

    These issues were detected with the help of Smatch:

    sound/synth/emux/emux_hwdep.c:72 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[i]->ctrls' [w] (local cap)
    sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs' [w] (local cap)
    sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[info.port]->ctrls' [w] (local cap)

    Fix this by sanitizing both info.mode and info.port before using them
    to index emu->portptrs[i]->ctrls, emu->portptrs[info.port]->ctrls and
    emu->portptrs.

    Notice that given that speculation windows are large, the policy is
    to kill the speculation on the first load and not worry if it can be
    completed with a dependent load/store [1].

    [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

    Signed-off-by: Gustavo A. R. Silva
    Cc: stable@vger.kernel.org
    Signed-off-by: Takashi Iwai

    Gustavo A. R. Silva
     

03 Aug, 2018

1 commit

  • For a sake of code simplification, remove the init and the exit
    entries that do nothing.

    Notes for readers: actually it's OK to remove *both* init and exit,
    but not OK to remove the exit entry. By removing only the exit while
    keeping init, the module becomes permanently loaded; i.e. you cannot
    unload it any longer!

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

13 Nov, 2017

1 commit

  • …e/sound into for-linus

    ASoC: Updates for v4.15

    The biggest thing this release has been the conversion of the AC98 bus
    to the driver model, that's been a long time coming so thanks to Robert
    Jarzmik for his dedication there. Due to there being some AC97 MFD
    there's a few fairly large changes in input and the MFD layer, mainly to
    the wm97xx driver.

    There's also some drivers/drm changes to support the new AMD Stoney
    platform, these are shared with the DRM subsystem and should be being
    merged via both.

    Within the subsystem the overwhelming bulk of the changes is in the
    Intel drivers which continue to need lots of cleanups and fixes, this
    release they've also gained support for their open source firmware.
    There's also some large changs in the core as Morimoto-san continues to
    mirror operations into the component level in preparation for conversion
    of drivers to that.

    - The AC97 bus has finally caught up with the driver model thanks to
    some dedicated and persistent work from Robert Jarzmik.
    - Continued work from Morimoto-san on moving us towards being able to
    use components for everything.
    - Lots of cleanups for the Intel platform code, including support for
    their open source audio firmware.
    - Support for scaling MCLK with sample rate in simple-card.
    - Support for AMD Stoney platform.

    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
     

25 Oct, 2017

1 commit


16 Oct, 2017

1 commit


10 Aug, 2017

4 commits


28 Jun, 2017

1 commit

  • In the commit 3d774d5ef066 ("ALSA: seq: Allow the tristate build of
    OSS emulation") we changed CONFIG_SND_SEQUENCER_OSS to tristate, but a
    couple of places were forgotten, namely, opl3 and emux Makefile.
    These contain the line like
    snd-opl3-synth-$(CONFIG_SND_SEQUENCER_OSS) += opl3_oss.o
    and this doesn't work any longer as expected because snd-opl3-synth
    can be built-in while CONFIG_SND_SEQUENCER_OSS=m.

    This patch fixes these places to build properly for the new kconfig
    dependency. In the end, we had to use ifneq() to satisfy the
    requirement. It's a bit ugly, but lesser evil.

    Fixes: 3d774d5ef066 ("ALSA: seq: Allow the tristate build of OSS emulation")
    Reported-by: kbuild test robot
    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
     
  • Currently OSS sequencer emulation is tied with ALSA sequencer core,
    both are built in the same level; i.e. when CONFIG_SND_SEQUENCER=y,
    the OSS sequencer emulation is also always built-in, even though the
    functionality can be built as an individual module.

    This patch changes the rule and allows users to build snd-seq-oss
    module while others are built-in. Essentially, it's just a few simple
    changes in Kconfig and Makefile. Some driver codes like opl3 need to
    convert from the simple ifdef to IS_ENABLED(). But that's all.

    You might wonder how about the dependency: right, it can be messy, but
    it still works. Since we rewrote the sequencer binding with the
    standard bus, the driver can be bound at any time on demand. So, the
    synthesizer driver module can be loaded individually from the OSS
    emulation core before/after it.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

31 Mar, 2017

1 commit


28 Dec, 2016

1 commit

  • Prepare to mark sensitive kernel structures for randomization by making
    sure they're using designated initializers. These were identified during
    allyesconfig builds of x86, arm, and arm64, with most initializer fixes
    extracted from grsecurity.

    Signed-off-by: Kees Cook
    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Kees Cook
     

06 Jan, 2016

1 commit


05 Oct, 2015

1 commit

  • When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel
    warnings like:
    WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80()
    sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0'

    It's because both emux synth and opl3 drivers try to register their
    OSS device object with the same static index number 0. This hasn't
    been a big problem until the recent rewrite of device management code
    (that exposes sysfs at the same time), but it's been an obvious bug.

    This patch works around it just by using a different index number of
    emux synth object. There can be a more elegant way to fix, but it's
    enough for now, as this code won't be touched so often, in anyway.

    Reported-and-tested-by: Michael Shell
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

29 May, 2015

1 commit


28 Apr, 2015

1 commit

  • 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
     

27 Apr, 2015

1 commit

  • 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
     

29 Jan, 2015

1 commit


19 Jan, 2015

1 commit


04 Jan, 2015

1 commit


01 Jun, 2014

1 commit


01 Nov, 2011

2 commits


14 Sep, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

04 Dec, 2009

1 commit


29 May, 2009

1 commit


24 Mar, 2009

1 commit


05 Feb, 2009

1 commit