summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-09Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge to continue fixing the OSS emulation code. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-08ALSA: pcm: Allow aborting mutex lock at OSS read/write loopsTakashi Iwai
PCM OSS read/write loops keep taking the mutex lock for the whole read/write, and this might take very long when the exceptionally high amount of data is given. Also, since it invokes with mutex_lock(), the concurrent read/write becomes unbreakable. This patch tries to address these issues by replacing mutex_lock() with mutex_lock_interruptible(), and also splits / re-takes the lock at each read/write period chunk, so that it can switch the context more finely if requested. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-08ALSA: pcm: Abort properly at pending signal in OSS read/write loopsTakashi Iwai
The loops for read and write in PCM OSS emulation have no proper check of pending signals, and they keep processing even after user tries to break. This results in a very long delay, often seen as RCU stall when a huge unprocessed bytes remain queued. The bug could be easily triggered by syzkaller. As a simple workaround, this patch adds the proper check of pending signals and aborts the loop appropriately. Reported-by: syzbot+993cb4cfcbbff3947c21@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-08ALSA: hda/realtek - update ALC225 depop optimizeKailang Yang
Add ALC225 its own depop functions for alc_init and alc_shutup. Add depop optimize step for headset mode functions. Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-05Merge tag 'asoc-v4.16' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v4.16 Quite a big update here, mostly in new device support and some big updates for older drivers too. The main core work continues to be Morimoto-san's efforts on modernising drivers to use the component layer. - Lots more updates from Morimoto-san to move more things into the component level. - Large cleanups of some of the TI CODEC drivers from Andrew F. Davis. - Even more quirks and cleanups of quirks for x86 systems. - Refactoring of the Freescale SSI driver from Nicolin Chen in preparation for some more substantive improvements which are currently in review. - New drivers for Allwinner A83T, Maxim MAX89373, SocioNext UiniPhier EVEA Tempo Semiconductor TSCS42xx and TI PCM816x, TAS5722 and TAS6424 devices.
2018-01-05ALSA: aloop: Fix racy hw constraints adjustmentTakashi Iwai
The aloop driver tries to update the hw constraints of the connected target on the cable of the opened PCM substream. This is done by adding the extra hw constraints rules referring to the substream runtime->hw fields, while the other substream may update the runtime hw of another side on the fly. This is, however, racy and may result in the inconsistent values when both PCM streams perform the prepare concurrently. One of the reason is that it overwrites the other's runtime->hw field; which is not only racy but also broken when it's called before the open of another side finishes. And, since the reference to runtime->hw isn't protected, the concurrent write may give the partial value update and become inconsistent. This patch is an attempt to fix and clean up: - The prepare doesn't change the runtime->hw of other side any longer, but only update the cable->hw that is referred commonly. - The extra rules refer to the loopback_pcm object instead of the runtime->hw. The actual hw is deduced from cable->hw. - The extra rules take the cable_lock to protect against the race. Fixes: b1c73fc8e697 ("ALSA: snd-aloop: Fix hw_params restrictions and checking") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-05ALSA: aloop: Fix inconsistent format due to incomplete ruleTakashi Iwai
The extra hw constraint rule for the formats the aloop driver introduced has a slight flaw, where it doesn't return a positive value when the mask got changed. It came from the fact that it's basically a copy&paste from snd_hw_constraint_mask64(). The original code is supposed to be a single-shot and it modifies the mask bits only once and never after, while what we need for aloop is the dynamic hw rule that limits the mask bits. This difference results in the inconsistent state, as the hw_refine doesn't apply the dependencies fully. The worse and surprisingly result is that it causes a crash in OSS emulation when multiple full-duplex reads/writes are performed concurrently (I leave why it triggers Oops to readers as a homework). For fixing this, replace a few open-codes with the standard snd_mask_*() macros. Reported-by: syzbot+3902b5220e8ca27889ca@syzkaller.appspotmail.com Fixes: b1c73fc8e697 ("ALSA: snd-aloop: Fix hw_params restrictions and checking") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-05ALSA: aloop: Release cable upon open error pathTakashi Iwai
The aloop runtime object and its assignment in the cable are left even when opening a substream fails. This doesn't mean any memory leak, but it still keeps the invalid pointer that may be referred by the another side of the cable spontaneously, which is a potential Oops cause. Clean up the cable assignment and the empty cable upon the error path properly. Fixes: 597603d615d2 ("ALSA: introduce the snd-aloop module for the PCM loopback") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-05ALSA: pcm: Workaround for weird PulseAudio behavior on rewind errorTakashi Iwai
The commit 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated") introduced the possible error code returned from the PCM rewind ioctl. Basically the change was for handling the indirect PCM more correctly, but ironically, it caused rather a side-effect: PulseAudio gets pissed off when receiving an error from rewind, throws everything away and stops processing further, resulting in the silence. It's clearly a failure in the application side, so the best would be to fix that bug in PA. OTOH, PA is mostly the only user of the rewind feature, so it's not good to slap the sole customer. This patch tries to mitigate the situation: instead of returning an error, now the rewind ioctl returns zero when the driver can't rewind. It indicates that no rewind was performed, so the behavior is consistent, at least. Fixes: 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-05Merge remote-tracking branches 'asoc/topic/wm8997' and 'asoc/topic/wm8998' ↵Mark Brown
into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/wm5110', 'asoc/topic/wm8350', ↵Mark Brown
'asoc/topic/wm8400', 'asoc/topic/wm8903' and 'asoc/topic/wm8994' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/uniphier', 'asoc/topic/utils', ↵Mark Brown
'asoc/topic/wm0010', 'asoc/topic/wm2000' and 'asoc/topic/wm5102' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/ts3a227e', 'asoc/topic/tsc42xx', ↵Mark Brown
'asoc/topic/twl4030', 'asoc/topic/twl6040' and 'asoc/topic/uda1380' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/tfa9879', ↵Mark Brown
'asoc/topic/tlv320aic31xx', 'asoc/topic/tlv320aic32x4', 'asoc/topic/tlv320aic3x' and 'asoc/topic/tlv320dac33' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/sun4i-i2s', 'asoc/topic/sunxi', ↵Mark Brown
'asoc/topic/symmetry', 'asoc/topic/tas5720' and 'asoc/topic/tas6424' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/si476x', ↵Mark Brown
'asoc/topic/simple', 'asoc/topic/spdif' and 'asoc/topic/stm32' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/rl6231', 'asoc/topic/rt5514' and ↵Mark Brown
'asoc/topic/rt5645' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/nau8824', 'asoc/topic/nau8825' ↵Mark Brown
and 'asoc/topic/nuc900' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/mc13783', 'asoc/topic/msm8916', ↵Mark Brown
'asoc/topic/mt8173', 'asoc/topic/mtk' and 'asoc/topic/nau8540' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/hisilicon', ↵Mark Brown
'asoc/topic/max98373', 'asoc/topic/max98926' and 'asoc/topic/max98927' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/fsl', 'asoc/topic/fsl-ssi', ↵Mark Brown
'asoc/topic/fsl_asrc' and 'asoc/topic/hdac_hdmi' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/dai-drv', 'asoc/topic/davinci', ↵Mark Brown
'asoc/topic/disconnect', 'asoc/topic/ep93xx' and 'asoc/topic/eukrea-tlv320' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/cs42l73', 'asoc/topic/cs47l24', ↵Mark Brown
'asoc/topic/cx20442', 'asoc/topic/da7213' and 'asoc/topic/da7218' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/cq93vc', 'asoc/topic/cs35l32', ↵Mark Brown
'asoc/topic/cs35l34', 'asoc/topic/cs42l52' and 'asoc/topic/cs42l56' into asoc-next
2018-01-05Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/amd', ↵Mark Brown
'asoc/topic/atmel' and 'asoc/topic/compress' into asoc-next
2018-01-05Merge remote-tracking branch 'asoc/topic/rcar' into asoc-nextMark Brown
2018-01-05Merge remote-tracking branch 'asoc/topic/qcom' into asoc-nextMark Brown
2018-01-05Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-nextMark Brown
2018-01-05Merge remote-tracking branch 'asoc/topic/pcm186x' into asoc-nextMark Brown
2018-01-05Merge remote-tracking branch 'asoc/topic/intel' into asoc-nextMark Brown
2018-01-05Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown
2018-01-05Merge remote-tracking branch 'asoc/fix/mtk' into asoc-linusMark Brown
2018-01-05Merge remote-tracking branch 'asoc/fix/intel' into asoc-linusMark Brown
2018-01-05ASoC: TSCS42xx: Add support for Tempo Semiconductor's TSCS42xx audio CODECSteven Eckhoff
Currently there is no support for TSCS42xx audio CODECs. Add support for TSCS42xx audio CODECs. Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Steven Eckhoff <steven.eckhoff.opensource@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-05ASoC: davinci-mcasp: Add rule to constrain the minimum period sizePeter Ujfalusi
The minimum period size (in frames) must be not lower than the FIFO size of McASP and in general too small period size would easily result underrun in applications as eDMA - the most common DMA servicing McASP have support for limited number of periods. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: simple-card: Pass 'reg' property in the examplesFabio Estevam
Since unit addresses are passed to simple-audio-card,dai-link a corresponding 'reg' property is needed, otherwise dtc complains (when building with W=1) in case someone copies the bindings example into a real dts file: Warning (unit_address_vs_reg): Node /sound-digital/simple-audio-card,dai-link@0 has a unit name, but no reg property Improve the example by passing the correct 'reg' properties. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: max98373: Added Amplifier DriverRyan Lee
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: Added device tree binding for max98373 amplifierRyan Lee
Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ALSA: pcm: Add missing error checks in OSS emulation plugin builderTakashi Iwai
In the OSS emulation plugin builder where the frame size is parsed in the plugin chain, some places miss the possible errors returned from the plugin src_ or dst_frames callback. This patch papers over such places. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-04ASoC: mediatek: update MT2701 AFE documentation to adapt mfd deviceRyder Lee
As the new MFD parent is in place, modify MT2701 AFE documentation to adapt it. Also add three core clocks in example. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: mediatek: modify MT2701 AFE driver to adapt mfd deviceRyder Lee
As the new MFD parent is in place, modify MT2701 AFE driver to adapt it. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: mediatek: add some core clocks for MT2701 AFERyder Lee
Add three core clocks for MT2701 AFE. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: rt5645: add micbias power control select.Bard Liao
We need to set a corresponding control bit before powering micbias up. Signed-off-by: Bard Liao <bardliao@realtek.com> [hdegoede@redhat.com: Remove 2 unused variable declarations] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: rt5645: change micbias widget type to supply.Bard Liao
Register "micbias1" and "micbias2" to supply widgets as modern drivers do. This should not cause any (new) issues for existing users of the codec, since micbias support is broken anyways. Micbias support needs the RT5645_MICBIAS?_POW_CTRL_SEL bits in the RT5645_GEN_CTRL2 register to be updated when enabled/disabled which we currently do not do. The updating of these bits will be fixed in a follow-up commit. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: rcar: tidyup simple-card example for CPU nodeKuninori Morimoto
commit a5702e1cb3c ("ASoC: rsnd: Drop unit-addresses without reg properties") modifies simple-card multi CPU nodes. But, naming of "cpu-x" breaks probing. Let's add reg = <x>; instead of renaming node. Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> CC: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: mediatek: update clock related properties of MT2701 AFERyder Lee
Add 'assigned-clocks*' properties which are used to initialize default domain sources of audio system. we could configure different sets of input clocks through DTS now. Hence driver no longer cares about that. Also we change some 'clock-names' to make them more generic so that other chips can reuse gracefully. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: skl: Fix kernel warning due to zero NHTL entryTakashi Iwai
I got the following kernel warning when loading snd-soc-skl module on Dell Latitude 7270 laptop: memremap attempted on mixed range 0x0000000000000000 size: 0x0 WARNING: CPU: 0 PID: 484 at kernel/memremap.c:98 memremap+0x8a/0x180 Call Trace: skl_nhlt_init+0x82/0xf0 [snd_soc_skl] skl_probe+0x2ee/0x7c0 [snd_soc_skl] .... It seems that the machine doesn't support the SKL DSP gives the empty NHLT entry, and it triggers the warning. For avoiding it, let do the zero check before calling memremap(). Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: mediatek: cleanup audio driver for MT2701Ryder Lee
Cleanup unused code such as 'i2s_num' guard, headers, indentation and some defines. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: mediatek: rework clock functions for MT2701Ryder Lee
Reworks clock part to make it more reasonable. The current changes are: - Replace regmap operations by CCF APIs. Doing so, we just need to handle the element clocks and can also get accurate information via CCF. - Rename clocks to make them more generic so that the future revisions of the IP can adapt gracefully. - Regroup 'aud_clks[]' by usage - the basic needs and I2S parts: The new code just keep the common clocks in array and let SoC self decide I2S numbers - If future chips have different sets of channels we will add a little more abstract here. Moreover, this patch moves I2S clocks to the struct mt2701_i2s_data so that we can easily manage them when calls .prepare() and .shutdown(). Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Tested-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: change mask in snd_soc_get/put_volsw_sx to unsigned intBanajit Goswami
If the result of (min + max) is negative in functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(), there will be an overflow for the variable 'mask'. UBSAN: Undefined behaviour in sound/soc/soc-ops.c:382:6 signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fix this by updating the variable type of 'mask' to unsigned int. Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>