2021-07-26 12:00:23

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH 0/8] arm: ep93xx: CCF conversion

This series series of patches converts ep93xx to Common Clock Framework.

It consists of preparation patches to use clk_prepare_enable where it is
needed, instead of clk_enable used in ep93xx drivers prior to CCF and
a patch converting mach-ep93xx/clock.c to CCF.

Link: https://lore.kernel.org/patchwork/cover/1445563/
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

Nikita Shubin (1):
ep93xx: clock: convert in-place to COMMON_CLK

arch/arm/Kconfig | 2 +-
arch/arm/mach-ep93xx/clock.c | 975 ++++++++++++++-----------
arch/arm/mach-ep93xx/core.c | 2 +-
arch/arm/mach-ep93xx/soc.h | 42 +-
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 +-
11 files changed, 605 insertions(+), 464 deletions(-)


base-commit: 64376a981a0e2e57c46efa63197c2ebb7dab35df
--
2.26.2


2021-07-26 12:01:05

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH 6/8] ASoC: cirrus: i2s: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_i2s_hw_params
snd_soc_dai_hw_params
soc_pcm_hw_params
snd_pcm_hw_params
snd_pcm_ioctl
...

Signed-off-by: Alexander Sverdlin <[email protected]>
---
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.26.2

2021-07-26 12:01:19

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH 7/8] pwm: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework.

Signed-off-by: Alexander Sverdlin <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
---
drivers/pwm/pwm-ep93xx.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index 4ca70794ad96..8c0d4d69d9e6 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -74,7 +74,7 @@ static int ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
* Configuration can be changed at any time.
*/
if (!pwm_is_enabled(pwm)) {
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;
}
@@ -105,7 +105,7 @@ static int ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
}

if (!pwm_is_enabled(pwm))
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);

return ret;
}
@@ -120,7 +120,7 @@ static int ep93xx_pwm_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
* The clock needs to be enabled to access the PWM registers.
* Polarity can only be changed when the PWM is disabled.
*/
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;

@@ -129,7 +129,7 @@ static int ep93xx_pwm_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
else
writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_INVERT);

- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);

return 0;
}
@@ -139,7 +139,7 @@ static int ep93xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);
int ret;

- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;

@@ -153,7 +153,7 @@ static void ep93xx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);

writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_ENABLE);
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);
}

static const struct pwm_ops ep93xx_pwm_ops = {
--
2.26.2

2021-07-26 12:02:39

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH 5/8] dmaengine: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared m2p0
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_dma_alloc_chan_resources
dma_chan_get
find_candidate
__dma_request_channel
snd_dmaengine_pcm_request_channel
dmaengine_pcm_new
snd_soc_pcm_component_new
soc_new_pcm
snd_soc_bind_card
edb93xx_probe
...
ep93xx-i2s ep93xx-i2s: Missing dma channel for stream: 0
ep93xx-i2s ep93xx-i2s: ASoC: error at snd_soc_pcm_component_new on ep93xx-i2s: -22
edb93xx-audio edb93xx-audio: ASoC: can't create pcm CS4271 HiFi :-22
edb93xx-audio edb93xx-audio: snd_soc_register_card() failed: -22
edb93xx-audio: probe of edb93xx-audio failed with error -22

Signed-off-by: Alexander Sverdlin <[email protected]>
---
drivers/dma/ep93xx_dma.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index 01027779beb8..98f9ee70362e 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -897,7 +897,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
if (data && data->name)
name = data->name;

- ret = clk_enable(edmac->clk);
+ ret = clk_prepare_enable(edmac->clk);
if (ret)
return ret;

@@ -936,7 +936,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
fail_free_irq:
free_irq(edmac->irq, edmac);
fail_clk_disable:
- clk_disable(edmac->clk);
+ clk_disable_unprepare(edmac->clk);

return ret;
}
@@ -969,7 +969,7 @@ static void ep93xx_dma_free_chan_resources(struct dma_chan *chan)
list_for_each_entry_safe(desc, d, &list, node)
kfree(desc);

- clk_disable(edmac->clk);
+ clk_disable_unprepare(edmac->clk);
free_irq(edmac->irq, edmac);
}

--
2.26.2

2021-07-26 14:02:31

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 0/8] arm: ep93xx: CCF conversion

This series series of patches converts ep93xx to Common Clock Framework.

It consists of preparation patches to use clk_prepare_enable where it is
needed, instead of clk_enable used in ep93xx drivers prior to CCF and
a patch converting mach-ep93xx/clock.c to CCF.

Link: https://lore.kernel.org/patchwork/cover/1445563/
Link: https://lore.kernel.org/patchwork/patch/1435884/

v1->v2:
- added SoB

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

Nikita Shubin (1):
ep93xx: clock: convert in-place to COMMON_CLK

arch/arm/Kconfig | 2 +-
arch/arm/mach-ep93xx/clock.c | 975 ++++++++++++++-----------
arch/arm/mach-ep93xx/core.c | 2 +-
arch/arm/mach-ep93xx/soc.h | 42 +-
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 +-
11 files changed, 605 insertions(+), 464 deletions(-)


base-commit: 64376a981a0e2e57c46efa63197c2ebb7dab35df
--
2.26.2

2021-07-26 14:02:32

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 1/8] iio: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared ep93xx-adc
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
unwind_backtrace) from [<c000c590>] (show_stack+0x10/0x18)
...
clk_core_enable
clk_core_enable_lock
ep93xx_adc_probe
...
ep93xx-adc ep93xx-adc: Cannot enable clock
ep93xx-adc: probe of ep93xx-adc failed with error -108

Signed-off-by: Alexander Sverdlin <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
drivers/iio/adc/ep93xx_adc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c
index c08ab3c6dfaf..5c85257b814c 100644
--- a/drivers/iio/adc/ep93xx_adc.c
+++ b/drivers/iio/adc/ep93xx_adc.c
@@ -207,7 +207,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev)
*/
}

- ret = clk_enable(priv->clk);
+ ret = clk_prepare_enable(priv->clk);
if (ret) {
dev_err(&pdev->dev, "Cannot enable clock\n");
return ret;
@@ -215,7 +215,7 @@ static int ep93xx_adc_probe(struct platform_device *pdev)

ret = iio_device_register(iiodev);
if (ret)
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);

return ret;
}
@@ -226,7 +226,7 @@ static int ep93xx_adc_remove(struct platform_device *pdev)
struct ep93xx_adc_priv *priv = iio_priv(iiodev);

iio_device_unregister(iiodev);
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);

return 0;
}

base-commit: 64376a981a0e2e57c46efa63197c2ebb7dab35df
--
2.26.2

2021-07-26 14:02:32

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 2/8] spi: spi-ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared ep93xx-spi.0
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_spi_prepare_hardware
__spi_pump_messages
__spi_sync
spi_sync
spi_sync_transfer.constprop.0
regmap_spi_write
_regmap_raw_write_impl
_regmap_bus_raw_write
_regmap_update_bits
regmap_update_bits_base
cs4271_component_probe
snd_soc_component_probe
soc_probe_component
snd_soc_bind_card
edb93xx_probe
...
spi_master spi0: failed to prepare transfer hardware: -108

Signed-off-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
drivers/spi/spi-ep93xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index aa676559d273..5896a7b2fade 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -550,7 +550,7 @@ static int ep93xx_spi_prepare_hardware(struct spi_master *master)
u32 val;
int ret;

- ret = clk_enable(espi->clk);
+ ret = clk_prepare_enable(espi->clk);
if (ret)
return ret;

@@ -570,7 +570,7 @@ static int ep93xx_spi_unprepare_hardware(struct spi_master *master)
val &= ~SSPCR1_SSE;
writel(val, espi->mmio + SSPCR1);

- clk_disable(espi->clk);
+ clk_disable_unprepare(espi->clk);

return 0;
}
--
2.26.2

2021-07-26 14:02:38

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 3/8] Input: ep93xx_keypad: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework.

Signed-off-by: Alexander Sverdlin <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index c8194333d612..e0e931e796fa 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -157,7 +157,7 @@ static int ep93xx_keypad_open(struct input_dev *pdev)

if (!keypad->enabled) {
ep93xx_keypad_config(keypad);
- clk_enable(keypad->clk);
+ clk_prepare_enable(keypad->clk);
keypad->enabled = true;
}

@@ -169,7 +169,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev)
struct ep93xx_keypad *keypad = input_get_drvdata(pdev);

if (keypad->enabled) {
- clk_disable(keypad->clk);
+ clk_disable_unprepare(keypad->clk);
keypad->enabled = false;
}
}
--
2.26.2

2021-07-26 14:02:48

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 4/8] video: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework.

Signed-off-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
drivers/video/fbdev/ep93xx-fb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c
index ba33b4dce0df..2398b3d48fed 100644
--- a/drivers/video/fbdev/ep93xx-fb.c
+++ b/drivers/video/fbdev/ep93xx-fb.c
@@ -548,7 +548,7 @@ static int ep93xxfb_probe(struct platform_device *pdev)
}

ep93xxfb_set_par(info);
- clk_enable(fbi->clk);
+ clk_prepare_enable(fbi->clk);

err = register_framebuffer(info);
if (err)
@@ -577,7 +577,7 @@ static int ep93xxfb_remove(struct platform_device *pdev)
struct ep93xx_fbi *fbi = info->par;

unregister_framebuffer(info);
- clk_disable(fbi->clk);
+ clk_disable_unprepare(fbi->clk);
ep93xxfb_dealloc_videomem(info);
fb_dealloc_cmap(&info->cmap);

--
2.26.2

2021-07-26 14:03:10

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 7/8] pwm: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework.

Signed-off-by: Alexander Sverdlin <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
drivers/pwm/pwm-ep93xx.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index 4ca70794ad96..8c0d4d69d9e6 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -74,7 +74,7 @@ static int ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
* Configuration can be changed at any time.
*/
if (!pwm_is_enabled(pwm)) {
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;
}
@@ -105,7 +105,7 @@ static int ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
}

if (!pwm_is_enabled(pwm))
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);

return ret;
}
@@ -120,7 +120,7 @@ static int ep93xx_pwm_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
* The clock needs to be enabled to access the PWM registers.
* Polarity can only be changed when the PWM is disabled.
*/
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;

@@ -129,7 +129,7 @@ static int ep93xx_pwm_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
else
writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_INVERT);

- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);

return 0;
}
@@ -139,7 +139,7 @@ static int ep93xx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);
int ret;

- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;

@@ -153,7 +153,7 @@ static void ep93xx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
struct ep93xx_pwm *ep93xx_pwm = to_ep93xx_pwm(chip);

writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_ENABLE);
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);
}

static const struct pwm_ops ep93xx_pwm_ops = {
--
2.26.2

2021-07-26 14:04:34

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 5/8] dmaengine: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared m2p0
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_dma_alloc_chan_resources
dma_chan_get
find_candidate
__dma_request_channel
snd_dmaengine_pcm_request_channel
dmaengine_pcm_new
snd_soc_pcm_component_new
soc_new_pcm
snd_soc_bind_card
edb93xx_probe
...
ep93xx-i2s ep93xx-i2s: Missing dma channel for stream: 0
ep93xx-i2s ep93xx-i2s: ASoC: error at snd_soc_pcm_component_new on ep93xx-i2s: -22
edb93xx-audio edb93xx-audio: ASoC: can't create pcm CS4271 HiFi :-22
edb93xx-audio edb93xx-audio: snd_soc_register_card() failed: -22
edb93xx-audio: probe of edb93xx-audio failed with error -22

Signed-off-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
drivers/dma/ep93xx_dma.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index 01027779beb8..98f9ee70362e 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -897,7 +897,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
if (data && data->name)
name = data->name;

- ret = clk_enable(edmac->clk);
+ ret = clk_prepare_enable(edmac->clk);
if (ret)
return ret;

@@ -936,7 +936,7 @@ static int ep93xx_dma_alloc_chan_resources(struct dma_chan *chan)
fail_free_irq:
free_irq(edmac->irq, edmac);
fail_clk_disable:
- clk_disable(edmac->clk);
+ clk_disable_unprepare(edmac->clk);

return ret;
}
@@ -969,7 +969,7 @@ static void ep93xx_dma_free_chan_resources(struct dma_chan *chan)
list_for_each_entry_safe(desc, d, &list, node)
kfree(desc);

- clk_disable(edmac->clk);
+ clk_disable_unprepare(edmac->clk);
free_irq(edmac->irq, edmac);
}

--
2.26.2

2021-07-26 14:04:34

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH v2 6/8] ASoC: cirrus: i2s: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_i2s_hw_params
snd_soc_dai_hw_params
soc_pcm_hw_params
snd_pcm_hw_params
snd_pcm_ioctl
...

Signed-off-by: Alexander Sverdlin <[email protected]>
Signed-off-by: Nikita Shubin <[email protected]>
---
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.26.2

2021-07-26 14:26:32

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH 4/8] video: ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
to Common Clock Framework.

Signed-off-by: Alexander Sverdlin <[email protected]>
---
drivers/video/fbdev/ep93xx-fb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c
index ba33b4dce0df..2398b3d48fed 100644
--- a/drivers/video/fbdev/ep93xx-fb.c
+++ b/drivers/video/fbdev/ep93xx-fb.c
@@ -548,7 +548,7 @@ static int ep93xxfb_probe(struct platform_device *pdev)
}

ep93xxfb_set_par(info);
- clk_enable(fbi->clk);
+ clk_prepare_enable(fbi->clk);

err = register_framebuffer(info);
if (err)
@@ -577,7 +577,7 @@ static int ep93xxfb_remove(struct platform_device *pdev)
struct ep93xx_fbi *fbi = info->par;

unregister_framebuffer(info);
- clk_disable(fbi->clk);
+ clk_disable_unprepare(fbi->clk);
ep93xxfb_dealloc_videomem(info);
fb_dealloc_cmap(&info->cmap);

--
2.26.2

2021-07-26 14:26:54

by Nikita Shubin

[permalink] [raw]
Subject: [PATCH 2/8] spi: spi-ep93xx: Prepare clock before using it

From: Alexander Sverdlin <[email protected]>

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

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
Enabling unprepared ep93xx-spi.0
...
Hardware name: Cirrus Logic EDB9302 Evaluation Board
...
clk_core_enable
clk_core_enable_lock
ep93xx_spi_prepare_hardware
__spi_pump_messages
__spi_sync
spi_sync
spi_sync_transfer.constprop.0
regmap_spi_write
_regmap_raw_write_impl
_regmap_bus_raw_write
_regmap_update_bits
regmap_update_bits_base
cs4271_component_probe
snd_soc_component_probe
soc_probe_component
snd_soc_bind_card
edb93xx_probe
...
spi_master spi0: failed to prepare transfer hardware: -108

Signed-off-by: Alexander Sverdlin <[email protected]>
---
drivers/spi/spi-ep93xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index aa676559d273..5896a7b2fade 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -550,7 +550,7 @@ static int ep93xx_spi_prepare_hardware(struct spi_master *master)
u32 val;
int ret;

- ret = clk_enable(espi->clk);
+ ret = clk_prepare_enable(espi->clk);
if (ret)
return ret;

@@ -570,7 +570,7 @@ static int ep93xx_spi_unprepare_hardware(struct spi_master *master)
val &= ~SSPCR1_SSE;
writel(val, espi->mmio + SSPCR1);

- clk_disable(espi->clk);
+ clk_disable_unprepare(espi->clk);

return 0;
}
--
2.26.2

2021-07-26 17:10:58

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 2/8] spi: spi-ep93xx: Prepare clock before using it

On Mon, Jul 26, 2021 at 04:59:50PM +0300, Nikita Shubin wrote:
> From: Alexander Sverdlin <[email protected]>
>
> Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> to Common Clock Framework, otherwise the following is visible:

Acked-by: Mark Brown <[email protected]>

>
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
> Enabling unprepared ep93xx-spi.0
> ...
> Hardware name: Cirrus Logic EDB9302 Evaluation Board
> ...
> clk_core_enable
> clk_core_enable_lock
> ep93xx_spi_prepare_hardware

Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative (it often is
for search engines if nothing else) then it's usually better to pull out
the relevant sections.


Attachments:
(No filename) (962.00 B)
signature.asc (499.00 B)
Download all attachments

2021-07-26 17:14:07

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 6/8] ASoC: cirrus: i2s: Prepare clock before using it

On Mon, Jul 26, 2021 at 04:59:54PM +0300, Nikita Shubin wrote:
> From: Alexander Sverdlin <[email protected]>
>
> Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> to Common Clock Framework, otherwise the following is visible:

Acked-by: Mark Brown <[email protected]>


Attachments:
(No filename) (316.00 B)
signature.asc (499.00 B)
Download all attachments

2021-07-31 22:07:10

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/8] arm: ep93xx: CCF conversion

On Mon, Jul 26, 2021 at 1:51 PM Nikita Shubin <[email protected]> wrote:

> This series series of patches converts ep93xx to Common Clock Framework.
>
> It consists of preparation patches to use clk_prepare_enable where it is
> needed, instead of clk_enable used in ep93xx drivers prior to CCF and
> a patch converting mach-ep93xx/clock.c to CCF.
>
> Link: https://lore.kernel.org/patchwork/cover/1445563/
> 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
>
> Nikita Shubin (1):
> ep93xx: clock: convert in-place to COMMON_CLK

This series is looking very good.
Reviewed-by: Linus Walleij <[email protected]>

I suppose the per-subsystem patches can be picked up by
each subsystem maintainer and then you can send the "big patch"
to the SoC tree.

Yours,
Linus Walleij

2021-08-02 06:58:44

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2 5/8] dmaengine: ep93xx: Prepare clock before using it

On 26-07-21, 16:59, Nikita Shubin wrote:
> From: Alexander Sverdlin <[email protected]>
>
> Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> to Common Clock Framework, otherwise the following is visible:
>
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
> Enabling unprepared m2p0
> ...
> Hardware name: Cirrus Logic EDB9302 Evaluation Board
> ...
> clk_core_enable
> clk_core_enable_lock
> ep93xx_dma_alloc_chan_resources
> dma_chan_get
> find_candidate
> __dma_request_channel
> snd_dmaengine_pcm_request_channel
> dmaengine_pcm_new
> snd_soc_pcm_component_new
> soc_new_pcm
> snd_soc_bind_card
> edb93xx_probe
> ...
> ep93xx-i2s ep93xx-i2s: Missing dma channel for stream: 0
> ep93xx-i2s ep93xx-i2s: ASoC: error at snd_soc_pcm_component_new on ep93xx-i2s: -22
> edb93xx-audio edb93xx-audio: ASoC: can't create pcm CS4271 HiFi :-22
> edb93xx-audio edb93xx-audio: snd_soc_register_card() failed: -22
> edb93xx-audio: probe of edb93xx-audio failed with error -22

Applied, thanks

--
~Vinod

2021-08-02 07:43:24

by Alexander Sverdlin

[permalink] [raw]
Subject: Re: [PATCH v2 2/8] spi: spi-ep93xx: Prepare clock before using it

Hello Mark,

On 26/07/2021 18:51, Mark Brown wrote:
> On Mon, Jul 26, 2021 at 04:59:50PM +0300, Nikita Shubin wrote:
>> From: Alexander Sverdlin <[email protected]>
>>
>> Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
>> to Common Clock Framework, otherwise the following is visible:
> Acked-by: Mark Brown <[email protected]>

It looks like we didn't manage to bring the whole series as one lot to any
maintainer and two patches were applied to two different trees.
Could you please take this one to your tree as well?

>> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc
>> Enabling unprepared ep93xx-spi.0
>> ...
>> Hardware name: Cirrus Logic EDB9302 Evaluation Board
>> ...
>> clk_core_enable
>> clk_core_enable_lock
>> ep93xx_spi_prepare_hardware
> Please think hard before including complete backtraces in upstream
> reports, they are very large and contain almost no useful information
> relative to their size so often obscure the relevant content in your
> message. If part of the backtrace is usefully illustrative (it often is
> for search engines if nothing else) then it's usually better to pull out
> the relevant sections.

Yes, I noted your comment first time and this was already stripped version
of the backtrace, but please feel free to strip it even harder if you
take the patch.

Thank you for the review,
--
Alex.

2021-08-03 23:23:30

by Mark Brown

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 0/8] arm: ep93xx: CCF conversion

On Mon, 26 Jul 2021 16:59:48 +0300, Nikita Shubin wrote:
> This series series of patches converts ep93xx to Common Clock Framework.
>
> It consists of preparation patches to use clk_prepare_enable where it is
> needed, instead of clk_enable used in ep93xx drivers prior to CCF and
> a patch converting mach-ep93xx/clock.c to CCF.
>
> Link: https://lore.kernel.org/patchwork/cover/1445563/
> Link: https://lore.kernel.org/patchwork/patch/1435884/
>
> [...]

Applied to

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

Thanks!

[2/8] spi: spi-ep93xx: Prepare clock before using it
commit: 7c72dc56a631b87043e3c5838f5094db30d8c58d

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

2021-09-14 01:13:30

by Alexander Sverdlin

[permalink] [raw]
Subject: Re: [PATCH v2 2/8] spi: spi-ep93xx: Prepare clock before using it

Hello Mark,

On Mon, 2021-07-26 at 17:51 +0100, Mark Brown wrote:
> > From: Alexander Sverdlin <[email protected]>
> >
> > Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> > to Common Clock Framework, otherwise the following is visible:
>
> Acked-by: Mark Brown <[email protected]>

would you take the patch to a tree of yours, please?

--
Alexander Sverdlin.


2021-09-14 01:13:55

by Alexander Sverdlin

[permalink] [raw]
Subject: Re: [PATCH v2 6/8] ASoC: cirrus: i2s: Prepare clock before using it

Hello Mark,

On Mon, 2021-07-26 at 17:51 +0100, Mark Brown wrote:
> On Mon, Jul 26, 2021 at 04:59:54PM +0300, Nikita Shubin wrote:
> > From: Alexander Sverdlin <[email protected]>
> >
> > Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> > to Common Clock Framework, otherwise the following is visible:
>
> Acked-by: Mark Brown <[email protected]>

would you take the patch to a tree of yours, please?

--
Alexander Sverdlin.


2021-09-14 01:16:22

by Alexander Sverdlin

[permalink] [raw]
Subject: Re: [PATCH v2 2/8] spi: spi-ep93xx: Prepare clock before using it

On Mon, 2021-09-13 at 23:36 +0200, Alexander Sverdlin wrote:
> > > From: Alexander Sverdlin <[email protected]>
> > >
> > > Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> > > to Common Clock Framework, otherwise the following is visible:
> >
> > Acked-by: Mark Brown <[email protected]>
>
> would you take the patch to a tree of yours, please?

Please ignore this request, I've mixed up the patches, sorry!

--
Alexander Sverdlin.


2021-09-14 10:34:55

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 2/8] spi: spi-ep93xx: Prepare clock before using it

On Mon, Sep 13, 2021 at 11:36:30PM +0200, Alexander Sverdlin wrote:
> On Mon, 2021-07-26 at 17:51 +0100, Mark Brown wrote:

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

> > Acked-by: Mark Brown <[email protected]>

> would you take the patch to a tree of yours, please?

What's the story with the dependencies?


Attachments:
(No filename) (429.00 B)
signature.asc (499.00 B)
Download all attachments

2021-10-12 07:29:57

by Alexander Sverdlin

[permalink] [raw]
Subject: Re: [PATCH v2 6/8] ASoC: cirrus: i2s: Prepare clock before using it

Hello Mark,

On Mon, 2021-09-13 at 23:43 +0200, Alexander Sverdlin wrote:
> On Mon, 2021-07-26 at 17:51 +0100, Mark Brown wrote:
> > On Mon, Jul 26, 2021 at 04:59:54PM +0300, Nikita Shubin wrote:
> > > From: Alexander Sverdlin <[email protected]>
> > >
> > > Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch
> > > to Common Clock Framework, otherwise the following is visible:
> >
> > Acked-by: Mark Brown <[email protected]>
>
> would you take the patch to a tree of yours, please?

I still cannot find this patch in any of your trees, but I've found this one:

commit 726e6f31b1026f62206f1d32b5cbb7e9582c4d03
Merge: b09bff2676be 7c72dc56a631
Author: Mark Brown <[email protected]>
Date: Tue Aug 3 23:27:27 2021 +0100

Merge series "arm: ep93xx: CCF conversion" from Nikita Shubin <[email protected]>:

This series series of patches converts ep93xx to Common Clock Framework.

It consists of preparation patches to use clk_prepare_enable where it is
needed, instead of clk_enable used in ep93xx drivers prior to CCF and
a patch converting mach-ep93xx/clock.c to CCF.

Link: https://lore.kernel.org/patchwork/cover/1445563/
Link: https://lore.kernel.org/patchwork/patch/1435884/

v1->v2:
- added SoB

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

Nikita Shubin (1):
ep93xx: clock: convert in-place to COMMON_CLK


... which claims to merge both "ASoC: cirrus: i2s: Prepare clock before using it"
and "ep93xx: clock: convert in-place to COMMON_CLK", but they are actually not
merged.

Could you please consider ASoC patch, while I will resubmit the final clock conversion?

--
Alexander Sverdlin.


2021-10-12 10:41:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2 6/8] ASoC: cirrus: i2s: Prepare clock before using it

On Tue, Oct 12, 2021 at 09:25:15AM +0200, Alexander Sverdlin wrote:
> On Mon, 2021-09-13 at 23:43 +0200, Alexander Sverdlin wrote:

> > would you take the patch to a tree of yours, please?

> I still cannot find this patch in any of your trees, but I've found this one:

You ignored my question about dependencies:

https://lore.kernel.org/all/[email protected]/

so I've no idea if it's safe to apply or if other people might need this
one patch from the middle of the series.

> 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
>
> Nikita Shubin (1):
> ep93xx: clock: convert in-place to COMMON_CLK
>
>
> ... which claims to merge both "ASoC: cirrus: i2s: Prepare clock before using it"
> and "ep93xx: clock: convert in-place to COMMON_CLK", but they are actually not
> merged.

No, it doesn't - that's the cover letter from your series.

> Could you please consider ASoC patch, while I will resubmit the final clock conversion?

So please answer my question then: what's the story with dependencies?


Attachments:
(No filename) (1.21 kB)
signature.asc (499.00 B)
Download all attachments