[PATCH] clk: vexpress: Add separate SP810 driver

Mike Turquette mturquette at linaro.org
Mon Apr 22 13:27:58 EDT 2013


Quoting Pawel Moll (2013-04-22 07:34:39)
> On Mon, 2013-04-22 at 15:25 +0100, Russell King - ARM Linux wrote:
> > >         /* Switch the parent if necessary */
> > > -       if (old_parent != new_parent)
> > > +       if (old_parent != new_parent) {
> > > +               clk_prepare(new_parent);
> > >                 clk_set_parent(hw->clk, new_parent);
> > > +               clk_unprepare(old_parent);
> > > +       }
> > > 
> > > So, to summarize, the patch that works for me is below.
> > 
> > So what if the old parent clock wasn't prepared?
> 
> The clk_prepare() does __clk_prepare(clk->parent) before
> clk->ops->prepare(clk->kw), so the old_parent is always prepared.
> 

Yes, this hack is subtle.  The reparent operation happens within the
.prepare callback, so the old parent chain is implicitly prepared.

Regards,
Mike

> Paweł



More information about the linux-arm-kernel mailing list