Re: [PATCH 02/16] clk: sunxi-ng: Add common infrastructure

Maxime Ripard
2016-05-16T20:15:09Z

[-- Attachment #1: Type: text/plain, Size: 1363 bytes --]

Hi Jean-Francois,

On Mon, May 16, 2016 at 10:02:39AM +0200, Jean-Francois Moine wrote:
> On Sun, 15 May 2016 20:31:22 +0200
> Maxime Ripard <maxime.ripard@free-electrons.com> wrote:
>
> > > > +void ccu_helper_wait_for_lock(struct ccu_common *common, u32 lock)
> > > > +{
> > > > + u32 reg;
> > > > +
> > > > + if (!(common->features & CCU_FEATURE_LOCK))
> > > > + return;
> > > > +
> > > > + WARN_ON(readl_relaxed_poll_timeout(common->base + common->reg, reg,
> > > > + !(reg & lock), 0, 500));
> > >
> > > no delay between reads? ^
> >
> > Yes, I intended it to be a simple busy waiting loop since I don't
> > expect it to be very long. Do yu have any more data on how much time
> > it usually takes?
>
> I have a Soc in which the rate of the audio clock is stable after a
> good second.

You mean before the clock is actually stable, or before the lock bit
is cleared?

Which SoC is it? As far as I've seen, only the H3 allows to configure
the stable time, and while by default it will take 16us, you can
configure as high as 66ms (which is still way higher than the current
limit).

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]