Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1433085
| From | Andi Shyti <andi@etezian.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] clk: clk-rk3*: set CLK_IS_CRITICAL flag to critical clocks |
| Date | 2016-06-28 18:10 +0200 |
| Message-ID | <rP3Kh-Rj-5@gated-at.bofh.it> (permalink) |
| References | <rP2uR-8ng-7@gated-at.bofh.it> <rP2uR-8ng-23@gated-at.bofh.it> <rP2XT-kK-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Heiko,
> > RK2928_CLKSEL_CON(0), 14, 2, MFLAGS, 8, 5, DFLAGS),
> > - GATE(ACLK_CPU, "aclk_cpu", "aclk_cpu_src", CLK_IGNORE_UNUSED,
> > + GATE(ACLK_CPU, "aclk_cpu", "aclk_cpu_src",
> > + CLK_IS_CRITICAL | CLK_IGNORE_UNUSED,
>
> - you'll never need both critical and ignore_unused
Indeed I was unsure whether I should remove the
CLK_IGNORE_UNUSED, but then I decided to leave it because that's
basically what the driver is currently doing. Thanks!
> Happens in some more cases below, but otherwise looks ok ... as written in
> the cover-letter I'm just still trying to make up my mind if it's worth
> waiting for the handoff mechanism.
You mean something similar (*)?
Thanks,
Andi
(*)
@@ -2403,7 +2407,7 @@ static int __clk_core_init(struct clk_core *core)
if (core->ops->init)
core->ops->init(core->hw);
- if (core->flags & CLK_IS_CRITICAL) {
+ if (core->flags & CLK_IS_CRITICAL || core->flags & CLK_HANDOFF) {
unsigned long flags;
clk_core_prepare(core);
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 89cc700..5698ef1 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -201,11 +201,19 @@ struct clk *clk_get(struct device *dev, const char *con_id)
if (dev) {
clk = __of_clk_get_by_name(dev->of_node, dev_id, con_id);
- if (!IS_ERR(clk) || PTR_ERR(clk) == -EPROBE_DEFER)
+ if (!IS_ERR(clk)) {
+ clk->clk_core->flags &= ~CLK_HANDOFF;
+ return clk;
+ }
+ if (PTR_ERR(clk) == -EPROBE_DEFER)
return clk;
}
- return clk_get_sys(dev_id, con_id);
+ clk = clk_get_sys(dev_id, con_id);
+ if (!IS_ERR(clk))
+ clk->clk_core->flags &= ~CLK_HANDOFF;
+
+ return clk;
}
EXPORT_SYMBOL(clk_get);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index fb39d5a..39684ec 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -33,6 +33,7 @@
#define CLK_RECALC_NEW_RATES BIT(9) /* recalc rates after notifications */
#define CLK_SET_RATE_UNGATE BIT(10) /* clock needs to run to set rate */
#define CLK_IS_CRITICAL BIT(11) /* do not gate, ever */
+#define CLK_HANDOFF BIT(12) /* do not gate, ever */
struct clk;
struct clk_hw;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] clk: clk-rk3*: set CLK_IS_CRITICAL flag to critical clocks andi.shyti@gmail.com - 2016-06-28 16:50 +0200
Re: [PATCH 1/2] clk: clk-rk3*: set CLK_IS_CRITICAL flag to critical clocks Heiko Stuebner <heiko@sntech.de> - 2016-06-28 17:20 +0200
Re: [PATCH 1/2] clk: clk-rk3*: set CLK_IS_CRITICAL flag to critical clocks Andi Shyti <andi@etezian.org> - 2016-06-28 18:10 +0200
Re: [PATCH 1/2] clk: clk-rk3*: set CLK_IS_CRITICAL flag to critical clocks Heiko Stuebner <heiko@sntech.de> - 2016-06-28 18:40 +0200
csiph-web