1. 28 Mar, 2018 7 commits
    • Evgeniy Didin's avatar
      mmc: dw_mmc: fix falling from idmac to PIO mode when dw_mci_reset occurs · aaf6dfbd
      Evgeniy Didin authored
      commit 47b7de2f upstream.
      
      It was found that in IDMAC mode after soft-reset driver switches
      to PIO mode.
      
      That's what happens in case of DTO timeout overflow calculation failure:
      1. soft-reset is called
      2. driver restarts dma
      3. descriptors states are checked, one of descriptor is owned by the IDMAC.
      4. driver can't use DMA and then switches to PIO mode.
      
      Failure was already fixed in:
      https://www.spinics.net/lists/linux-mmc/msg48125.html.
      
      Behaviour while soft-reset is not something we except or
      even want to happen. So we switch from dw_mci_idmac_reset
      to dw_mci_idmac_init, so descriptors are cleaned before starting dma.
      
      And while at it explicitly zero des0 which otherwise might
      contain garbage as being allocated by dmam_alloc_coherent().
      Signed-off-by: default avatarEvgeniy Didin <Evgeniy.Didin@synopsys.com>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
      Cc: Shawn Lin <shawn.lin@rock-chips.com>
      Cc: Alexey Brodkin <abrodkin@synopsys.com>
      Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Cc: linux-snps-arc@lists.infradead.org
      Cc: <stable@vger.kernel.org> # 4.4+
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aaf6dfbd
    • Takashi Iwai's avatar
      ALSA: hda/realtek - Always immediately update mute LED with pin VREF · ae5b1417
      Takashi Iwai authored
      commit e40bdb03 upstream.
      
      Some HP laptops have a mute mute LED controlled by a pin VREF.  The
      Realtek codec driver updates the VREF via vmaster hook by calling
      snd_hda_set_pin_ctl_cache().
      
      This works fine as long as the driver is running in a normal mode.
      However, when the VREF change happens during the codec being in
      runtime PM suspend, the regmap access will skip and postpone the
      actual register change.  This ends up with the unchanged LED status
      until the next runtime PM resume even if you change the Master mute
      switch.  (Interestingly, the machine keeps the LED status even after
      the codec goes into D3 -- but it's another story.)
      
      For improving this usability, let the driver temporarily powering up /
      down only during the pin VREF change.  This can be achieved easily by
      wrapping the call with snd_hda_power_up_pm() / *_down_pm().
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ae5b1417
    • Takashi Iwai's avatar
      ALSA: aloop: Fix access to not-yet-ready substream via cable · 5e6d308f
      Takashi Iwai authored
      commit 8e6b1a72 upstream.
      
      In loopback_open() and loopback_close(), we assign and release the
      substream object to the corresponding cable in a racy way.  It's
      neither locked nor done in the right position.  The open callback
      assigns the substream before its preparation finishes, hence the other
      side of the cable may pick it up, which may lead to the invalid memory
      access.
      
      This patch addresses these: move the assignment to the end of the open
      callback, and wrap with cable->lock for avoiding concurrent accesses.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5e6d308f
    • Takashi Iwai's avatar
      ALSA: aloop: Sync stale timer before release · eba92f15
      Takashi Iwai authored
      commit 67a01afa upstream.
      
      The aloop driver tries to stop the pending timer via timer_del() in
      the trigger callback and in the close callback.  The former is
      correct, as it's an atomic operation, while the latter expects that
      the timer gets really removed and proceeds the resource releases after
      that.  But timer_del() doesn't synchronize, hence the running timer
      may still access the released resources.
      
      A similar situation can be also seen in the prepare callback after
      trigger(STOP) where the prepare tries to re-initialize the things
      while a timer is still running.
      
      The problems like the above are seen indirectly in some syzkaller
      reports (although it's not 100% clear whether this is the only cause,
      as the race condition is quite narrow and not always easy to
      trigger).
      
      For addressing these issues, this patch adds the explicit alls of
      timer_del_sync() in some places, so that the pending timer is properly
      killed / synced.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eba92f15
    • Kirill Marinushkin's avatar
      ALSA: usb-audio: Fix parsing descriptor of UAC2 processing unit · 87eccc3c
      Kirill Marinushkin authored
      commit a6618f4a upstream.
      
      Currently, the offsets in the UAC2 processing unit descriptor are
      calculated incorrectly. It causes an issue when connecting the device which
      provides such a feature:
      
      ~~~~
      [84126.724420] usb 1-1.3.1: invalid Processing Unit descriptor (id 18)
      ~~~~
      
      After this patch is applied, the UAC2 processing unit inits w/o this error.
      
      Fixes: 23caaf19 ("ALSA: usb-mixer: Add support for Audio Class v2.0")
      Signed-off-by: default avatarKirill Marinushkin <k.marinushkin@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87eccc3c
    • Michael Nosthoff's avatar
      iio: st_pressure: st_accel: pass correct platform data to init · 8e1f1062
      Michael Nosthoff authored
      commit 8b438686 upstream.
      
      Commit 7383d44b added a pointer pdata which get set to the default
      platform_data when non was defined in the device. But it did not
      pass this pointer to the st_sensors_init_sensor call but still
      used the maybe uninitialized platform_data from dev.
      
      This breaks initialization when no platform_data is given and
      the optional st,drdy-int-pin devicetree option is not set.
      
      This commit fixes this.
      
      Cc: stable@vger.kernel.org
      Fixes: 7383d44b ("iio: st_pressure: st_accel: Initialise sensor platform data properly")
      Signed-off-by: default avatarMichael Nosthoff <committed@heine.so>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e1f1062
    • NeilBrown's avatar
      MIPS: ralink: Remove ralink_halt() · f56bf442
      NeilBrown authored
      commit 891731f6 upstream.
      
      ralink_halt() does nothing that machine_halt() doesn't already do, so it
      adds no value.
      
      It actually causes incorrect behaviour due to the "unreachable()" at the
      end. This tells the compiler that the end of the function will never be
      reached, which isn't true. The compiler responds by not adding a
      'return' instruction, so control simply moves on to whatever bytes come
      afterwards in memory. In my tested, that was the ralink_restart()
      function. This means that an attempt to 'halt' the machine would
      actually cause a reboot.
      
      So remove ralink_halt() so that a 'halt' really does halt.
      
      Fixes: c06e836a ("MIPS: ralink: adds reset code")
      Signed-off-by: default avatarNeilBrown <neil@brown.name>
      Cc: John Crispin <john@phrozen.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: <stable@vger.kernel.org> # 3.9+
      Patchwork: https://patchwork.linux-mips.org/patch/18851/Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f56bf442
  2. 24 Mar, 2018 33 commits