mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASOC: Intel: kbl_rt5663_rt5514_max98927: Do not try to disable disabled clock
@ 2020-11-11 20:54 Guenter Roeck
  2020-11-18 20:59 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2020-11-11 20:54 UTC (permalink / raw)
  To: Cezary Rojewski
  Cc: Pierre-Louis Bossart, Liam Girdwood, Jie Yang, Mark Brown,
	alsa-devel, linux-kernel, Guenter Roeck, Brent Lu,
	Curtis Malainey

In kabylake_set_bias_level(), enabling mclk may fail if the clock has
already been enabled by the firmware. Attempts to disable that clock
later will fail with a warning backtrace.

mclk already disabled
WARNING: CPU: 2 PID: 108 at drivers/clk/clk.c:952 clk_core_disable+0x1b6/0x1cf
...
Call Trace:
 clk_disable+0x2d/0x3a
 kabylake_set_bias_level+0x72/0xfd [snd_soc_kbl_rt5663_rt5514_max98927]
 snd_soc_card_set_bias_level+0x2b/0x6f
 snd_soc_dapm_set_bias_level+0xe1/0x209
 dapm_pre_sequence_async+0x63/0x96
 async_run_entry_fn+0x3d/0xd1
 process_one_work+0x2a9/0x526
...

Only disable the clock if it has been enabled.

Fixes: 15747a802075 ("ASoC: eve: implement set_bias_level function for rt5514")
Cc: Brent Lu <brent.lu@intel.com>
Cc: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
index 922cd0176e1f..f95546c184aa 100644
--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
+++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
@@ -700,6 +700,8 @@ static int kabylake_set_bias_level(struct snd_soc_card *card,
 	switch (level) {
 	case SND_SOC_BIAS_PREPARE:
 		if (dapm->bias_level == SND_SOC_BIAS_ON) {
+			if (!__clk_is_enabled(priv->mclk))
+				return 0;
 			dev_dbg(card->dev, "Disable mclk");
 			clk_disable_unprepare(priv->mclk);
 		} else {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASOC: Intel: kbl_rt5663_rt5514_max98927: Do not try to disable disabled clock
  2020-11-11 20:54 [PATCH] ASOC: Intel: kbl_rt5663_rt5514_max98927: Do not try to disable disabled clock Guenter Roeck
@ 2020-11-18 20:59 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-11-18 20:59 UTC (permalink / raw)
  To: Guenter Roeck, Cezary Rojewski
  Cc: Brent Lu, Curtis Malainey, Liam Girdwood, linux-kernel, Jie Yang,
	Pierre-Louis Bossart, alsa-devel

On Wed, 11 Nov 2020 12:54:34 -0800, Guenter Roeck wrote:
> In kabylake_set_bias_level(), enabling mclk may fail if the clock has
> already been enabled by the firmware. Attempts to disable that clock
> later will fail with a warning backtrace.
> 
> mclk already disabled
> WARNING: CPU: 2 PID: 108 at drivers/clk/clk.c:952 clk_core_disable+0x1b6/0x1cf
> ...
> Call Trace:
>  clk_disable+0x2d/0x3a
>  kabylake_set_bias_level+0x72/0xfd [snd_soc_kbl_rt5663_rt5514_max98927]
>  snd_soc_card_set_bias_level+0x2b/0x6f
>  snd_soc_dapm_set_bias_level+0xe1/0x209
>  dapm_pre_sequence_async+0x63/0x96
>  async_run_entry_fn+0x3d/0xd1
>  process_one_work+0x2a9/0x526
> ...
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASOC: Intel: kbl_rt5663_rt5514_max98927: Do not try to disable disabled clock
      commit: 879ee8b6f2bae0cc4a25536f8841db1dbc969523

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-18 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11 20:54 [PATCH] ASOC: Intel: kbl_rt5663_rt5514_max98927: Do not try to disable disabled clock Guenter Roeck
2020-11-18 20:59 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®