1. 21 Jul, 2019 1 commit
  2. 10 Jul, 2019 11 commits
  3. 22 Jun, 2019 1 commit
  4. 19 Jun, 2019 8 commits
  5. 15 Jun, 2019 2 commits
    • Takashi Iwai's avatar
      ALSA: seq: Cover unsubscribe_port() in list_mutex · 6351d118
      Takashi Iwai authored
      commit 7c32ae35fbf9cffb7aa3736f44dec10c944ca18e upstream.
      
      The call of unsubscribe_port() which manages the group count and
      module refcount from delete_and_unsubscribe_port() looks racy; it's
      not covered by the group list lock, and it's likely a cause of the
      reported unbalance at port deletion.  Let's move the call inside the
      group list_mutex to plug the hole.
      
      Reported-by: syzbot+e4c8abb920efa77bace9@syzkaller.appspotmail.com
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6351d118
    • Takashi Iwai's avatar
      ALSA: hda - Register irq handler after the chip initialization · c9ffc882
      Takashi Iwai authored
      [ Upstream commit f495222e28275222ab6fd93813bd3d462e16d340 ]
      
      Currently the IRQ handler in HD-audio controller driver is registered
      before the chip initialization.  That is, we have some window opened
      between the azx_acquire_irq() call and the CORB/RIRB setup.  If an
      interrupt is triggered in this small window, the IRQ handler may
      access to the uninitialized RIRB buffer, which leads to a NULL
      dereference Oops.
      
      This is usually no big problem since most of Intel chips do register
      the IRQ via MSI, and we've already fixed the order of the IRQ
      enablement and the CORB/RIRB setup in the former commit b61749a8
      ("sound: enable interrupt after dma buffer initialization"), hence the
      IRQ won't be triggered in that room.  However, some platforms use a
      shared IRQ, and this may allow the IRQ trigger by another source.
      
      Another possibility is the kdump environment: a stale interrupt might
      be present in there, the IRQ handler can be falsely triggered as well.
      
      For covering this small race, let's move the azx_acquire_irq() call
      after hda_intel_init_chip() call.  Although this is a bit radical
      change, it can cover more widely than checking the CORB/RIRB setup
      locally in the callee side.
      Reported-by: 's avatarLiwei Song <liwei.song@windriver.com>
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      c9ffc882
  6. 09 Jun, 2019 1 commit
  7. 31 May, 2019 6 commits
    • Arnd Bergmann's avatar
      ASoC: davinci-mcasp: Fix clang warning without CONFIG_PM · 3e044426
      Arnd Bergmann authored
      [ Upstream commit 8ca5104715cfd14254ea5aecc390ae583b707607 ]
      
      Building with clang shows a variable that is only used by the
      suspend/resume functions but defined outside of their #ifdef block:
      
      sound/soc/ti/davinci-mcasp.c:48:12: error: variable 'context_regs' is not needed and will not be emitted
      
      We commonly fix these by marking the PM functions as __maybe_unused,
      but here that would grow the davinci_mcasp structure, so instead
      add another #ifdef here.
      
      Fixes: 1cc0c054 ("ASoC: davinci-mcasp: Convert the context save/restore to use array")
      Signed-off-by: 's avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: 's avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
      Reviewed-by: 's avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      3e044426
    • Wen Yang's avatar
      ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put · 91126ba6
      Wen Yang authored
      [ Upstream commit c705247136a523488eac806bd357c3e5d79a7acd ]
      
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./sound/soc/fsl/fsl_utils.c:74:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 38, but without a corresponding     object release within this function.
      Signed-off-by: 's avatarWen Yang <wen.yang99@zte.com.cn>
      Cc: Timur Tabi <timur@kernel.org>
      Cc: Nicolin Chen <nicoleotsuka@gmail.com>
      Cc: Xiubo Li <Xiubo.Lee@gmail.com>
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: alsa-devel@alsa-project.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      91126ba6
    • Wen Yang's avatar
      ASoC: eukrea-tlv320: fix a leaked reference by adding missing of_node_put · b20f6ed7
      Wen Yang authored
      [ Upstream commit b820d52e7eed7b30b2dfef5f4213a2bc3cbea6f3 ]
      
      The call to of_parse_phandle returns a node pointer with refcount
      incremented thus it must be explicitly decremented after the last
      usage.
      
      Detected by coccinelle with the following warnings:
      ./sound/soc/fsl/eukrea-tlv320.c:121:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 102, but without a correspo    nding object release within this function.
      ./sound/soc/fsl/eukrea-tlv320.c:127:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 102, but without a correspo    nding object release within this function.
      Signed-off-by: 's avatarWen Yang <wen.yang99@zte.com.cn>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: alsa-devel@alsa-project.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      b20f6ed7
    • Daniel Baluta's avatar
      ASoC: fsl_sai: Update is_slave_mode with correct value · 0d7325ab
      Daniel Baluta authored
      [ Upstream commit ddb351145a967ee791a0fb0156852ec2fcb746ba ]
      
      is_slave_mode defaults to false because sai structure
      that contains it is kzalloc'ed.
      
      Anyhow, if we decide to set the following configuration
      SAI slave -> SAI master, is_slave_mode will remain set on true
      although SAI being master it should be set to false.
      
      Fix this by updating is_slave_mode for each call of
      fsl_sai_set_dai_fmt.
      Signed-off-by: 's avatarDaniel Baluta <daniel.baluta@nxp.com>
      Acked-by: 's avatarNicolin Chen <nicoleotsuka@gmail.com>
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      0d7325ab
    • Arnd Bergmann's avatar
      ASoC: imx: fix fiq dependencies · 48f4d9d5
      Arnd Bergmann authored
      [ Upstream commit ea751227c813ab833609afecfeedaf0aa26f327e ]
      
      During randconfig builds, I occasionally run into an invalid configuration
      of the freescale FIQ sound support:
      
      WARNING: unmet direct dependencies detected for SND_SOC_IMX_PCM_FIQ
        Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_IMX_SOC [=m]
        Selected by [y]:
        - SND_SOC_FSL_SPDIF [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_IMX_SOC [=m]!=n && (MXC_TZIC [=n] || MXC_AVIC [=y])
      
      sound/soc/fsl/imx-ssi.o: In function `imx_ssi_remove':
      imx-ssi.c:(.text+0x28): undefined reference to `imx_pcm_fiq_exit'
      sound/soc/fsl/imx-ssi.o: In function `imx_ssi_probe':
      imx-ssi.c:(.text+0xa64): undefined reference to `imx_pcm_fiq_init'
      
      The Kconfig warning is a result of the symbol being defined inside of
      the "if SND_IMX_SOC" block, and is otherwise harmless. The link error
      is more tricky and happens with SND_SOC_IMX_SSI=y, which may or may not
      imply FIQ support. However, if SND_SOC_FSL_SSI is set to =m at the same
      time, that selects SND_SOC_IMX_PCM_FIQ as a loadable module dependency,
      which then causes a link failure from imx-ssi.
      
      The solution here is to make SND_SOC_IMX_PCM_FIQ built-in whenever
      one of its potential users is built-in.
      
      Fixes: ff40260f ("ASoC: fsl: refine DMA/FIQ dependencies")
      Signed-off-by: 's avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      48f4d9d5
    • Jerome Brunet's avatar
      ASoC: hdmi-codec: unlock the device on startup errors · 6d611134
      Jerome Brunet authored
      [ Upstream commit 30180e8436046344b12813dc954b2e01dfdcd22d ]
      
      If the hdmi codec startup fails, it should clear the current_substream
      pointer to free the device. This is properly done for the audio_startup()
      callback but for snd_pcm_hw_constraint_eld().
      
      Make sure the pointer cleared if an error is reported.
      Signed-off-by: 's avatarJerome Brunet <jbrunet@baylibre.com>
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
      6d611134
  8. 21 May, 2019 7 commits
    • Michał Wadowski's avatar
      ALSA: hda/realtek - Fix for Lenovo B50-70 inverted internal microphone bug · 6140b28c
      Michał Wadowski authored
      commit 56df90b631fc027fe28b70d41352d820797239bb upstream.
      
      Add patch for realtek codec in Lenovo B50-70 that fixes inverted
      internal microphone channel.
      Device IdeaPad Y410P has the same PCI SSID as Lenovo B50-70,
      but first one is about fix the noise and it didn't seem help in a
      later kernel version.
      So I replaced IdeaPad Y410P device description with B50-70 and apply
      inverted microphone fix.
      
      Bugzilla: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1524215Signed-off-by: 's avatarMichał Wadowski <wadosm@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6140b28c
    • Curtis Malainey's avatar
      ASoC: RT5677-SPI: Disable 16Bit SPI Transfers · e047bab5
      Curtis Malainey authored
      commit a46eb523220e242affb9a6bc9bb8efc05f4f7459 upstream.
      
      The current algorithm allows 3 types of transfers, 16bit, 32bit and
      burst. According to Realtek, 16bit transfers have a special restriction
      in that it is restricted to the memory region of
      0x18020000 ~ 0x18021000. This region is the memory location of the I2C
      registers. The current algorithm does not uphold this restriction and
      therefore fails to complete writes.
      
      Since this has been broken for some time it likely no one is using it.
      Better to simply disable the 16 bit writes. This will allow users to
      properly load firmware over SPI without data corruption.
      Signed-off-by: 's avatarCurtis Malainey <cujomalainey@chromium.org>
      Reviewed-by: 's avatarBen Zhang <benzh@chromium.org>
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e047bab5
    • Jon Hunter's avatar
      ASoC: max98090: Fix restore of DAPM Muxes · b93d5632
      Jon Hunter authored
      commit ecb2795c08bc825ebd604997e5be440b060c5b18 upstream.
      
      The max98090 driver defines 3 DAPM muxes; one for the right line output
      (LINMOD Mux), one for the left headphone mixer source (MIXHPLSEL Mux)
      and one for the right headphone mixer source (MIXHPRSEL Mux). The same
      bit is used for the mux as well as the DAPM enable, and although the mux
      can be correctly configured, after playback has completed, the mux will
      be reset during the disable phase. This is preventing the state of these
      muxes from being saved and restored correctly on system reboot. Fix this
      by marking these muxes as SND_SOC_NOPM.
      
      Note this has been verified this on the Tegra124 Nyan Big which features
      the MAX98090 codec.
      Signed-off-by: 's avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b93d5632
    • Kailang Yang's avatar
      ALSA: hda/realtek - EAPD turn on later · 5820b429
      Kailang Yang authored
      commit 607ca3bd220f4022e6f5356026b19dafc363863a upstream.
      
      Let EAPD turn on after set pin output.
      
      [ NOTE: This change is supposed to reduce the possible click noises at
        (runtime) PM resume.  The functionality should be same (i.e. the
        verbs are executed correctly) no matter which order is, so this
        should be safe to apply for all codecs -- tiwai ]
      Signed-off-by: 's avatarKailang Yang <kailang@realtek.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5820b429
    • Hui Wang's avatar
      ALSA: hda/hdmi - Consider eld_valid when reporting jack event · c1b167bf
      Hui Wang authored
      commit 7f641e26a6df9269cb25dd7a4b0a91d6586ed441 upstream.
      
      On the machines with AMD GPU or Nvidia GPU, we often meet this issue:
      after s3, there are 4 HDMI/DP audio devices in the gnome-sound-setting
      even there is no any monitors plugged.
      
      When this problem happens, we check the /proc/asound/cardX/eld#N.M, we
      will find the monitor_present=1, eld_valid=0.
      
      The root cause is BIOS or GPU driver makes the PRESENCE valid even no
      monitor plugged, and of course the driver will not get the valid
      eld_data subsequently.
      
      In this situation, we should not report the jack_plugged event, to do
      so, let us change the function hdmi_present_sense_via_verbs(). In this
      function, it reads the pin_sense via snd_hda_pin_sense(), after
      calling this function, the jack_dirty is 0, and before exiting
      via_verbs(), we change the shadow pin_sense according to both
      monitor_present and eld_valid, then in the snd_hda_jack_report_sync(),
      since the jack_dirty is still 0, it will report jack event according
      to this modified shadow pin_sense.
      
      After this change, the driver will not report Jack_is_plugged event
      through hdmi_present_sense_via_verbs() if monitor_present is 1 and
      eld_valid is 0.
      Signed-off-by: 's avatarHui Wang <hui.wang@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1b167bf
    • Hui Wang's avatar
      ALSA: hda/hdmi - Read the pin sense from register when repolling · 02a6716a
      Hui Wang authored
      commit 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d upstream.
      
      The driver will check the monitor presence when resuming from suspend,
      starting poll or interrupt triggers. In these 3 situations, the
      jack_dirty will be set to 1 first, then the hda_jack.c reads the
      pin_sense from register, after reading the register, the jack_dirty
      will be set to 0. But hdmi_repoll_work() is enabled in these 3
      situations, It will read the pin_sense a couple of times subsequently,
      since the jack_dirty is 0 now, It does not read the register anymore,
      instead it uses the shadow pin_sense which is read at the first time.
      
      It is meaningless to check the shadow pin_sense a couple of times,
      we need to read the register to check the real plugging state, so
      we set the jack_dirty to 1 in the hdmi_repoll_work().
      Signed-off-by: 's avatarHui Wang <hui.wang@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      02a6716a
    • Wenwen Wang's avatar
      ALSA: usb-audio: Fix a memory leak bug · bbad2d84
      Wenwen Wang authored
      commit cb5173594d50c72b7bfa14113dfc5084b4d2f726 upstream.
      
      In parse_audio_selector_unit(), the string array 'namelist' is allocated
      through kmalloc_array(), and each string pointer in this array, i.e.,
      'namelist[]', is allocated through kmalloc() in the following for loop.
      Then, a control instance 'kctl' is created by invoking snd_ctl_new1(). If
      an error occurs during the creation process, the string array 'namelist',
      including all string pointers in the array 'namelist[]', should be freed,
      before the error code ENOMEM is returned. However, the current code does
      not free 'namelist[]', resulting in memory leaks.
      
      To fix the above issue, free all string pointers 'namelist[]' in a loop.
      Signed-off-by: 's avatarWenwen Wang <wang6495@umn.edu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: 's avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bbad2d84
  9. 10 May, 2019 3 commits