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:	Thu, 3 Jun 2010 12:05:33 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Jeremy Kerr <jeremy.kerr@...onical.com>
Cc:	Ben Dooks <ben-linux@...ff.org>,
	Ben Herrenchmidt <benh@...nel.crashing.org>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC,PATCH 1/2] Add a common struct clk

On Thu, Jun 03, 2010 at 06:24:50PM +0800, Jeremy Kerr wrote:
> OK, this would mean adding parent to struct clk:
> 
> struct clk {
> 	struct clk_operations	*ops;
> 	atomic_t				enable_count;

I don't think it makes sense for this to be an atomic type.

> static inline int clk_enable(struct clk *clk)
> {
> 	int ret;
> 
> 	if (atomic_inc(clk->enable_count) != 1))
> 		return 0;

Okay, so what if we sleep at this point, and someone else comes along
and calls clk_enable(), which'll merely increment the count and return.

Unfortunately, the clock is still disabled at that point - which is a
violation of what's supposed to happen.

Or to put it another way, the above method results in clk_enable()
sometimes returning with the clock enabled and sometimes with the
clock still disabled.

That's not nice behaviour for drivers which may need the clock enabled
to read/write the device registers.
--
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