From: Saravana Kannan <skannan@codeaurora.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
Mike Turquette <mturquette@linaro.org>,
Paul Walmsley <paul@pwsan.com>,
Shawn Guo <shawn.guo@freescale.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Rob Herring <rob.herring@calxeda.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Russell King <linux@arm.linux.org.uk>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Andrew Lunn <andrew@lunn.ch>,
Jeremy Kerr <jeremy.kerr@canonical.com>,
Thomas Gleixner <tglx@linutronix.de>,
Arnd Bergman <arnd.bergmann@linaro.org>,
Jamie Iles <jamie@jamieiles.com>,
Richard Zhao <richard.zhao@linaro.org>,
Magnus Damm <magnus.damm@gmail.com>,
Linus Walleij <linus.walleij@stericsson.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Amit Kucheria <amit.kucheria@linaro.org>,
Deepak Saxena <dsaxena@linaro.org>,
Grant Likely <grant.likely@secretlab.ca>,
Tomasz Figa <tomasz.figa@gmail.com>
Subject: Re: [PATCH] clk: Fix race condition between clk_set_parent and clk_enable()
Date: Wed, 15 May 2013 21:17:03 -0700 [thread overview]
Message-ID: <51945DBF.60308@codeaurora.org> (raw)
In-Reply-To: <CAPDyKFpZ6-O-zSyBVgGGFL4W+d=-k-qaXimUS12fgC=9TkUNVA@mail.gmail.com>
On 05/15/2013 12:24 PM, Ulf Hansson wrote:
> On 1 May 2013 06:42, Saravana Kannan <skannan@codeaurora.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@linaro.org>
>
Thanks again.
-Saravana
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2013-05-16 4:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-01 4:42 [PATCH] clk: Fix race condition between clk_set_parent and clk_enable() Saravana Kannan
2013-05-14 18:54 ` Mike Turquette
2013-05-14 21:03 ` Saravana Kannan
2013-05-14 22:10 ` Tomasz Figa
2013-05-14 22:46 ` Saravana Kannan
2013-05-15 0:10 ` Tomasz Figa
2013-05-15 19:24 ` Ulf Hansson
2013-05-16 4:17 ` Saravana Kannan [this message]
2013-05-16 4:07 ` [PATCH v2] " Saravana Kannan
2013-05-16 20:44 ` Mike Turquette
2013-05-16 21:31 ` Saravana Kannan
2013-05-16 22:29 ` Mike Turquette
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51945DBF.60308@codeaurora.org \
--to=skannan@codeaurora.org \
--cc=amit.kucheria@linaro.org \
--cc=andrew@lunn.ch \
--cc=arnd.bergmann@linaro.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dsaxena@linaro.org \
--cc=grant.likely@secretlab.ca \
--cc=jamie@jamieiles.com \
--cc=jeremy.kerr@canonical.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=mturquette@linaro.org \
--cc=paul@pwsan.com \
--cc=richard.zhao@linaro.org \
--cc=rob.herring@calxeda.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@codeaurora.org \
--cc=shawn.guo@freescale.com \
--cc=tglx@linutronix.de \
--cc=tomasz.figa@gmail.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).