lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111017064217.GA20184@b20223-02.ap.freescale.net>
Date:	Mon, 17 Oct 2011 14:42:19 +0800
From:	Richard Zhao <richard.zhao@...aro.org>
To:	Sascha Hauer <s.hauer@...gutronix.de>
CC:	"Turquette, Mike" <mturquette@...com>,
	<linaro-dev@...ts.linaro.org>, <eric.miao@...aro.org>,
	<grant.likely@...retlab.ca>, Jamie Iles <jamie@...ieiles.com>,
	<jeremy.kerr@...onical.com>, <sboyd@...inc.com>,
	<linux@....linux.org.uk>, <magnus.damm@...il.com>,
	<dsaxena@...aro.org>, <shawn.guo@...escale.com>,
	<arnd.bergmann@...aro.org>, <patches@...aro.org>,
	<tglx@...utronix.de>, <linux-arm-kernel@...ts.infradead.org>,
	<paul@...an.com>, <linus.walleij@...ricsson.com>,
	<broonie@...nsource.wolfsonmicro.com>,
	<linux-kernel@...r.kernel.org>, <amit.kucheria@...aro.org>,
	Richard Zhao <richard.zhao@...escale.com>,
	<skannan@...cinc.com>
Subject: Re: [PATCH v2 4/7] clk: Add simple gated clock

On Sun, Oct 16, 2011 at 08:26:49PM +0200, Sascha Hauer wrote:
> On Wed, Oct 12, 2011 at 07:59:19AM -0700, Turquette, Mike wrote:
> > On Tue, Oct 11, 2011 at 11:46 PM, Richard Zhao
> > <richard.zhao@...escale.com> wrote:
> > > On Thu, Sep 22, 2011 at 03:26:59PM -0700, Mike Turquette wrote:
> > >> From: Jeremy Kerr <jeremy.kerr@...onical.com>
> > >>
> > >> Signed-off-by: Jeremy Kerr <jeremy.kerr@...onical.com>
> > >> Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
> > >> Signed-off-by: Jamie Iles <jamie@...ieiles.com>
> > >> Signed-off-by: Mike Turquette <mturquette@...com>
> > >> ---
> > >> Changes since v1:
> > >> Add copyright header
> > >> Fold in Jamie's patch for set-to-disable clks
> > >> Use BIT macro instead of shift
> > >>
> > >>  drivers/clk/Kconfig    |    4 ++
> > >>  drivers/clk/Makefile   |    1 +
> > >>  drivers/clk/clk-gate.c |   78 ++++++++++++++++++++++++++++++++++++++++++++++++
> > >>  include/linux/clk.h    |   13 ++++++++
> > >>  4 files changed, 96 insertions(+), 0 deletions(-)
> > >>  create mode 100644 drivers/clk/clk-gate.c
> > >
> > > I feel hard to tell the tree the clk parent, at register/init time. For the
> > > simple gate clk, the only way is to set .get_parent. But normally, for clk
> > > without any divider we set .get_parent to NULL. Maybe we can put .parent to
> > > struct clk_hw?
> > 
> > For non-mux clocks, whose parent is *always* going to be the same, you
> > should create a duplicate .parent in the clk_hw_* structure and then
> > have .get_parent return clk_hw_*->parent.
> 
> Maybe I do not understand what you mean here, but I think there is
> something missing in the gate.
yes, clk_gate can not set fixed parent in v2 patch. Mike means add .parent int clk_gate
and set .get_parent in the ops.
> 
> > 
> > This is analogous to the way clk_hw_fixed returns clk_hw_fixed->rate
> > when .recalc is called on it.
> > 
> > >> +
> > >> +static unsigned long clk_gate_get_rate(struct clk_hw *clk)
> > >> +{
> > >> +     return clk_get_rate(clk_get_parent(clk->clk));
> > >> +}
> 
> clk_get_parent goes down to clk_gate_set_enable_ops.get_parent below...
> 
> > >> +
> > >> +
> > >> +struct clk_hw_ops clk_gate_set_enable_ops = {
> > >> +     .recalc_rate = clk_gate_get_rate,
> > >> +     .enable = clk_gate_enable_set,
> > >> +     .disable = clk_gate_disable_clear,
> > >> +};
> 
> ...but this does not have a get_parent pointer, so clk_get_parent()
> for a gate always returns NULL which means that a gate never has
> a valid rate.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ