summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2018-05-09ASoC: sgtl5000: Use normal VAG ramp to reduce pop noiseKlaus Goger
The slow downed ramp causes a higher voltage level at the turn off time generating an audible pop noise. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-04-26ASoC: rk3308_codec: add a bit of delay during enable DACXing Zheng
The suggestion is from verndor, we should add a bit of delay in key steps until the reference voltages are stable, otherwise, the output of voltage maybe too low. @HPMIX -6dB + LINEOUT -6dB: normal Vpp: ~450mV abnormal Vpp: ~100mV Change-Id: I463d308b809b2c5e74e3bd37573bcbbd624df72e Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-04-26ASoC: rockchip: add support for sram audio bufferSugar Zhang
This patch force the use of sram buffer for pcm buffer, default is disabled. Change-Id: I2e6936e1071347f767c67066126b22e39fb477c5 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-04-25ASoC: rk3308_codec: clean up and add support headphone detectionXing Zheng
Since this signal line is directly connected to the GIC, it has not been processed by the logic gate. Therefore, when the headphone is plugged in, the status register will remain high and when pulled out, the status register will be converted to a low level. However, the GIC can only accept high and rising edge triggers, so when the headset is plugged in, it needs to poll (~2s) to detect whether plug the headphone. Change-Id: I321cd363103127911c503a63008882ffbc9c3633 Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-04-25HACK-TO-REVERT: ASoC: simple-card: add support hp/mic detect for internal codecXing Zheng
This is a local patch, because our simple-card is too backward from upstream. This will take more time on the cherry-pick patch and verification. In order to speed up the progress, I put this local patch and please revert it after I merge the new patches of simple-card. Change-Id: If566cf66c69d3a4fccbffc423433e6b724a23c04 Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-04-24ASoC: rk3308_codec: add suppot 4ch/6ch recording for codecXing Zheng
Change-Id: I4d5dd2c7d0f81966db0faf226b130601dcfcd0cf Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-04-17ASoC: rk3308_codec: update and apply many advices from vendorXing Zheng
We need to configure each ADC in parallel as much as possible. The infos from vendor, we add some new registers to make effect better: 1/ optimize the flows for enable/disable ADC/DAC flows 2/ add support fade-out digital gains for de-pop 3/ many updates Change-Id: I2e72451201010de96e7dc5c22ff3384ce71767ea Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-04-09ASoC: rockchip: rk817-codec: add ext amplifier and loopback supportBinyuan Lan
Change-Id: Icef0c8a72784260b0d49d8260b0f3377e53b953f Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-04-09ASoC: rockchip: i2s-tdm: add support for clk-trcm mode.Sugar Zhang
This patch adds support for clk tx/rx common mode. rockchip,clk-trcm: tx and rx lrck/bclk common use. - 0: both tx_lrck/bclk and rx_lrck/bclk are used - 1: only tx_lrck/bclk is used - 2: only rx_lrck/bclk is used Change-Id: I7342ed25b0573bfc0ce0785838d5ee192ca6300d Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-04-08Merge branch 'linux-linaro-lsk-v4.4-android' of ↵Tao Huang
git://git.linaro.org/kernel/linux-linaro-stable.git * linux-linaro-lsk-v4.4-android: (395 commits) Linux 4.4.126 net: systemport: Rewrite __bcm_sysport_tx_reclaim() net: fec: Fix unbalanced PM runtime calls ieee802154: 6lowpan: fix possible NULL deref in lowpan_device_event() s390/qeth: on channel error, reject further cmd requests s390/qeth: lock read device while queueing next buffer s390/qeth: when thread completes, wake up all waiters s390/qeth: free netdevice when removing a card team: Fix double free in error path skbuff: Fix not waking applications when errors are enqueued net: Only honor ifindex in IP_PKTINFO if non-0 netlink: avoid a double skb free in genlmsg_mcast() net/iucv: Free memory obtained by kzalloc net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred l2tp: do not accept arbitrary sockets ipv6: fix access to non-linear packet in ndisc_fill_redirect_hdr_option() dccp: check sk for closed state in dccp_sendmsg() net: Fix hlist corruptions in inet_evict_bucket() Revert "genirq: Use irqd_get_trigger_type to compare the trigger type for shared IRQs" ... Conflicts: include/linux/usb/quirks.h Change-Id: I125065cef66846e4cdee799f4b34d07c309d353e
2018-03-28ALSA: hda/realtek - Always immediately update mute LED with pin VREFTakashi Iwai
commit e40bdb03d3cd7da66bd0bc1e40cbcfb49351265c 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: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-28ALSA: aloop: Fix access to not-yet-ready substream via cableTakashi Iwai
commit 8e6b1a72a75bb5067ccb6b56d8ca4aa3a300a64e 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: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-28ALSA: aloop: Sync stale timer before releaseTakashi Iwai
commit 67a01afaf3d34893cf7d2ea19b34555d6abb7cb0 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: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-28ASoC: rockchip: pdm: using left justified store modeSugar Zhang
Change-Id: I3a787a1c71b6bbbfad632b1f07b1496fd1e5d9fc Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-03-27ASoC: codecs: rk3228: add capture supportXinhuang Li
Change-Id: Ibad275ec17389885007df1d67fb63e34f794b023 Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2018-03-27ASoC: rk3308_codec: fix the incorrect dapm controlsXing Zheng
For more clarity, this patch rename channel to group, and, we can use the amixer or tinymix to change the gains for ADCs (MIC/ALC/AGC) and DACs. Change-Id: If362319fee7e926d235e8c0ffce5415027add96d Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-27ASoC: codecs: update rk3308 codec driverXing Zheng
This patch supports work internal codec on RK3308 EVB. The functions status are: DAC HEADPHONE 2CH -- OK DAC SPK 2CH -- OK ADC AMIC 8CH -- OK ADC AMIC 8CH LOOPBACK -- OK ADC AMIC 2CH -- OK ADC LINEIN 2CH -- OK Change-Id: I4f9ba3160b88e8c1e15980cf2eec7a1a5a25e7e7 Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-27ASoC: rockchip: i2s: protect I2S_XFER_TXS/I2S_XFER_RXS with spin lockBinyuan Lan
fix bug error log: "rockchip-i2s ff070000.i2s: fail to clear". When the TX/RX have started, can not do 'clear operation'. Change-Id: Ia156144490a61f4fa9823b1313588e44688f4bce Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-03-26ASoC: rockchip: add support for multicodecs soundSugar Zhang
Change-Id: I77d3e9c10d03c2b8809c6d82b5268dba279ee6f0 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-03-26ASoC: codec: add dummy codec for rockchipSugar Zhang
Change-Id: I86cb74994d49178525e15b61b5056fd3995e904d Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-03-26ASoC: rockchip: add support for rockchip i2s/tdm controllerSugar Zhang
This patch is add for rockchip i2s/tdm controller. Change-Id: I428e311402220ff14441c48e13fa51356ced46e8 Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-03-24ASoC: Intel: Skylake: Uninitialized variable in probe_codec()Dan Carpenter
[ Upstream commit e6a33532affd14c12688c0e9b2e773e8b2550f3b ] My static checker complains that if snd_hdac_bus_get_response() returns -EIO then "res" is uninitialized. Fix this by initializing it to -1 so that the error is handled correctly. Fixes: d8c2dab8381d ("ASoC: Intel: Add Skylake HDA audio driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-24ALSA: hda - Fix headset microphone detection for ASUS N551 and N751Mikhail Paulyshka
[ Upstream commit fc7438b1eb12b6c93d7b7a62423779eb5dfc673c ] Headset microphone does not work out of the box on ASUS Nx51 laptops. This patch fixes it. Patch tested on Asus N551 laptop. Asus N751 part is not tested, but according to [1] this laptop uses the same audiosystem. 1. https://bugzilla.kernel.org/show_bug.cgi?id=117781 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195437 Signed-off-by: Mikhail Paulyshka <me@mixaill.tk> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ALSA: seq: Clear client entry before deleting else at closingTakashi Iwai
commit a2ff19f7b70118ced291a28d5313469914de451b upstream. When releasing a client, we need to clear the clienttab[] entry at first, then call snd_seq_queue_client_leave(). Otherwise, the in-flight cell in the queue might be picked up by the timer interrupt via snd_seq_check_queue() before calling snd_seq_queue_client_leave(), and it's delivered to another queue while the client is clearing queues. This may eventually result in an uncleared cell remaining in a queue, and the later snd_seq_pool_delete() may need to wait for a long time until the event gets really processed. By moving the clienttab[] clearance at the beginning of release, any event delivery of a cell belonging to this client will fail at a later point, since snd_seq_client_ptr() returns NULL. Thus the cell that was picked up by the timer interrupt will be returned immediately without further delivery, and the long stall of snd_seq_delete_pool() can be avoided, too. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ALSA: seq: Fix possible UAF in snd_seq_check_queue()Takashi Iwai
commit d0f833065221cbfcbadf19fd4102bcfa9330006a upstream. Although we've covered the races between concurrent write() and ioctl() in the previous patch series, there is still a possible UAF in the following scenario: A: user client closed B: timer irq -> snd_seq_release() -> snd_seq_timer_interrupt() -> snd_seq_free_client() -> snd_seq_check_queue() -> cell = snd_seq_prioq_cell_peek() -> snd_seq_prioq_leave() .... removing all cells -> snd_seq_pool_done() .... vfree() -> snd_seq_compare_tick_time(cell) ... Oops So the problem is that a cell is peeked and accessed without any protection until it's retrieved from the queue again via snd_seq_prioq_cell_out(). This patch tries to address it, also cleans up the code by a slight refactoring. snd_seq_prioq_cell_out() now receives an extra pointer argument. When it's non-NULL, the function checks the event timestamp with the given pointer. The caller needs to pass the right reference either to snd_seq_tick or snd_seq_realtime depending on the event timestamp type. A good news is that the above change allows us to remove the snd_seq_prioq_cell_peek(), too, thus the patch actually reduces the code size. Reviewed-by: Nicolai Stange <nstange@suse.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ALSA: hda - Revert power_save option default valueTakashi Iwai
commit 40088dc4e1ead7df31728c73f5b51d71da18831d upstream. With the commit 1ba8f9d30817 ("ALSA: hda: Add a power_save blacklist"), we changed the default value of power_save option to -1 for processing the power-save blacklist. Unfortunately, this seems breaking user-space applications that actually read the power_save parameter value via sysfs and judge / adjust the power-saving status. They see the value -1 as if the power-save is turned off, although the actual value is taken from CONFIG_SND_HDA_POWER_SAVE_DEFAULT and it can be a positive. So, overall, passing -1 there was no good idea. Let's partially revert it -- at least for power_save option default value is restored again to CONFIG_SND_HDA_POWER_SAVE_DEFAULT. Meanwhile, in this patch, we keep the blacklist behavior and make is adjustable via the new option, pm_blacklist. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073 Fixes: 1ba8f9d30817 ("ALSA: hda: Add a power_save blacklist") Acked-by: Hans de Goede <hdegoede@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ALSA: pcm: Fix UAF in snd_pcm_oss_get_formats()Takashi Iwai
commit 01c0b4265cc16bc1f43f475c5944c55c10d5768f upstream. snd_pcm_oss_get_formats() has an obvious use-after-free around snd_mask_test() calls, as spotted by syzbot. The passed format_mask argument is a pointer to the hw_params object that is freed before the loop. What a surprise that it has been present since the original code of decades ago... Reported-by: syzbot+4090700a4f13fccaf648@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ASoC: nuc900: Fix a loop timeout testDan Carpenter
[ Upstream commit 65a12b3aafed5fc59f4ce41b22b752b1729e6701 ] We should be finishing the loop with timeout set to zero but because this is a post-op we finish with timeout == -1. Fixes: 1082e2703a2d ("ASoC: NUC900/audio: add nuc900 audio driver support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ALSA: firewire-digi00x: handle all MIDI messages on streaming packetsTakashi Sakamoto
[ Upstream commit 8820a4cf0cb4cd5c6540a9a18b2cedbdfd5a6891 ] At a commit 9dc5d31cdceb ("ALSA: firewire-digi00x: handle MIDI messages in isochronous packets"), a functionality to handle MIDI messages on isochronous packet was supported. But this includes some of my misunderstanding. This commit is to fix them. For digi00x series, first data channel of data blocks in rx/tx packet includes MIDI messages. The data channel has 0x80 in 8 bit of its MSB, however it's against IEC 61883-6. Unique data format is applied: - Upper 4 bits of LSB represent port number. - 0x0: port 1. - 0x2: port 2. - 0xe: console port. - Lower 4 bits of LSB represent the number of included MIDI message bytes; 0x0/0x1/0x2. - Two bytes of middle of this data channel have MIDI bytes. Especially, MIDI messages from/to console surface are also transferred by isochronous packets, as well as physical MIDI ports. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22ASoC: rcar: ssi: don't set SSICR.CKDV = 000 with SSIWSR.CONTKuninori Morimoto
[ Upstream commit 6b8530cc056efd4a11b034ca5b1e9f7e9563f553 ] R-Car Datasheet is indicating "SSICR.CKDV = 000 is invalid when SSIWSR.WS_MODE = 1 or SSIWSR.CONT = 1". Current driver will set CONT, thus, we shouldn't use CKDV = 000. This patch fixup it. Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-21Revert "ASoC: rockchip: i2s: protect I2S_XFER_TXS/I2S_XFER_RXS with mutex"Tao Huang
This reverts commit 686662c6f15d52318821d449787eea75432940f6. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620 in_atomic(): 1, irqs_disabled(): 128, pid: 385, name: FastMixer 2 locks held by FastMixer/385: #0: (snd_pcm_link_rwlock){......}, at: [<ffffff9008f4130c>] snd_pcm_stream_lock+0x5c/0x68 #1: (&(&substream->self_group.lock)->rlock){......}, at: [<ffffff9008f41314>] snd_pcm_stream_lock+0x64/0x68 CPU: 4 PID: 385 Comm: FastMixer Not tainted 4.4.120 #4996 Hardware name: Rockchip RK3399 Excavator Board edp (Android) (DT) Call trace: [<ffffff900808cf7c>] dump_backtrace+0x0/0x2b4 [<ffffff900808d244>] show_stack+0x14/0x1c [<ffffff90085670bc>] dump_stack+0xa8/0xd8 [<ffffff90080ead48>] ___might_sleep+0x178/0x17c [<ffffff90080eae08>] __might_sleep+0xbc/0xd4 [<ffffff900935a6d0>] mutex_lock_nested+0xa4/0x504 [<ffffff9008fa431c>] rockchip_i2s_trigger+0x164/0x3d0 [<ffffff9008f89960>] soc_pcm_trigger+0x188/0x1b8 [<ffffff9008f3df74>] snd_pcm_do_start+0x54/0x68 [<ffffff9008f3ddcc>] snd_pcm_action_single+0x50/0x98 [<ffffff9008f3eafc>] snd_pcm_action+0x50/0x150 [<ffffff9008f49824>] snd_pcm_start+0x20/0x28 [<ffffff9008f4f5e0>] snd_pcm_lib_write1+0x4a4/0x508 [<ffffff9008f4f6d0>] snd_pcm_lib_write+0x8c/0xac [<ffffff9008f3fd0c>] snd_pcm_ioctl_xferi_compat+0x188/0x35c [<ffffff9008f49374>] snd_pcm_ioctl_compat+0x32c/0x7bc [<ffffff90082f2de8>] compat_SyS_ioctl+0x1f4/0x258 [<ffffff90080832f0>] el0_svc_naked+0x24/0x28 Change-Id: Id4ad668bb5b8cdbb79aecc1d00fed200acf0d6da
2018-03-21ASoC: codecs: Add RK3308 internal codec driverXing Zheng
This adds support for the RK3308 audio codec. Change-Id: Ieccdebaa27f4a46f6de9406046a6e02e20398013 Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-18ALSA: hda: add dock and led support for HP ProBook 640 G2Dennis Wassenberg
commit 099fd6ca0ad25bc19c5ade2ea4b25b8fadaa11b3 upstream. This patch adds missing initialisation for HP 2013 UltraSlim Dock Line-In/Out PINs and activates keyboard mute/micmute leds for HP ProBook 640 G2 Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-18ALSA: hda: add dock and led support for HP EliteBook 820 G3Dennis Wassenberg
commit aea808172018ca01abf53db808323aed23281835 upstream. This patch adds missing initialisation for HP 2013 UltraSlim Dock Line-In/Out PINs and activates keyboard mute/micmute leds for HP EliteBook 820 G3 Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-18ALSA: seq: More protection for concurrent write and ioctl racesTakashi Iwai
commit 7bd80091567789f1c0cb70eb4737aac8bcd2b6b9 upstream. This patch is an attempt for further hardening against races between the concurrent write and ioctls. The previous fix d15d662e89fc ("ALSA: seq: Fix racy pool initializations") covered the race of the pool initialization at writer and the pool resize ioctl by the client->ioctl_mutex (CVE-2018-1000004). However, basically this mutex should be applied more widely to the whole write operation for avoiding the unexpected pool operations by another thread. The only change outside snd_seq_write() is the additional mutex argument to helper functions, so that we can unlock / relock the given mutex temporarily during schedule() call for blocking write. Fixes: d15d662e89fc ("ALSA: seq: Fix racy pool initializations") Reported-by: 范龙飞 <long7573@126.com> Reported-by: Nicolai Stange <nstange@suse.de> Reviewed-and-tested-by: Nicolai Stange <nstange@suse.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-18ALSA: seq: Don't allow resizing pool in useTakashi Iwai
commit d85739367c6d56e475c281945c68fdb05ca74b4c upstream. This is a fix for a (sort of) fallout in the recent commit d15d662e89fc ("ALSA: seq: Fix racy pool initializations") for CVE-2018-1000004. As the pool resize deletes the existing cells, it may lead to a race when another thread is writing concurrently, eventually resulting a UAF. A simple workaround is not to allow the pool resizing when the pool is in use. It's an invalid behavior in anyway. Fixes: d15d662e89fc ("ALSA: seq: Fix racy pool initializations") Reported-by: 范龙飞 <long7573@126.com> Reported-by: Nicolai Stange <nstange@suse.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-18ALSA: hda/realtek - Fix dock line-out volume on Dell Precision 7520Takashi Iwai
commit e312a869cd726c698a75caca0d9e5c22fd3f1534 upstream. The dock line-out pin (NID 0x17 of ALC3254 codec) on Dell Precision 7520 may route to three different DACs, 0x02, 0x03 and 0x06. The first two DACS have the volume amp controls while the last one doesn't. And unfortunately, the auto-parser assigns this pin to DAC3, resulting in the non-working volume control for the line out. Fix it by disabling the routing to DAC3 on the corresponding pin. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199029 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-16ASoC: rockchip: rk817-codec: dynamically enable/disable mclkBinyuan Lan
Change-Id: I57c97c72ff294bcf63590aa79c6ce0656dc8b022 Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-03-13ASoC: rockchip: i2s: protect I2S_XFER_TXS/I2S_XFER_RXS with mutexBinyuan Lan
fix bug error log: "rockchip-i2s ff070000.i2s: fail to clear". When the TX/RX have started, can not do 'clear operation'. Change-Id: I83c2ac29412a37a5de02ed9d4be62716fe46678a Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-03-11ALSA: hda: Add a power_save blacklistHans de Goede
commit 1ba8f9d308174e647b864c36209b4d7934d99888 upstream. On some boards setting power_save to a non 0 value leads to clicking / popping sounds when ever we enter/leave powersaving mode. Ideally we would figure out how to avoid these sounds, but that is not always feasible. This commit adds a blacklist for devices where powersaving is known to cause problems and disables it on these devices. Note I tried to put this blacklist in userspace first: https://github.com/systemd/systemd/pull/8128 But the systemd maintainers rightfully pointed out that it would be impossible to then later remove entries once we actually find a way to make power-saving work on listed boards without issues. Having this list in the kernel will allow removal of the blacklist entry in the same commit which fixes the clicks / plops. The blacklist only applies to the default power_save module-option value, if a user explicitly sets the module-option then the blacklist is not used. [ added an ifdef CONFIG_PM for the build error -- tiwai] BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198611 Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-11ALSA: usb-audio: Add a quirck for B&W PX headphonesErik Veijola
commit 240a8af929c7c57dcde28682725b29cf8474e8e5 upstream. The capture interface doesn't work and the playback interface only supports 48 kHz sampling rate even though it advertises more rates. Signed-off-by: Erik Veijola <erik.veijola@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-09Merge branch 'linux-linaro-lsk-v4.4-android' of ↵Tao Huang
git://git.linaro.org/kernel/linux-linaro-stable.git * linux-linaro-lsk-v4.4-android: (660 commits) ANDROID: keychord: Check for write data size ANDROID: sdcardfs: Set num in extension_details during make_item ANDROID: sdcardfs: Hold i_mutex for i_size_write BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS FROMGIT: crypto: speck - export common helpers BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE. f2fs: updates on v4.16-rc1 BACKPORT: tee: shm: Potential NULL dereference calling tee_shm_register() BACKPORT: tee: shm: don't put_page on null shm->pages BACKPORT: tee: shm: make function __tee_shm_alloc static BACKPORT: tee: optee: check type of registered shared memory BACKPORT: tee: add start argument to shm_register callback BACKPORT: tee: optee: fix header dependencies BACKPORT: tee: shm: inline tee_shm_get_id() BACKPORT: tee: use reference counting for tee_context BACKPORT: tee: optee: enable dynamic SHM support BACKPORT: tee: optee: add optee-specific shared pool implementation ... Conflicts: drivers/irqchip/Kconfig drivers/media/i2c/tc35874x.c drivers/media/v4l2-core/v4l2-compat-ioctl32.c drivers/usb/gadget/function/f_fs.c fs/f2fs/node.c Change-Id: Icecd73a515821b536fa3d81ea91b63d9b3699916
2018-02-28ASoC: rockchip: rk817-codec: add get_regmap and optimize the codeBinyuan Lan
Change-Id: If6a810b3b9f2d192bf765ad28bcd6c9f4bfd5a9e Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2018-02-28UPSTREAM: gpio: change member .dev to .parentLinus Walleij
The name .dev in a struct is normally reserved for a struct device that is let us say a superclass to the thing described by the struct. struct gpio_chip stands out by confusingly using a struct device *dev to point to the parent device (such as a platform_device) that represents the hardware. As we want to give gpio_chip:s real devices, this is not working. We need to rename this member to parent. This was done by two coccinelle scripts, I guess it is possible to combine them into one, but I don't know such stuff. They look like this: @@ struct gpio_chip *var; @@ -var->dev +var->parent and: @@ struct gpio_chip var; @@ -var.dev +var.parent and: @@ struct bgpio_chip *var; @@ -var->gc.dev +var->gc.parent Plus a few instances of bgpio that I couldn't figure out how to teach Coccinelle to rewrite. This patch hits all over the place, but I *strongly* prefer this solution to any piecemal approaches that just exercise patch mechanics all over the place. It mainly hits drivers/gpio and drivers/pinctrl which is my own backyard anyway. Change-Id: Ib178cec5ee519164386cb60ba7f6c3f796e84f0e Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Rafał Miłecki <zajec5@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Alek Du <alek.du@intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Tao Huang <huangtao@rock-chips.com> (cherry picked from commit 58383c78425e4ee1c077253cf297b641c861c02e)
2018-02-25ASoC: Intel: Kconfig: fix build when ACPI is not enabledVinod Koul
commit 3493d4a86457c7de9f1e602b4267c9b0f9ec1c9f upstream. Randy reported following error when ACPI is not enabled: warning: (SND_SOC_INTEL_BYTCR_RT5640_MACH && SND_SOC_INTEL_BYTCR_RT5651_MACH && SND_SOC_INTEL_CHT_BSW_RT5672_MACH && SND_SOC_INTEL_CHT_BSW_RT5645_MACH && SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH) selects SND_SST_IPC_ACPI +which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && ACPI) causing these build errors: In file included from ../sound/soc/intel/atom/sst/sst_acpi.c:40:0: ../include/acpi/acpi_bus.h:65:20: error: conflicting types for 'acpi_evaluate_dsm' union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, In file included from ../sound/soc/intel/atom/sst/sst_acpi.c:31:0: ../include/linux/acpi.h:676:34: note: previous definition of 'acpi_evaluate_dsm' was here static inline union acpi_object *acpi_evaluate_dsm(acpi_handle handle, CONFIG_SND_SST_IPC_ACPI was already dependent upon ACPI, but that was not solving it. So move the depends up to machine drivers and remove from CONFIG_SND_SST_IPC_ACPI. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> [arnd: rebased to PATCH kernel] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resumeArnd Bergmann
commit d8fc2198aab117a4bc16ee305caef19c4c7e7f5c upstream. The rockchip spdif driver uses SIMPLE_DEV_PM_OPS to conditionally set its power management functions, but we get a warning about rk_spdif_runtime_resume being unused when CONFIG_PM is not set: sound/soc/rockchip/rockchip_spdif.c:67:12: error: 'rk_spdif_runtime_resume' defined but not used [-Werror=unused-function] This adds a __maybe_unused annotation so the compiler knows it can silently drop it instead of warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25ASoC: mediatek: add i2c dependencyArnd Bergmann
commit ec3995da27e782cc407ce48101c98c19c9ce738d upstream. The newly added mediatek drivers for mt8173 select codes that depend on I2C, which cuases a build failure if I2C is disabled: warning: (SND_SOC_ADAU1761_I2C && SND_SOC_ADAU1781_I2C && SND_SOC_ADAU1977_I2C && SND_SOC_RT5677 && EXTCON_MAX14577 && EXTCON_MAX77693 && EXTCON_MAX77843 && BMC150_ACCEL_I2C && BMG160_I2C) selects REGMAP_I2C which has unmet direct dependencies (I2C) codecs/rt5645.c:3854:1: warning: data definition has no type or storage class codecs/rt5645.c:3854:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] codecs/rt5677.c:5270:1: warning: data definition has no type or storage class 77_i2c_driver); codecs/rt5677.c:5270:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] This adds an explicit dependency. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25ALSA: hda/ca0132 - fix possible NULL pointer useArnd Bergmann
commit 46a049dae771b95e77ac6c823330f4a60f600236 upstream. gcc-7 caught what it considers a NULL pointer dereference: sound/pci/hda/patch_ca0132.c: In function 'dspio_scp.constprop': sound/pci/hda/patch_ca0132.c:1487:4: error: argument 1 null where non-null expected [-Werror=nonnull] This is plausible from looking at the function, as we compare 'reply' to NULL earlier in it. I have not tried to analyze if there are constraints that make it impossible to hit the bug, but adding another NULL check in the end kills the warning and makes the function more robust. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25ASoC: rockchip: disable clock on errorStefan Potyra
[ Upstream commit c7b92172a61b91936be985cb9bc499a4ebc6489b ] Disable the clocks in rk_spdif_probe when an error occurs after one of the clocks has been enabled previously. Found by Linux Driver Verification project (linuxtesting.org). Fixes: f874b80e1571 ASoC: rockchip: Add rockchip SPDIF transceiver driver Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25ASoC: ux500: add MODULE_LICENSE tagArnd Bergmann
commit 1783c9d7cb7bc3181b9271665959b87280d98d8e upstream. This adds MODULE_LICENSE/AUTHOR/DESCRIPTION tags to the ux500 platform drivers, to avoid these build warnings: WARNING: modpost: missing MODULE_LICENSE() in sound/soc/ux500/snd-soc-ux500-plat-dma.o WARNING: modpost: missing MODULE_LICENSE() in sound/soc/ux500/snd-soc-ux500-mach-mop500.o The company no longer exists, so the email addresses of the authors don't work any more, but I've added them anyway for consistency. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>