linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] clk: Fix potential race condition in clk_get()
@ 2013-08-09 16:34 Sylwester Nawrocki
  2013-08-09 16:34 ` [PATCH RFC 1/2] clk: Provide not locked variant of of_clk_get_from_provider() Sylwester Nawrocki
  2013-08-09 16:34 ` [PATCH RFC 2/2] clkdev: Fix race condition in clock lookup from device tree Sylwester Nawrocki
  0 siblings, 2 replies; 7+ messages in thread
From: Sylwester Nawrocki @ 2013-08-09 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

This series depends on my patches adding clk deregistration support [1].
It attempts to fix a race condition in the clock lookup from device tree,
which surfaced during further testing.

In the original clkdev code there is no issues since clock lookup and
__clk_get() are being called with the clocks list mutex held.

In the device tree related part of clk_get() function those operations
are separated which turned out to be unsafe.

The first patch adds the clock providers list locking helpers and
an unlocked version of of_clk_get_from_provider() function.

The second one moves __clk_get() call from clk_get() to of_clk_get()
and modifies of_clk_get() so the clock lookup and __clk_get()
operations are both done with the clocks lists mutex held.

This race condition issue is only present when __clk_get() is
implemented and is only visible with my previous patchset [1] applied.

[1] http://www.mail-archive.com/linux-kernel at vger.kernel.org/msg481861.html

Sylwester Nawrocki (2):
  clk: Provide not locked variant of of_clk_get_from_provider()
  clkdev: Fix race condition in clock lookup from device tree

 drivers/clk/clk.c    |   36 ++++++++++++++++++++++++++++--------
 drivers/clk/clkdev.c |   10 ++++++++--
 include/linux/clk.h  |    3 +++
 3 files changed, 39 insertions(+), 10 deletions(-)

--
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-08-20 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09 16:34 [PATCH RFC 0/2] clk: Fix potential race condition in clk_get() Sylwester Nawrocki
2013-08-09 16:34 ` [PATCH RFC 1/2] clk: Provide not locked variant of of_clk_get_from_provider() Sylwester Nawrocki
2013-08-19 19:41   ` Mike Turquette
2013-08-19 19:50     ` Russell King - ARM Linux
2013-08-20 17:31       ` Sylwester Nawrocki
2013-08-09 16:34 ` [PATCH RFC 2/2] clkdev: Fix race condition in clock lookup from device tree Sylwester Nawrocki
2013-08-19 19:42   ` Mike Turquette

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).