All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Rajendra Nayak <rnayak@codeaurora.org>
Cc: mturquette@baylibre.com, linux-clk@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	tdas@codeaurora.org
Subject: Re: [PATCH v3 10/11] clk: Add clk_hw_get_clk() helper API to be used by clk providers
Date: Thu, 3 Nov 2016 12:46:13 -0700	[thread overview]
Message-ID: <20161103194613.GX16026@codeaurora.org> (raw)
In-Reply-To: <581AF698.2030906@codeaurora.org>

On 11/03, Rajendra Nayak wrote:
> 
> 
> On 11/03/2016 03:52 AM, Stephen Boyd wrote:
> > On 09/29, Rajendra Nayak wrote:
> >> Add a helper API that will allow clk providers to turn their clk_hw
> >> structures into struct clk pointer.
> >>
> > 
> > Did I suggest this?
> 
> I did this back when you suggested we store clk_hw's for all
> clocks associated with a gdsc instead of extracting them from
> the clients device tree node.
> 
> > 
> >> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> >> ---
> >>  drivers/clk/clk.c            | 6 ++++++
> >>  include/linux/clk-provider.h | 1 +
> >>  2 files changed, 7 insertions(+)
> >>
> >> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> >> index 820a939..a084132 100644
> >> --- a/drivers/clk/clk.c
> >> +++ b/drivers/clk/clk.c
> >> @@ -186,6 +186,12 @@ const char *clk_hw_get_name(const struct clk_hw *hw)
> >>  }
> >>  EXPORT_SYMBOL_GPL(clk_hw_get_name);
> >>  
> >> +struct clk *clk_hw_get_clk(const struct clk_hw *hw)
> >> +{
> >> +	return hw->clk;
> > 
> > I'd prefer we actually went through all the work and actually
> > allocated another clk structure here. We can add another string
> > or two for the dev_id and con_id too for debug/accouting
> > purposes.
> 
> I don't quite get the part of allocating another clk structure,
> can you please elaborate?
> 

With "per-user" clks we want to have accounting for all the
struct clk consumers of a particular clk_hw instance. Given that
this function lets someone get a clk pointer from a clk_hw
structure, we want to make it follow the same "per-user"
accounting that we already have for each time the call is made.

Also, we want to make sure callers call clk_put() on the clk when
they're done with it. If we don't allocate a new one here that
clk_put() will destroy the one we allocate and assign during
registration time.

So I'm saying we want a wrapper to __clk_create_clk() for clk
providers to use to generate a clk pointer if needed.

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

  reply	other threads:[~2016-11-03 19:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29  8:35 [PATCH v3 00/11] clk: qcom: PLL updates Rajendra Nayak
2016-09-29  8:35 ` [PATCH v3 01/11] clk: qcom: Add support for alpha pll hwfsm ops Rajendra Nayak
2016-11-02 21:51   ` Stephen Boyd
2016-09-29  8:35 ` [PATCH v3 02/11] clk: qcom: Add support to initialize alpha plls Rajendra Nayak
2016-11-02 21:51   ` Stephen Boyd
2016-09-29  8:35 ` [PATCH v3 03/11] clk: qcom: handle alpha PLLs with 16bit alpha val registers Rajendra Nayak
2016-11-02 21:51   ` Stephen Boyd
2016-09-29  8:35 ` [PATCH v3 04/11] clk: qcom: Enable FSM mode for votable alpha PLLs Rajendra Nayak
2016-11-02 21:51   ` Stephen Boyd
2016-09-29  8:35 ` [PATCH v3 05/11] clk: qcom: Add .is_enabled ops for clk-alpha-pll Rajendra Nayak
2016-11-02 21:51   ` Stephen Boyd
2016-09-29  8:35 ` [PATCH v3 06/11] clk: qcom: Fix .set_rate to handle alpha PLLs w/wo dynamic update Rajendra Nayak
2016-11-02 21:54   ` Stephen Boyd
2016-11-03  8:28     ` Rajendra Nayak
2016-11-03 19:48       ` Stephen Boyd
2016-09-29  8:35 ` [PATCH v3 07/11] clk: qcom: support dynamic update using latched interface Rajendra Nayak
2016-09-29  8:35 ` [PATCH v3 08/11] clk: qcom: mmcc-8996: Add capability flags for some alpha PLLs Rajendra Nayak
2016-09-29  8:35 ` [PATCH v3 09/11] clk: qcom: Add support for table based lookups in clk-regmap-mux Rajendra Nayak
2016-09-29  8:35 ` [PATCH v3 10/11] clk: Add clk_hw_get_clk() helper API to be used by clk providers Rajendra Nayak
2016-11-02 22:22   ` Stephen Boyd
2016-11-03  8:34     ` Rajendra Nayak
2016-11-03 19:46       ` Stephen Boyd [this message]
2016-09-29  8:35 ` [RFC v3 11/11] clk: qcom: Add basic CPU clock driver for msm8996 Rajendra Nayak
2016-11-02 22:17   ` Stephen Boyd
2016-11-03  8:33     ` Rajendra Nayak

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=20161103194613.GX16026@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=rnayak@codeaurora.org \
    --cc=tdas@codeaurora.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.