linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Nikita Shubin <nikita.shubin@maquefel.me>,
	alsa-devel@alsa-project.org
Cc: Alexander Sverdlin <alexander.sverdlin@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/7] ASoC: cirrus: i2s: Prepare clock before using it
Date: Mon, 14 Jun 2021 01:30:40 +0200	[thread overview]
Message-ID: <20210613233041.128961-7-alexander.sverdlin@gmail.com> (raw)
In-Reply-To: <20210613233041.128961-1-alexander.sverdlin@gmail.com>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework, otherwise the following is visible:

WARNING: CPU: 0 PID: 97 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared mclk
CPU: 0 PID: 97 Comm: OPAL-Event:97 Not tainted 5.13.0-rc5-tekon #1
Hardware name: Cirrus Logic EDB9302 Evaluation Board
[<c000d5b0>] (unwind_backtrace) from [<c000c590>] (show_stack+0x10/0x18)
[<c000c590>] (show_stack) from [<c03a5fd8>] (dump_stack+0x20/0x2c)
[<c03a5fd8>] (dump_stack) from [<c03a2138>] (__warn+0x98/0xc0)
[<c03a2138>] (__warn) from [<c03a21f0>] (warn_slowpath_fmt+0x90/0xc0)
[<c03a21f0>] (warn_slowpath_fmt) from [<c01d8358>] (clk_core_enable+0x9c/0xbc)
[<c01d8358>] (clk_core_enable) from [<c01d8698>] (clk_core_enable_lock+0x18/0x30)
[<c01d8698>] (clk_core_enable_lock) from [<c0291568>] (ep93xx_i2s_hw_params+0x1a0/0x1c0)
[<c0291568>] (ep93xx_i2s_hw_params) from [<c0287488>] (snd_soc_dai_hw_params+0x54/0xb4)
[<c0287488>] (snd_soc_dai_hw_params) from [<c028b0a4>] (soc_pcm_hw_params+0x418/0x5bc)
[<c028b0a4>] (soc_pcm_hw_params) from [<c0275608>] (snd_pcm_hw_params+0x14c/0x448)
[<c0275608>] (snd_pcm_hw_params) from [<c02761ac>] (snd_pcm_ioctl+0x258/0x1114)
[<c02761ac>] (snd_pcm_ioctl) from [<c00e6d40>] (sys_ioctl+0x290/0xbc4)
[<c00e6d40>] (sys_ioctl) from [<c0008200>] (ret_fast_syscall+0x0/0x4c)

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
 sound/soc/cirrus/ep93xx-i2s.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 0d26550d0df8..4d3179f03202 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -111,9 +111,9 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream)
 	if ((ep93xx_i2s_read_reg(info, EP93XX_I2S_TX0EN) & 0x1) == 0 &&
 	    (ep93xx_i2s_read_reg(info, EP93XX_I2S_RX0EN) & 0x1) == 0) {
 		/* Enable clocks */
-		clk_enable(info->mclk);
-		clk_enable(info->sclk);
-		clk_enable(info->lrclk);
+		clk_prepare_enable(info->mclk);
+		clk_prepare_enable(info->sclk);
+		clk_prepare_enable(info->lrclk);
 
 		/* Enable i2s */
 		ep93xx_i2s_write_reg(info, EP93XX_I2S_GLCTRL, 1);
@@ -156,9 +156,9 @@ static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream)
 		ep93xx_i2s_write_reg(info, EP93XX_I2S_GLCTRL, 0);
 
 		/* Disable clocks */
-		clk_disable(info->lrclk);
-		clk_disable(info->sclk);
-		clk_disable(info->mclk);
+		clk_disable_unprepare(info->lrclk);
+		clk_disable_unprepare(info->sclk);
+		clk_disable_unprepare(info->mclk);
 	}
 }
 
-- 
2.32.0


  parent reply	other threads:[~2021-06-13 23:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 23:30 [PATCH 0/7] Prepare EP93xx drivers for Common Clock Framework Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 1/7] iio: ep93xx: Prepare clock before using it Alexander Sverdlin
2021-06-14 10:50   ` Jonathan Cameron
2021-06-14 10:59     ` Alexander Sverdlin
2021-08-02  7:30     ` Alexander Sverdlin
2021-08-08 13:58       ` Jonathan Cameron
2021-06-13 23:30 ` [PATCH 2/7] spi: spi-ep93xx: " Alexander Sverdlin
2021-06-14 10:34   ` Mark Brown
2021-06-13 23:30 ` [PATCH 3/7] Input: ep93xx_keypad: " Alexander Sverdlin
2021-06-14 21:55   ` Dmitry Torokhov
2021-06-15  7:46     ` Alexander Sverdlin
2021-06-20  3:23       ` Dmitry Torokhov
2021-08-02  7:28         ` Alexander Sverdlin
2021-09-13 21:29         ` Alexander Sverdlin
2021-10-12  1:43           ` Dmitry Torokhov
2021-10-12  7:44             ` Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 4/7] video: ep93xx: " Alexander Sverdlin
2021-06-13 23:30 ` [PATCH 5/7] dmaengine: " Alexander Sverdlin
2021-06-13 23:30 ` Alexander Sverdlin [this message]
2021-06-13 23:30 ` [PATCH 7/7] pwm: " Alexander Sverdlin
2021-06-14  7:22   ` Uwe Kleine-König
2021-06-14  7:30     ` Alexander Sverdlin
2021-09-13 21:46     ` Alexander Sverdlin
2021-09-14  7:58       ` Uwe Kleine-König
2021-09-14 10:15         ` Alexander Sverdlin
2021-09-14 10:19           ` Uwe Kleine-König
2021-06-14  7:15 ` [PATCH 0/7] Prepare EP93xx drivers for Common Clock Framework Uwe Kleine-König

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=20210613233041.128961-7-alexander.sverdlin@gmail.com \
    --to=alexander.sverdlin@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=geert@linux-m68k.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nikita.shubin@maquefel.me \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).