From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/4] clkdev: Fix race condition in clock lookup from device tree
Date: Tue, 20 Aug 2013 21:52:21 +0000 [thread overview]
Message-ID: <20130820215221.GH17845@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1377020063-30213-5-git-send-email-s.nawrocki@samsung.com>
On Tue, Aug 20, 2013 at 07:34:23PM +0200, Sylwester Nawrocki wrote:
> There is currently a race condition in the device tree part of clk_get()
> function, since the pointer returned from of_clk_get_by_name() may become
> invalid before __clk_get() call. I.e. due to the clock provider driver
> remove() callback being called in between of_clk_get_by_name() and
> __clk_get().
>
> Fix this by doing both the look up and __clk_get() operations with the
> clock providers list mutex held. This ensures that the clock pointer
> returned from __of_clk_get_from_provider() call and passed to __clk_get()
> is valid, as long as the clock supplier module first removes its clock
> provider instance and then does clk_unregister() on the corresponding
> clocks.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> Reviewed-by: Mike Turquette <mturquette@linaro.org>
Thanks.
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
prev parent reply other threads:[~2013-08-20 21:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 17:34 [PATCH v2 0/4] clk: clock deregistration support Sylwester Nawrocki
2013-08-20 17:34 ` [PATCH v2 1/4] clk: add common __clk_get(), __clk_put() implementations Sylwester Nawrocki
2013-08-20 20:30 ` Russell King - ARM Linux
2013-08-23 14:41 ` Sylwester Nawrocki
2013-08-20 17:34 ` [PATCH v2 2/4] clk: implement clk_unregister Sylwester Nawrocki
2013-08-23 21:58 ` Mike Turquette
2013-08-23 23:00 ` Sylwester Nawrocki
2013-08-20 17:34 ` [PATCH v2 3/4] clk: Provide not locked variant of of_clk_get_from_provider() Sylwester Nawrocki
2013-08-20 21:51 ` Russell King - ARM Linux
2013-08-20 17:34 ` [PATCH v2 4/4] clkdev: Fix race condition in clock lookup from device tree Sylwester Nawrocki
2013-08-20 21:52 ` Russell King - ARM Linux [this message]
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=20130820215221.GH17845@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).