Permalink
Commits on Sep 3, 2018
  1. ALSA: rawmidi: Initialize allocated buffers

    tiwai committed Sep 3, 2018
    syzbot reported the uninitialized value exposure in certain situations
    using virmidi loop.  It's likely a very small race at writing and
    reading, and the influence is almost negligible.  But it's safer to
    paper over this just by replacing the existing kvmalloc() with
    kvzalloc().
    
    Reported-by: syzbot+194dffdb8b22fc5d207a@syzkaller.appspotmail.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commits on Aug 30, 2018
  1. ALSA: hda - Fix cancel_work_sync() stall from jackpoll work

    tiwai committed Aug 30, 2018
    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: <stable@vger.kernel.org>
    Cc: Lukas Wunner <lukas@wunner.de>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commits on Aug 17, 2018
  1. EDAC: Add missing MEM_LRDDR4 entry in edac_mem_types[]

    tiwai authored and Borislav Petkov committed Aug 10, 2018
    The edac_mem_types[] array misses a MEM_LRDDR4 entry, which leads to
    NULL pointer dereference when accessed via sysfs or such.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
    Cc: Yazen Ghannam <Yazen.Ghannam@amd.com>
    Cc: linux-edac <linux-edac@vger.kernel.org>
    Cc: <stable@vger.kernel.org>
    Link: http://lkml.kernel.org/r/20180810141426.8918-1-tiwai@suse.de
    Fixes: 1e8096b ("EDAC: Add LRDDR4 DRAM type")
    Signed-off-by: Borislav Petkov <bp@suse.de>
Commits on Aug 14, 2018
  1. ALSA: seq: virmidi: Fix discarding the unsubscribed output

    tiwai committed Aug 14, 2018
    The recent change to move the virmidi output processing to a work
    slightly modified the code to discard the unsubscribed outputs so that
    it works without a temporary buffer.  However, this is actually buggy,
    and may spew a kernel warning due to the unexpected call of
    snd_rawmidi_transmit_ack(), as triggered by syzbot.
    
    This patch takes back to the original code in that part, use a
    temporary buffer and simply repeat snd_rawmidi_transmit(), in order to
    address the regression.
    
    Fixes: f7debfe ("ALSA: seq: virmidi: Offload the output event processing")
    Reported-by: syzbot+ec5f605c91812d200367@syzkaller.appspotmail.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  2. hv/netvsc: Fix NULL dereference at single queue mode fallback

    tiwai authored and davem330 committed Aug 14, 2018
    The recent commit 916c5e1 ("hv/netvsc: fix handling of fallback
    to single queue mode") tried to fix the fallback behavior to a single
    queue mode, but it changed the function to return zero incorrectly,
    while the function should return an object pointer.  Eventually this
    leads to a NULL dereference at the callers that expect non-NULL
    value.
    
    Fix it by returning the proper net_device object.
    
    Fixes: 916c5e1 ("hv/netvsc: fix handling of fallback to single queue mode")
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
Commits on Aug 13, 2018
  1. Merge tag 'asoc-v4.19' of https://git.kernel.org/pub/scm/linux/kernel…

    tiwai committed Aug 13, 2018
    …/git/broonie/sound into for-linus
    
    ASoC: Updates for v4.19
    
    A fairly big update, including quite a bit of core activity this time
    around (which is good to see) along with a fairly large set of new
    drivers.
    
     - A new snd_pcm_stop_xrun() helper which is now used in several
       drivers.
     - Support for providing name prefixes to generic component nodes.
     - Quite a few fixes for DPCM as it gains a bit wider use and more
       robust testing.
     - Generalization of the DIO2125 support to a simple amplifier driver.
     - Accessory detection support for the audio graph card.
     - DT support for PXA AC'97 devices.
     - Quirks for a number of new x86 systems.
     - Support for AM Logic Meson, Everest ES7154, Intel systems with
       RT5682, Qualcomm QDSP6 and WCD9335, Realtek RT5682 and TI TAS5707.
Commits on Aug 12, 2018
  1. Merge branch 'for-next' into for-linus

    tiwai committed Aug 12, 2018
    Preparation for 4.19 merge material.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commits on Aug 3, 2018
  1. ALSA: synth: Remove empty init and exit

    tiwai committed Aug 3, 2018
    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 <tiwai@suse.de>
  2. ALSA: pci: Remove empty init and exit

    tiwai committed Aug 3, 2018
    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 <tiwai@suse.de>
  3. ALSA: i2c: Remove empty init and exit

    tiwai committed Aug 3, 2018
    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 <tiwai@suse.de>
  4. ALSA: isa: Remove empty init and exit

    tiwai committed Aug 3, 2018
    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 <tiwai@suse.de>
  5. ALSA: drivers: Remove empty init and exit

    tiwai committed Aug 3, 2018
    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 <tiwai@suse.de>
  6. ALSA: compress: Remove empty init and exit

    tiwai committed Aug 3, 2018
    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 <tiwai@suse.de>
Commits on Aug 2, 2018
  1. ALSA: sb: Fix a typo

    tiwai committed Aug 2, 2018
    There was a typo of COPY_USER in the dead code (that is disabled
    as default).
    
    Fixes: 4b83eff ("ALSA: sb: Convert to the new PCM ops")
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commits on Aug 1, 2018
  1. ALSA: seq: Drop unused 64bit division macros

    tiwai committed Aug 1, 2018
    The old ugly macros remained in the code without usage.
    Rip them off.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  2. ALSA: seq: Use no intrruptible mutex_lock

    tiwai committed Aug 1, 2018
    All usages of mutex in ALSA sequencer core would take too long, hence
    we don't have to care about the user interruption that makes things
    complicated.  Let's replace them with simpler mutex_lock().
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  3. ALSA: seq: Fix leftovers at probe error path

    tiwai committed Aug 1, 2018
    The sequencer core module doesn't call some destructors in the error
    path of the init code, which may leave some resources.
    
    This patch mainly fix these leaks by calling the destructors
    appropriately at alsa_seq_init().  Also the patch brings a few
    cleanups along with it, namely:
    
    - Expand the old "if ((err = xxx) < 0)" coding style
    - Get rid of empty seq_queue_init() and its caller
    - Change snd_seq_info_done() to void
    
    Last but not least, a couple of functions lose __exit annotation since
    they are called also in alsa_seq_init().
    
    No functional changes but minor code cleanups.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  4. ALSA: seq: Remove dead codes

    tiwai committed Aug 1, 2018
    There are a few functions that have been commented out for ages.
    And also there are functions that do nothing but placeholders.
    Let's kill them.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  5. ALSA: seq: Minor cleanup of MIDI event parser helpers

    tiwai committed Aug 1, 2018
    snd_midi_event_encode_byte() can never fail, and it can return rather
    true/false.  Change the return type to bool, adjust the argument to
    receive a MIDI byte as unsigned char, and adjust the comment
    accordingly.  This allows callers to drop error checks, which
    simplifies the code.
    
    Meanwhile, snd_midi_event_encode() helper is used only in seq_midi.c,
    and it can be better folded into it.  This will reduce the total
    amount of lines in the end.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commits on Jul 30, 2018
  1. ALSA: seq: virmidi: Use READ_ONCE/WRITE_ONCE() macros

    tiwai committed Jul 30, 2018
    The trigger flag in vmidi object can be referred in different contexts
    concurrently, hence it's better to be put with READ_ONCE() and
    WRITE_ONCE() macros to assure the accesses.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  2. ALSA: seq: virmidi: Offload the output event processing

    tiwai committed Jul 29, 2018
    The virmidi sequencer stuff tries to translate the rawmidi bytes to
    sequencer events and deliver the packets at trigger callback.  The
    amount of the whole process of these translations and deliveries
    depends on the incoming rawmidi bytes, and we have no limit for that;
    this was the cause of a CPU soft lockup that had been reported and
    fixed recently.
    
    Although we've fixed the soft lockup by putting the temporary unlock
    and cond_resched(), it's rather a quick band aid.  In this patch,
    meanwhile, the event parsing and delivery process is offloaded to a
    dedicated work, and the trigger callback just kicks it off.  It has
    three merits, at least:
    
    - The processing is always done in a sleepable context, which can
      assure the event delivery with non-atomic flag without hackish
      is_atomic() usage.
    
    - Other relevant codes can be simplified, reducing the lines
    
    - It makes me happier
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  3. ALSA: memalloc: Fix missing PAGE_SIZE definition

    tiwai authored and broonie committed Jul 30, 2018
    The recent fix moved the inline snd_sgbuf_aligned_pages() outside the
    ifdef, and this triggered a build error on some architectures due to
    the undefined PAGE_SIZE, as spotted by 0day bot.
    Fix it by adding the missing header inclusion.
    
    Fixes: 4cae99d ("ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally")
    Reported-by: kbuild test robot <lkp@intel.com>
    Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Mark Brown <broonie@kernel.org>
Commits on Jul 29, 2018
  1. Merge branch 'for-linus' into topic/virmidi

    tiwai committed Jul 29, 2018
    Pull the latest ALSA sequencer fixes for the further development of
    virmidi.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  2. ALSA: hda/hdmi: Use single mutex unlock in error paths

    tiwai committed Jul 12, 2018
    Instead of calling mutex_unlock() at each error path multiple times,
    take the standard goto-and-a-single-unlock approach.  This will
    simplify the code and make easier to find the unbalanced mutex locks.
    
    No functional changes, but only the code readability improvement as a
    preliminary work for further changes.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commits on Jul 27, 2018
  1. ALSA: sb: Proper endian notations

    tiwai committed Jul 25, 2018
    The data types defined in SB CSP driver code are all in little-endian,
    hence the proper type like __le32 should be used.
    
    Spotted by sparse, a warning like:
      sound/isa/sb/sb16_csp.c:330:14: warning: cast to restricted __le32
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  2. ALSA: atiixp_modem: Proper endian notations

    tiwai committed Jul 25, 2018
    The DMA address table in atiixp modem driver is in little-endian,
    hence we should define it with __le32 properly.
    
    Spotted by sparse, a warning like:
      sound/pci/atiixp_modem.c:360:28: warning: incorrect type in assignment (different base types)
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  3. ALSA: atiixp: Proper endian notations

    tiwai committed Jul 25, 2018
    The DMA address table in atiixp driver is in little-endian, hence we should define it with __le32 properly.
    
    Spotted by sparse, a warning like:
      sound/pci/atiixp.c:393:28: warning: incorrect type in assignment (different base types)
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  4. ALSA: bt87x: Proper endian notations

    tiwai committed Jul 25, 2018
    The RISC data in bt87x is in little-endian, hence we should define it
    with __le32 properly.
    
    Spotted by sparse, a warning like:
      sound/pci/bt87x.c:240:17: warning: incorrect type in assignment (different base types)
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  5. ALSA: echoaudio: Proper endian notations

    tiwai committed Jul 25, 2018
    Many data fields defined in echoaudio drivers are in little-endian,
    hence they should be defined with __le16 or __le32.  This makes it
    easier to catch the forgotten conversions.
    
    Spotted by sparse, a warning like:
      sound/pci/echoaudio/echoaudio_dsp.c:990:36: warning: incorrect type in assignment (different base types)
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  6. ALSA: maestro3: Proper endian notations

    tiwai committed Jul 25, 2018
    The ASSP data passed to maestro3 driver is in little-endian format,
    hence the data pointer should be with __le16.
    
    Spotted by sparse, warnings like:
      sound/pci/maestro3.c:2128:35: warning: cast to restricted __le16
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  7. ALSA: intel8x0m: Proper endian notations

    tiwai committed Jul 25, 2018
    The BD address tables in intel8x0m driver are in little-endian, hence
    they should be represented as __le32 instead u32.
    
    Spotted by sparse, warnings like:
      sound/pci/intel8x0m.c:406:40: warning: incorrect type in assignment (different base types)
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  8. ALSA: intel8x0: Proper endian notations

    tiwai committed Jul 25, 2018
    The BD address tables in intel8x0 driver are in little-endian, hence
    they should be represented as __le32 instead u32.
    
    Spotted by sparse, warnings like:
      sound/pci/intel8x0.c:688:40: warning: incorrect type in assignment (different base types)
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  9. ALSA: lola: Proper endian notations

    tiwai committed Jul 25, 2018
    The BDL entries in lola driver are little-endian while we code them as
    u32.  This leads to sparse warnings like:
      sound/pci/lola/lola.c:105:40: warning: incorrect type in assignment (different base types)
      sound/pci/lola/lola.c:105:40:    expected unsigned int [unsigned] [usertype] <noident>
      sound/pci/lola/lola.c:105:40:    got restricted __le32 [usertype] <noident>
    
    This patch fixes the declarations to the proper __le32 type.
    
    Also, there was a typo in the original code, where __user was used
    that was intended as __iomem.  This was caused also by sparse:
      sound/pci/lola/lola_mixer.c:132:27: warning: incorrect type in assignment (different address spaces)
    Fixed in this patch as well.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  10. ALSA: mixart: Proper endian notations

    tiwai committed Jul 25, 2018
    The miXart driver deals with big-endian values as raw data, while it
    declares most of variables as u32.  This leads to sparse warnings like
      sound/pci/mixart/mixart.c:1203:23: warning: cast to restricted __be32
    
    Fix them by properly defining the structs and add the explicit cast to
    macros.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  11. ALSA: riptide: Properly endian notations

    tiwai committed Jul 25, 2018
    The SG descriptor of Riptide contains the little-endian values, hence
    we need to define with __le32 properly.  This fixes sparse warnings
    like:
      sound/pci/riptide/riptide.c:1112:40: warning: cast to restricted __le32
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>