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


Groups > linux.kernel > #1396190 > unrolled thread

Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701

Started byStephen Boyd <sboyd@codeaurora.org>
First post2016-05-07 01:20 +0200
Last post2016-05-11 05:00 +0200
Articles 5 — 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

  Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701 Stephen Boyd <sboyd@codeaurora.org> - 2016-05-07 01:20 +0200
    Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701 James Liao <jamesjj.liao@mediatek.com> - 2016-05-09 07:50 +0200
      Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701 Stephen Boyd <sboyd@codeaurora.org> - 2016-05-10 00:20 +0200
        Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701 James Liao <jamesjj.liao@mediatek.com> - 2016-05-10 04:30 +0200
        Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701 James Liao <jamesjj.liao@mediatek.com> - 2016-05-11 05:00 +0200

#1396190 — Re: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-05-07 01:20 +0200
SubjectRe: [PATCH v7 7/9] clk: mediatek: Enable critical clocks for MT2701
Message-ID<rvXcn-6kA-37@gated-at.bofh.it>
On 04/14, James Liao wrote:
> Some system clocks should be turned on by default on MT2701.
> This patch enable these clocks when related clocks have
> been registered.
> 
> Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> ---

critical clks got merged now (sorry I'm slowly getting back to
looking at patches). Please use that flag.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [next] | [standalone]


#1396599

FromJames Liao <jamesjj.liao@mediatek.com>
Date2016-05-09 07:50 +0200
Message-ID<rwMeR-6hQ-1@gated-at.bofh.it>
In reply to#1396190
Hi Stephen,

On Fri, 2016-05-06 at 16:12 -0700, Stephen Boyd wrote:
> On 04/14, James Liao wrote:
> > Some system clocks should be turned on by default on MT2701.
> > This patch enable these clocks when related clocks have
> > been registered.
> > 
> > Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> > ---
> 
> critical clks got merged now (sorry I'm slowly getting back to
> looking at patches). Please use that flag.

I don't see critical clock support in v4.6-rc7. Is there a repo/branch
that has critical clocks merged?


Best regards,

James

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


#1397462

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-05-10 00:20 +0200
Message-ID<rx1GW-6f0-19@gated-at.bofh.it>
In reply to#1396599
On 05/09, James Liao wrote:
> Hi Stephen,
> 
> On Fri, 2016-05-06 at 16:12 -0700, Stephen Boyd wrote:
> > On 04/14, James Liao wrote:
> > > Some system clocks should be turned on by default on MT2701.
> > > This patch enable these clocks when related clocks have
> > > been registered.
> > > 
> > > Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> > > ---
> > 
> > critical clks got merged now (sorry I'm slowly getting back to
> > looking at patches). Please use that flag.
> 
> I don't see critical clock support in v4.6-rc7. Is there a repo/branch
> that has critical clocks merged?
> 

Right, it's in clk-next in the clk tree.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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


#1397644

FromJames Liao <jamesjj.liao@mediatek.com>
Date2016-05-10 04:30 +0200
Message-ID<rx5AS-1xE-7@gated-at.bofh.it>
In reply to#1397462
On Mon, 2016-05-09 at 15:13 -0700, Stephen Boyd wrote:
> On 05/09, James Liao wrote:
> > Hi Stephen,
> > 
> > On Fri, 2016-05-06 at 16:12 -0700, Stephen Boyd wrote:
> > > On 04/14, James Liao wrote:
> > > > Some system clocks should be turned on by default on MT2701.
> > > > This patch enable these clocks when related clocks have
> > > > been registered.
> > > > 
> > > > Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> > > > ---
> > > 
> > > critical clks got merged now (sorry I'm slowly getting back to
> > > looking at patches). Please use that flag.
> > 
> > I don't see critical clock support in v4.6-rc7. Is there a repo/branch
> > that has critical clocks merged?
> > 
> 
> Right, it's in clk-next in the clk tree.

I got it. I'll try to use the new critical clock support.


Best regards,

James

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


#1398649

FromJames Liao <jamesjj.liao@mediatek.com>
Date2016-05-11 05:00 +0200
Message-ID<rxsxs-7Dd-7@gated-at.bofh.it>
In reply to#1397462
Hi Stephen, Mike, Lee,

On Mon, 2016-05-09 at 15:13 -0700, Stephen Boyd wrote:
> On 05/09, James Liao wrote:
> > Hi Stephen,
> > 
> > On Fri, 2016-05-06 at 16:12 -0700, Stephen Boyd wrote:
> > > On 04/14, James Liao wrote:
> > > > Some system clocks should be turned on by default on MT2701.
> > > > This patch enable these clocks when related clocks have
> > > > been registered.
> > > > 
> > > > Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
> > > > ---
> > > 
> > > critical clks got merged now (sorry I'm slowly getting back to
> > > looking at patches). Please use that flag.
> > 
> > I don't see critical clock support in v4.6-rc7. Is there a repo/branch
> > that has critical clocks merged?
> > 
> 
> Right, it's in clk-next in the clk tree.

I got the latest code from clk-next and tried to use CLK_IS_CRITICAL fro
critical clocks. But There is something wrong with CLK_IS_CRITICAL. For
example, if we set vdec_sel as a critical clock, we'll get the following
result:

    vdecpll                               0            0
       vdecpll_ck                         1            1
          vdec_sel                        1            1

vdec_sel and vdecpll_ck are TOPCKGEN clocks. vdecpll is a APMIXEDSYS
PLL, which will be registered after TOPCKGEN clocks. The prepare and
enable count are incorrect in this case.

We may need to prepare/enable a parent clock if an enabled orphan clock
re-parent to it. I tried the following modification and it can resolve
this issue. But I'm not sure it's a correct place to enable parent
clcoks. May I have your comment on this?

------------------------------------------------------------
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ce39add..db1bc3a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2388,8 +2388,15 @@ static int __clk_core_init(struct clk_core *core)
        hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list,
child_node) {
                struct clk_core *parent = __clk_init_parent(orphan);

-               if (parent)
+               if (parent) {
                        clk_core_reparent(orphan, parent);
+
+                       if (orphan->prepare_count)
+                               clk_core_prepare(parent);
+
+                       if (orphan->enable_count )
+                               clk_core_enable(parent);
+               }
        }

        /*
------------------------------------------------------------


Best regards,

James

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web