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: <alpine.LFD.2.00.1102070908120.14920@xanadu.home>
Date:	Mon, 7 Feb 2011 09:24:58 -0500 (EST)
From:	Nicolas Pitre <nicolas.pitre@...aro.org>
To:	Jeremy Kerr <jeremy.kerr@...onical.com>
cc:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	linux-sh@...r.kernel.org,
	Ben Herrenschmidt <benh@...nel.crashing.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Paul Mundt <lethal@...ux-sh.org>,
	Dima Zavin <dmitriyz@...gle.com>,
	Saravana Kannan <skannan@...eaurora.org>,
	Ben Dooks <ben-linux@...ff.org>,
	Russell King <linux@....linux.org.uk>
Subject: Re: [RFC, PATCH 3/3] clk: add warnings for incorrect enable/prepare
 semantics

On Mon, 7 Feb 2011, Jeremy Kerr wrote:

> Hi Uwe,
> 
> > This implies the warning is only issued on clocks that have a prepare
> > callback.  If we want to enforce the new API the warning here shouldn't
> > depend on clk->ops->prepare.  (clk_prepare and clk_unprepare need to
> > be changed then to adapt the prepare_count even in the absence of
> > clk->ops->prepare.)
> 
> Yeah, it's a decision about either adding a small cost to all clk_prepare()s 
> (ie, adding cost when there is no prepare callback), or checking for the 
> correct prepare/enable semantics for all clocks (even when it doesn't matter 
> for that particular clock). I chose the first as more important, but happy to 
> go either way here.

The prepare method being called from non-atomic context cannot be 
considered to be in a speed critical path.  Most of the time, this is 
going to be called on driver initialization or the like, and that's a 
relatively rare event. Therefore this really small cost to clk_prepare() 
is definitively worth it to help proper usage of the API.  If this ever 
becomes a problem then this could be confined to some CONFIG_CLK_DEBUG 
or the like.  But when introducing a new API it is best to be more 
strict to help people get its usage right (without going overboard with 
it of course).


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