Skip to content

Commit d31fd43

Browse files
Carlo Caionebebarino
authored andcommitted
clk: x86: Do not gate clocks enabled by the firmware
Read the enable register to determine if the clock is already in use by the firmware. In this case avoid gating the clock. Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Darren Hart (VMware) <dvhart@infradead.org> Signed-off-by: Carlo Caione <carlo@endlessm.com> Fixes: 282a4e4 ("platform/x86: Enable Atom PMC platform clocks") Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
1 parent f905293 commit d31fd43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/clk/x86/clk-pmc-atom.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
186186
pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
187187
spin_lock_init(&pclk->lock);
188188

189+
/*
190+
* If the clock was already enabled by the firmware mark it as critical
191+
* to avoid it being gated by the clock framework if no driver owns it.
192+
*/
193+
if (plt_clk_is_enabled(&pclk->hw))
194+
init.flags |= CLK_IS_CRITICAL;
195+
189196
ret = devm_clk_hw_register(&pdev->dev, &pclk->hw);
190197
if (ret) {
191198
pclk = ERR_PTR(ret);

0 commit comments

Comments
 (0)