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]
Date:	Fri, 20 May 2011 15:36:08 +0200
From:	Sascha Hauer <s.hauer@...gutronix.de>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Jeremy Kerr <jeremy.kerr@...onical.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-sh@...r.kernel.org
Subject: Re: [PATCH 1/4] clk: Add a generic clock infrastructure

On Fri, May 20, 2011 at 03:25:24PM +0200, Thomas Gleixner wrote:
> On Fri, 20 May 2011, Sascha Hauer wrote:
> 
> > Hi Jeremy,
> > 
> > Nice to see progress in this area :)
> > 
> > On Fri, May 20, 2011 at 03:27:49PM +0800, Jeremy Kerr wrote:
> > > +
> > > +struct clk *clk_register(struct clk_hw_ops *ops, struct clk_hw *hw,
> > > +		const char *name)
> > > +{
> > > +	struct clk *clk;
> > > +
> > > +	clk = kzalloc(sizeof(*clk), GFP_KERNEL);
> > > +	if (!clk)
> > > +		return NULL;
> > > +
> > > +	clk->name = name;
> > > +	clk->ops = ops;
> > > +	clk->hw = hw;
> > > +	hw->clk = clk;
> > 
> > is it worth to add a CLK_REGISTERED flag here? Up to now clocks do not
> > have to be registered at all and the registering might be forgotten for
> > some clocks. I suppose funny things can happen when we operate on
> > unregistered clocks.
> 
> No, because not registered clocks are not accessible :)

D'oh :)

> 
>  > +
> > > +	/* Query the hardware for parent and initial rate */
> > > +
> > > +	if (clk->ops->get_parent)
> > > +		/* We don't to lock against prepare/enable here, as
> > > +		 * the clock is not yet accessible from anywhere */
> > > +		clk->parent = clk->ops->get_parent(clk->hw);
> > > +
> > > +	if (clk->ops->recalc_rate)
> > > +		clk->rate = clk->ops->recalc_rate(clk->hw);
> > 
> > This implicitely requires that we never register a clock before its
> > parent is registered. This makes perfect sense but I think we should
> > catch it here when the user tries to register a clock with a not yet
> > registered parent.
> 
> We can agree on that, but we can make it more clever than that.

Great.

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 |
--
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