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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51945DBF.60308@codeaurora.org>
Date:	Wed, 15 May 2013 21:17:03 -0700
From:	Saravana Kannan <skannan@...eaurora.org>
To:	Ulf Hansson <ulf.hansson@...aro.org>
CC:	linux-arm-kernel@...ts.infradead.org,
	Mike Turquette <mturquette@...aro.org>,
	Paul Walmsley <paul@...an.com>,
	Shawn Guo <shawn.guo@...escale.com>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Rob Herring <rob.herring@...xeda.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Russell King <linux@....linux.org.uk>,
	linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	Andrew Lunn <andrew@...n.ch>,
	Jeremy Kerr <jeremy.kerr@...onical.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Arnd Bergman <arnd.bergmann@...aro.org>,
	Jamie Iles <jamie@...ieiles.com>,
	Richard Zhao <richard.zhao@...aro.org>,
	Magnus Damm <magnus.damm@...il.com>,
	Linus Walleij <linus.walleij@...ricsson.com>,
	Stephen Boyd <sboyd@...eaurora.org>,
	Amit Kucheria <amit.kucheria@...aro.org>,
	Deepak Saxena <dsaxena@...aro.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Tomasz Figa <tomasz.figa@...il.com>
Subject: Re: [PATCH] clk: Fix race condition between clk_set_parent and clk_enable()

On 05/15/2013 12:24 PM, Ulf Hansson wrote:
> On 1 May 2013 06:42, Saravana Kannan <skannan@...eaurora.org> wrote:

<snip>

>> -       /* migrate prepare */
>> -       if (clk->prepare_count)
>> +       /*
>> +        * Migrate prepare state between parents and prevent race with
>> +        * clk_enable().
>> +        *
>> +        * If the clock is not prepared, then a race with
>> +        * clk_enable/disable() is impossible since we already have the
>> +        * prepare lock (future calls to clk_enable() need to be preceded by
>> +        * a clk_prepare()).
>> +        *
>> +        * If the clock is prepared, migrate the prepared state to the new
>> +        * parent and also protect against a race with clk_enable() by
>> +        * forcing the clock and the new parent on.  This ensures that all
>> +        * future calls to clk_enable() are practically NOPs with respect to
>> +        * hardware and software states.
>> +        */
>
> Maybe an additional note about that since CLK_SET_PARENT_GATE is a
> prerequisite for doing migration of "prepare", we also interpreted
> this flags as it is acceptable to enable the clock(s) in this context.

Done. Sent v2 patch.

<snip>

>
> Looks good! Thanks for having another round to fixup this kind of
> tricky code. :-)

Thanks :-)

> Acked-by: Ulf Hansson <ulf.hansson@...aro.org>
>

Thanks again.

-Saravana

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
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