Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1582631 > unrolled thread

[PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init

Started byMichał Zegan <webczat@webczatnet.pl>
First post2017-02-16 16:00 +0100
Last post2017-02-17 20:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init Michał Zegan <webczat@webczatnet.pl> - 2017-02-16 16:00 +0100
    Re: [PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being  disabled on init Michał Zegan <webczat@webczatnet.pl> - 2017-02-17 20:50 +0100
    Re: [PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init Kevin Hilman <khilman@baylibre.com> - 2017-02-17 20:50 +0100

#1582631 — [PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init

FromMichał Zegan <webczat@webczatnet.pl>
Date2017-02-16 16:00 +0100
Subject[PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init
Message-ID<tbvHk-7E6-17@gated-at.bofh.it>
At the end of function meson_mmc_clk_init, the cfg_div clock was
prepared, enabled and configured, but then immediately disabled due to bogus if statements.
That made later calls to clk_disable_unprepare executed during module removal to fail with a kernel warning.
Fix that by changing the code to disable clock only when it failed to be configured.

Signed-off-by: Michał Zegan <webczat@webczatnet.pl>
---
 drivers/mmc/host/meson-gx-mmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 09739352834c..d444b6bfa02b 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -324,11 +324,12 @@ static int meson_mmc_clk_init(struct meson_host *host)
 	writel(cfg, host->regs + SD_EMMC_CFG);
 
 	ret = clk_prepare_enable(host->cfg_div_clk);
-	if (!ret)
+	if (!ret) {
 		ret = meson_mmc_clk_set(host, f_min);
 
-	if (!ret)
-		clk_disable_unprepare(host->cfg_div_clk);
+		if (ret)
+			clk_disable_unprepare(host->cfg_div_clk);
+	}
 
 	return ret;
 }
-- 
2.11.0

[toc] | [next] | [standalone]


#1583677 — Re: [PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init

FromMichał Zegan <webczat@webczatnet.pl>
Date2017-02-17 20:50 +0100
SubjectRe: [PATCH 1/2] mmc: meson-gx: prevent cfg_div_clk from being disabled on init
Message-ID<tbWHw-8v1-13@gated-at.bofh.it>
In reply to#1582631

W dniu 17.02.2017 o 20:44, Kevin Hilman pisze:
> Michał Zegan <webczat@webczatnet.pl> writes:
>
>> At the end of function meson_mmc_clk_init, the cfg_div clock was
>> prepared, enabled and configured, but then immediately disabled due to bogus if statements.
>> That made later calls to clk_disable_unprepare executed during module removal to fail with a kernel warning.
>> Fix that by changing the code to disable clock only when it failed to be configured.
>>
>> Signed-off-by: Michał Zegan <webczat@webczatnet.pl>
> I believe this one is not needed any more after Heiner's cleanups?
I think it is not needed, yes.
>
> Kevin

[toc] | [prev] | [next] | [standalone]


#1583680

FromKevin Hilman <khilman@baylibre.com>
Date2017-02-17 20:50 +0100
Message-ID<tbWHw-8v1-15@gated-at.bofh.it>
In reply to#1582631
Michał Zegan <webczat@webczatnet.pl> writes:

> At the end of function meson_mmc_clk_init, the cfg_div clock was
> prepared, enabled and configured, but then immediately disabled due to bogus if statements.
> That made later calls to clk_disable_unprepare executed during module removal to fail with a kernel warning.
> Fix that by changing the code to disable clock only when it failed to be configured.
>
> Signed-off-by: Michał Zegan <webczat@webczatnet.pl>

I believe this one is not needed any more after Heiner's cleanups?

Kevin

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web