[PATCH 0/7] Prepare EP93xx drivers for Common Clock Framework
Nikita posted a patch converting EP93xx to use Common Clock Framework. It turns out some cleanup is necessary in the EP93xx drivers to avoid "Enabling unprepared" clock warnings.
Patches with stack traces in the commit messages are tested on EP9302.
Link: https://lore.kernel.org/patchwork/patch/1435884/
Alexander Sverdlin (7): iio: ep93xx: Prepare clock before using it spi: spi-ep93xx: Prepare clock before using it Input: ep93xx_keypad: Prepare clock before using it video: ep93xx: Prepare clock before using it dmaengine: ep93xx: Prepare clock before using it ASoC: cirrus: i2s: Prepare clock before using it pwm: ep93xx: Prepare clock before using it
drivers/dma/ep93xx_dma.c | 6 +++--- drivers/iio/adc/ep93xx_adc.c | 6 +++--- drivers/input/keyboard/ep93xx_keypad.c | 4 ++-- drivers/pwm/pwm-ep93xx.c | 12 ++++++------ drivers/spi/spi-ep93xx.c | 4 ++-- drivers/video/fbdev/ep93xx-fb.c | 4 ++-- sound/soc/cirrus/ep93xx-i2s.c | 12 ++++++------ 7 files changed, 24 insertions(+), 24 deletions(-)
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); } }
On Mon, Jun 14, 2021 at 01:30:34AM +0200, Alexander Sverdlin wrote:
Nikita posted a patch converting EP93xx to use Common Clock Framework. It turns out some cleanup is necessary in the EP93xx drivers to avoid "Enabling unprepared" clock warnings.
Patches with stack traces in the commit messages are tested on EP9302.
One thing to note is: ep93xx currently doesn't provide a clk_prepare function, this isn't a problem though because include/linux/clk.h provides a dummy if CONFIG_HAVE_CLK_PREPARE isn't defined. So as ep93xx doesn't define this symbol the changes here effectively only add a might_sleep.
Best regards Uwe
On Monday, June 14, 2021, Alexander Sverdlin alexander.sverdlin@gmail.com wrote:
Nikita posted a patch converting EP93xx to use Common Clock Framework. It turns out some cleanup is necessary in the EP93xx drivers to avoid "Enabling unprepared" clock warnings.
Patches with stack traces in the commit messages are tested on EP9302.
For all commit messages: please, reduce the noise in them as much as possible, i.e. leave only up to ~3-4 most significant lines out of trackbacks.
Alexander Sverdlin (7): iio: ep93xx: Prepare clock before using it spi: spi-ep93xx: Prepare clock before using it Input: ep93xx_keypad: Prepare clock before using it video: ep93xx: Prepare clock before using it dmaengine: ep93xx: Prepare clock before using it ASoC: cirrus: i2s: Prepare clock before using it pwm: ep93xx: Prepare clock before using it
drivers/dma/ep93xx_dma.c | 6 +++--- drivers/iio/adc/ep93xx_adc.c | 6 +++--- drivers/input/keyboard/ep93xx_keypad.c | 4 ++-- drivers/pwm/pwm-ep93xx.c | 12 ++++++------ drivers/spi/spi-ep93xx.c | 4 ++-- drivers/video/fbdev/ep93xx-fb.c | 4 ++-- sound/soc/cirrus/ep93xx-i2s.c | 12 ++++++------ 7 files changed, 24 insertions(+), 24 deletions(-)
-- 2.32.0
participants (3)
-
Alexander Sverdlin
-
Andy Shevchenko
-
Uwe Kleine-König