From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>,
linux@arm.linux.org.uk, mturquette@linaro.org,
jiada_wang@mentor.com, broonie@kernel.org, vapier@gentoo.org,
ralf@linux-mips.org, kyungmin.park@samsung.com,
myungjoo.ham@samsung.com, shawn.guo@linaro.org,
sebastian.hesselbarth@gmail.com, LW@KARO-electronics.de,
t.figa@samsung.com, g.liakhovetski@gmx.de,
laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org,
uclinux-dist-devel@blackfin.uclinux.org,
linux-mips@linux-mips.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH v3 2/5] clkdev: Fix race condition in clock lookup from device tree
Date: Fri, 23 Aug 2013 17:22:01 +0200 [thread overview]
Message-ID: <52177E19.3080106@samsung.com> (raw)
In-Reply-To: <1377270227-1030-3-git-send-email-s.nawrocki@samsung.com>
On 08/23/2013 05:03 PM, 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>
Oops, I missed to add:
Reviewed-by: Mike Turquette <mturquette@linaro.org>
> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
next prev parent reply other threads:[~2013-08-23 15:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 15:03 [PATCH v3 0/5] clk: clock deregistration support Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 1/5] clk: Provide not locked variant of of_clk_get_from_provider() Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 2/5] clkdev: Fix race condition in clock lookup from device tree Sylwester Nawrocki
2013-08-23 15:22 ` Sylwester Nawrocki [this message]
2013-08-23 15:03 ` [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations Sylwester Nawrocki
2013-08-23 23:13 ` Russell King - ARM Linux
2013-08-24 15:16 ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 4/5] clk: Assign module owner of a clock being registered Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 5/5] clk: Implement clk_unregister Sylwester Nawrocki
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=52177E19.3080106@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=LW@KARO-electronics.de \
--cc=broonie@kernel.org \
--cc=g.liakhovetski@gmx.de \
--cc=jiada_wang@mentor.com \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mturquette@linaro.org \
--cc=myungjoo.ham@samsung.com \
--cc=ralf@linux-mips.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=shawn.guo@linaro.org \
--cc=t.figa@samsung.com \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
--cc=vapier@gentoo.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