All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dong Aisheng <dongas86@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Dong Aisheng <aisheng.dong@nxp.com>,
	linux-clk <linux-clk@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Mark Brown <broonie@kernel.org>,
	yibin.gong@nxp.com, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	anson.huang@nxp.com, ping.bai@nxp.com, leonard.crestez@nxp.com,
	octavian.purdila@nxp.com
Subject: Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories
Date: Sat, 15 Apr 2017 00:14:55 +0800	[thread overview]
Message-ID: <20170414161455.GE1792@b29396-OptiPlex-7040> (raw)
In-Reply-To: <CAMuHMdXuuHmjWCrLa7r8xK=Dgad9Cz9C6xibJPRVud6aq4oHxQ@mail.gmail.com>

Hi Geert,

On Thu, Apr 13, 2017 at 09:56:31PM +0200, Geert Uytterhoeven wrote:
> On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng <aisheng.dong@nxp.com> wrote:
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk)
> >  }
> >  EXPORT_SYMBOL_GPL(clk_unprepare);
> >
> > +/**
> > + * clk_bulk_unprepare - undo preparation of a bulk of clock sources
> > + * @num_clks: the number of clk_bulk_data
> > + * @clks: the clk_bulk_data table being ungated
> > + *
> > + * clk_bulk_unprepare may sleep, which differentiates it from clk_bulk_disable.
> > + * Returns 0 on success, -EERROR otherwise.
> > + */
> > +void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks)
> 
> unsigned int num_clks (everywhere)
> 
> > +{
> > +       int i;
> 
> unsigned int i (everywhere)

Any special purpose?

Looks like 'int i' for a loop is widely used in kernel.

Would you please help clarify more?

> > +
> > +       for (i = 0; i < num_clks; i++)
> > +               clk_unprepare(clks[i].clk);
> > +}
> > +EXPORT_SYMBOL_GPL(clk_bulk_unprepare);
> 
> This does mean you have to change your "while (--i >= 0)" loops.

Is that really necessary as i thought the clk_bulk_get/put does not
guarantee any clk operation orders within the bulk?
Should we need add that support?

And currently this does the same thing as bulk regulator.

Regards
Dong Aisheng

WARNING: multiple messages have this Message-ID (diff)
From: dongas86@gmail.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/3] clk: add clk_bulk_get accessories
Date: Sat, 15 Apr 2017 00:14:55 +0800	[thread overview]
Message-ID: <20170414161455.GE1792@b29396-OptiPlex-7040> (raw)
In-Reply-To: <CAMuHMdXuuHmjWCrLa7r8xK=Dgad9Cz9C6xibJPRVud6aq4oHxQ@mail.gmail.com>

Hi Geert,

On Thu, Apr 13, 2017 at 09:56:31PM +0200, Geert Uytterhoeven wrote:
> On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng <aisheng.dong@nxp.com> wrote:
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk)
> >  }
> >  EXPORT_SYMBOL_GPL(clk_unprepare);
> >
> > +/**
> > + * clk_bulk_unprepare - undo preparation of a bulk of clock sources
> > + * @num_clks: the number of clk_bulk_data
> > + * @clks: the clk_bulk_data table being ungated
> > + *
> > + * clk_bulk_unprepare may sleep, which differentiates it from clk_bulk_disable.
> > + * Returns 0 on success, -EERROR otherwise.
> > + */
> > +void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks)
> 
> unsigned int num_clks (everywhere)
> 
> > +{
> > +       int i;
> 
> unsigned int i (everywhere)

Any special purpose?

Looks like 'int i' for a loop is widely used in kernel.

Would you please help clarify more?

> > +
> > +       for (i = 0; i < num_clks; i++)
> > +               clk_unprepare(clks[i].clk);
> > +}
> > +EXPORT_SYMBOL_GPL(clk_bulk_unprepare);
> 
> This does mean you have to change your "while (--i >= 0)" loops.

Is that really necessary as i thought the clk_bulk_get/put does not
guarantee any clk operation orders within the bulk?
Should we need add that support?

And currently this does the same thing as bulk regulator.

Regards
Dong Aisheng

  reply	other threads:[~2017-04-14 16:15 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  4:03 [RFC PATCH 0/3] clk: introduce clk_bulk_get accessories Dong Aisheng
2017-04-12  4:03 ` Dong Aisheng
2017-04-11 17:01 ` Florian Fainelli
2017-04-11 17:01   ` Florian Fainelli
2017-04-13 13:58   ` Dong Aisheng
2017-04-13 13:58     ` Dong Aisheng
2017-04-12  4:03 ` [RFC PATCH 1/3] clk: add " Dong Aisheng
2017-04-12  4:03   ` Dong Aisheng
2017-04-11 17:19   ` Leonard Crestez
2017-04-11 17:19     ` Leonard Crestez
2017-04-13 14:02     ` Dong Aisheng
2017-04-13 14:02       ` Dong Aisheng
2017-04-13 19:57     ` Geert Uytterhoeven
2017-04-13 19:57       ` Geert Uytterhoeven
2017-04-13 19:57       ` Geert Uytterhoeven
2017-04-13 14:25   ` Dong Aisheng
2017-04-13 14:25     ` Dong Aisheng
2017-04-13 19:56   ` Geert Uytterhoeven
2017-04-13 19:56     ` Geert Uytterhoeven
2017-04-13 19:56     ` Geert Uytterhoeven
2017-04-14 16:14     ` Dong Aisheng [this message]
2017-04-14 16:14       ` Dong Aisheng
2017-04-14 16:14       ` Dong Aisheng
2017-04-22  3:16   ` Stephen Boyd
2017-04-22  3:16     ` Stephen Boyd
2017-05-08 11:34     ` Dong Aisheng
2017-05-08 11:34       ` Dong Aisheng
2017-04-12  4:03 ` [RFC PATCH 2/3] clk: add managed version of clk_bulk_get Dong Aisheng
2017-04-12  4:03   ` Dong Aisheng
2017-04-13 14:37   ` Dong Aisheng
2017-04-13 14:37     ` Dong Aisheng
2017-04-22  2:58     ` Stephen Boyd
2017-04-22  2:58       ` Stephen Boyd
2017-05-08 11:41       ` Dong Aisheng
2017-05-08 11:41         ` Dong Aisheng
2017-04-22  2:55   ` Stephen Boyd
2017-04-22  2:55     ` Stephen Boyd
2017-05-08 11:37     ` Dong Aisheng
2017-05-08 11:37       ` Dong Aisheng
2017-04-12  4:03 ` [RFC PATCH 3/3] cpufreq: imx6q: refine clk operations Dong Aisheng
2017-04-12  4:03   ` Dong Aisheng
2017-04-11 17:48   ` Leonard Crestez
2017-04-11 17:48     ` Leonard Crestez
2017-04-13 14:21     ` Dong Aisheng
2017-04-13 14:21       ` Dong Aisheng
2017-04-22  3:04 ` [RFC PATCH 0/3] clk: introduce clk_bulk_get accessories Stephen Boyd
2017-04-22  3:04   ` Stephen Boyd
2017-05-08 11:07   ` Dong Aisheng
2017-05-08 11:07     ` Dong Aisheng

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=20170414161455.GE1792@b29396-OptiPlex-7040 \
    --to=dongas86@gmail.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=geert@linux-m68k.org \
    --cc=kernel@pengutronix.de \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=octavian.purdila@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=shawnguo@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=yibin.gong@nxp.com \
    /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.