All of lore.kernel.org
 help / color / mirror / Atom feed
From: shawn.guo@freescale.com (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx6: Fix procedure to switch the parent of LDB_DI_CLK
Date: Thu, 10 Apr 2014 10:44:38 +0800	[thread overview]
Message-ID: <20140410024436.GD2334@dragon> (raw)
In-Reply-To: <CAOMZO5Cj3yoY-Y+uD5XAW8tgyd3_Be-VCUEkEHh+gNjoKdF-6g@mail.gmail.com>

On Wed, Apr 09, 2014 at 10:55:44PM -0300, Fabio Estevam wrote:
> On Wed, Apr 9, 2014 at 10:21 PM, Shawn Guo <shawn.guo@freescale.com> wrote:
> 
> > For the record, here is my printk gives.
> ...
> > *** clk_register_mux: ldb_di0_sel
> > *** clk_register_mux: ldb_di1_sel
> 
> Ok, I ran it again and yes, I can see it now. Sorry for the previous
> wrong printk's.
> 
> >>
> >> >
> >> > Furthermore, some re-parenting happens in a way you may not be aware of.
> >> > See commit e366fdd (clk: clk-mux: implement remuxing on set_rate), for
> >> > example.
> >>
> >> This commit does not affect us as we pass the CLK_SET_RATE_NO_REPARENT flag.
> >
> > You did not get my point.  This is just an example, and we happen to set
> > this flag for now.  My point is that as long as you register a clk to
> > clock framework, you do not have a way to stop one from calling clk
> > API on the clock then.  This is how clk framework and API work, simple
> > as it is.
> 
> The issue that this patch wants to solve is that we need to perform
> this protection clock switching mechanism prior to doing the
> clk_set_parent for the ldb clocks.

You should fix .set_parent() of the clock then.

> 
> Putting a printk in clk_set_parent like this:
> 
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1719,6 +1719,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
>         if (!clk->ops)
>                 return -EINVAL;
> 
> +       pr_info(" *** Calling clk_set_parent for %s clock\n", clk->name);
> +
>         /* verify ops for for multi-parent clks */
>         if ((clk->num_parents > 1) && (!clk->ops->set_parent))
>                 return -ENOSYS;
> ,results in:
> 
>  *** Calling clk_set_parent for ldb_di0_sel clock
>  *** Calling clk_set_parent for ldb_di1_sel clock
>  *** Calling clk_set_parent for enfc_sel clock
>  *** Calling clk_set_parent for cko2_sel clock
>  *** Calling clk_set_parent for cko clock
>  *** Calling clk_set_parent for spdif_sel clock
>  *** Calling clk_set_parent for lvds1_sel clock
>  *** Calling clk_set_parent for ipu1_di0_sel clock
> 
> Which shows that there is only one clk_set_parent being called for the
> ldb_di clocks and this one is in clk-mx6q.c.
> 
> So it is safe to perform this workaround in clk-imx6q.c.
> 
> Don't you agree?

I disagree.  It's only safe for now.  How do you prevent the new
clk_set_parent() call on the clock in the future.  This is not something
that we can maintain.

Shawn

  reply	other threads:[~2014-04-10  2:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 11:55 [PATCH] ARM: imx6: Fix procedure to switch the parent of LDB_DI_CLK Fabio Estevam
2014-04-09 13:34 ` Shawn Guo
2014-04-09 14:20   ` Fabio Estevam
2014-04-09 14:59     ` Shawn Guo
2014-04-09 15:28       ` Fabio Estevam
2014-04-10  1:21         ` Shawn Guo
2014-04-10  1:55           ` Fabio Estevam
2014-04-10  2:44             ` Shawn Guo [this message]
2014-04-09 13:35 ` Christian Gmeiner
2014-05-19  7:22 ` Dirk Behme
2014-05-19 17:07   ` Ranjani.Vaidyanathan at freescale.com
2014-05-19  9:25 ` Lothar Waßmann
2014-06-04 16:37 ` Dirk Behme
2014-06-04 17:29   ` Ranjani.Vaidyanathan at freescale.com
2014-06-04 17:49     ` Dirk Behme
2014-06-05 16:26       ` Ranjani.Vaidyanathan at freescale.com
2014-06-05 15:56     ` Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140410024436.GD2334@dragon \
    --to=shawn.guo@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.