From: Sasha Levin <sashal@kernel.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shuming Fan <shumingf@realtek.com>, Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.10 02/45] ASoC: rt711: mutex between calibration and power state changes Date: Tue, 19 Jan 2021 20:25:19 -0500 [thread overview] Message-ID: <20210120012602.769683-2-sashal@kernel.org> (raw) In-Reply-To: <20210120012602.769683-1-sashal@kernel.org> From: Shuming Fan <shumingf@realtek.com> [ Upstream commit 6108f990c0887d3e8f1db2d13c7012e40a061f28 ] To avoid calibration time-out, this patch adds the mutex between calibration and power state changes Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20201217085651.24580-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- sound/soc/codecs/rt711.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c index 65b59dbfb43c8..a9b1b4180c471 100644 --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -462,6 +462,8 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol, unsigned int read_ll, read_rl; int i; + mutex_lock(&rt711->calibrate_mutex); + /* Can't use update bit function, so read the original value first */ addr_h = mc->reg; addr_l = mc->rreg; @@ -547,6 +549,8 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol, if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) regmap_write(rt711->regmap, RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); + + mutex_unlock(&rt711->calibrate_mutex); return 0; } @@ -859,9 +863,11 @@ static int rt711_set_bias_level(struct snd_soc_component *component, break; case SND_SOC_BIAS_STANDBY: + mutex_lock(&rt711->calibrate_mutex); regmap_write(rt711->regmap, RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); + mutex_unlock(&rt711->calibrate_mutex); break; default: -- 2.27.0
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shuming Fan <shumingf@realtek.com>, Sasha Levin <sashal@kernel.org>, alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org> Subject: [PATCH AUTOSEL 5.10 02/45] ASoC: rt711: mutex between calibration and power state changes Date: Tue, 19 Jan 2021 20:25:19 -0500 [thread overview] Message-ID: <20210120012602.769683-2-sashal@kernel.org> (raw) In-Reply-To: <20210120012602.769683-1-sashal@kernel.org> From: Shuming Fan <shumingf@realtek.com> [ Upstream commit 6108f990c0887d3e8f1db2d13c7012e40a061f28 ] To avoid calibration time-out, this patch adds the mutex between calibration and power state changes Signed-off-by: Shuming Fan <shumingf@realtek.com> Link: https://lore.kernel.org/r/20201217085651.24580-1-shumingf@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- sound/soc/codecs/rt711.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c index 65b59dbfb43c8..a9b1b4180c471 100644 --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -462,6 +462,8 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol, unsigned int read_ll, read_rl; int i; + mutex_lock(&rt711->calibrate_mutex); + /* Can't use update bit function, so read the original value first */ addr_h = mc->reg; addr_l = mc->rreg; @@ -547,6 +549,8 @@ static int rt711_set_amp_gain_put(struct snd_kcontrol *kcontrol, if (dapm->bias_level <= SND_SOC_BIAS_STANDBY) regmap_write(rt711->regmap, RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); + + mutex_unlock(&rt711->calibrate_mutex); return 0; } @@ -859,9 +863,11 @@ static int rt711_set_bias_level(struct snd_soc_component *component, break; case SND_SOC_BIAS_STANDBY: + mutex_lock(&rt711->calibrate_mutex); regmap_write(rt711->regmap, RT711_SET_AUDIO_POWER_STATE, AC_PWRST_D3); + mutex_unlock(&rt711->calibrate_mutex); break; default: -- 2.27.0
next prev parent reply other threads:[~2021-01-20 2:27 UTC|newest] Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-01-20 1:25 [PATCH AUTOSEL 5.10 01/45] ASoC: Intel: haswell: Add missing pm_ops Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin [this message] 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 02/45] ASoC: rt711: mutex between calibration and power state changes Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 03/45] SUNRPC: Handle TCP socket sends with kernel_sendpage() again Sasha Levin 2021-02-08 19:34 ` Trond Myklebust 2021-02-08 19:48 ` Chuck Lever 2021-02-08 20:12 ` Trond Myklebust 2021-02-08 20:17 ` Chuck Lever 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 04/45] ASoC: AMD Renoir - add DMI entry for Lenovo ThinkPad E14 Gen 2 Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 05/45] HID: multitouch: Enable multi-input for Synaptics pointstick/touchpad device Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 06/45] HID: sony: select CONFIG_CRC32 Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 07/45] dm integrity: select CRYPTO_SKCIPHER Sasha Levin 2021-01-20 1:25 ` [dm-devel] " Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 08/45] x86/hyperv: Fix kexec panic/hang issues Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 09/45] scsi: ufs: Relax the condition of UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 10/45] scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 11/45] scsi: qedi: Correct max length of CHAP secret Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 12/45] scsi: scsi_debug: Fix memleak in scsi_debug_init() Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 13/45] scsi: sd: Suppress spurious errors when WRITE SAME is being disabled Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 14/45] riscv: Fix kernel time_init() Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 15/45] riscv: Fix sifive serial driver Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 16/45] riscv: Enable interrupts during syscalls with M-Mode Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 17/45] HID: logitech-dj: add the G602 receiver Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 18/45] HID: Ignore battery for Elan touchscreen on ASUS UX550 Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 19/45] clk: tegra30: Add hda clock default rates to clock driver Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 20/45] ALSA: hda/tegra: fix tegra-hda on tegra30 soc Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 21/45] r8152: Add Lenovo Powered USB-C Travel Hub Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 22/45] riscv: cacheinfo: Fix using smp_processor_id() in preemptible Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 23/45] arm64: make atomic helpers __always_inline Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 24/45] xen: Fix event channel callback via INTX/GSI Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 25/45] x86/xen: Add xen_no_vector_callback option to test PCI INTX delivery Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 26/45] x86/xen: Fix xen_hvm_smp_init() when vector callback not available Sasha Levin 2021-01-20 1:35 ` Boris Ostrovsky 2021-01-24 13:11 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 27/45] net: stmmac: use __napi_schedule() for PREEMPT_RT Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 28/45] net: stmmac: Fixed mtu channged by cache aligned Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 6:08 ` Jakub Kicinski 2021-01-20 6:08 ` Jakub Kicinski 2021-01-20 14:26 ` Sasha Levin 2021-01-20 14:26 ` Sasha Levin 2021-01-21 14:39 ` [Linux-stm32] " Ahmad Fatoum 2021-01-21 14:39 ` Ahmad Fatoum 2021-01-21 16:02 ` Sasha Levin 2021-01-21 16:02 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 29/45] dts: phy: fix missing mdio device and probe failure of vsc8541-01 device Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 30/45] dts: phy: add GPIO number and active state used for phy reset Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 31/45] riscv: defconfig: enable gpio support for HiFive Unleashed Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 32/45] drm/amdgpu/psp: fix psp gfx ctrl cmds Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 33/45] drm/amd/display: disable dcn10 pipe split by default Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 34/45] HID: logitech-hidpp: Add product ID for MX Ergo in Bluetooth mode Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 35/45] drm/amd/display: Fix to be able to stop crc calculation Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 36/45] drm/nouveau/bios: fix issue shadowing expansion ROMs Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 37/45] drm/nouveau/privring: ack interrupts the same way as RM Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 38/45] drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 39/45] drm/nouveau/mmu: fix vram heap sizing Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 40/45] drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0 Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 41/45] io_uring: flush timeouts that should already have expired Sasha Levin 2021-01-20 1:25 ` [PATCH AUTOSEL 5.10 42/45] libperf tests: If a test fails return non-zero Sasha Levin 2021-01-20 1:26 ` [PATCH AUTOSEL 5.10 43/45] libperf tests: Fail when failing to get a tracepoint id Sasha Levin 2021-01-20 1:26 ` [PATCH AUTOSEL 5.10 44/45] RISC-V: Set current memblock limit Sasha Levin 2021-01-20 1:26 ` Sasha Levin 2021-01-20 1:26 ` [PATCH AUTOSEL 5.10 45/45] RISC-V: Fix maximum allowed phsyical memory for RV32 Sasha Levin 2021-01-20 1:26 ` Sasha Levin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210120012602.769683-2-sashal@kernel.org \ --to=sashal@kernel.org \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=shumingf@realtek.com \ --cc=stable@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.