]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: ti: clkctrl: Fix clkdm_clk handling
authorTony Lindgren <tony@atomide.com>
Mon, 6 May 2019 21:08:54 +0000 (14:08 -0700)
committerStephen Boyd <sboyd@kernel.org>
Tue, 21 May 2019 18:43:40 +0000 (11:43 -0700)
We need to always call clkdm_clk_enable() and clkdm_clk_disable() even
the clkctrl clock(s) enabled for the domain do not have any gate register
bits. Otherwise clockdomains may never get enabled except when devices get
probed with the legacy "ti,hwmods" devicetree property.

Fixes: 88a172526c32 ("clk: ti: add support for clkctrl clocks")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/ti/clkctrl.c

index 96d65a1cf7be15bbee8ac91e48562c27623c013d..8e834317c97d16a73e704e568cf97e31eae0a82d 100644 (file)
@@ -137,9 +137,6 @@ static int _omap4_clkctrl_clk_enable(struct clk_hw *hw)
        int ret;
        union omap4_timeout timeout = { 0 };
 
-       if (!clk->enable_bit)
-               return 0;
-
        if (clk->clkdm) {
                ret = ti_clk_ll_ops->clkdm_clk_enable(clk->clkdm, hw->clk);
                if (ret) {
@@ -151,6 +148,9 @@ static int _omap4_clkctrl_clk_enable(struct clk_hw *hw)
                }
        }
 
+       if (!clk->enable_bit)
+               return 0;
+
        val = ti_clk_ll_ops->clk_readl(&clk->enable_reg);
 
        val &= ~OMAP4_MODULEMODE_MASK;
@@ -179,7 +179,7 @@ static void _omap4_clkctrl_clk_disable(struct clk_hw *hw)
        union omap4_timeout timeout = { 0 };
 
        if (!clk->enable_bit)
-               return;
+               goto exit;
 
        val = ti_clk_ll_ops->clk_readl(&clk->enable_reg);