summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 15:50:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-23 15:50:46 -0700
commit2ad7b44f5dd63a34c8853ce55f7d3d351b2cbd33 (patch)
treed4c029108af9d7f14044a340dacdb920f7c2b1b5 /arch/arm/mach-pxa
parent43c9fad942b5afb9e03801c0721d83160fa5b0dd (diff)
parent079ed3681d748523e50c3947ca59507a7a181260 (diff)
downloadop-kernel-dev-2ad7b44f5dd63a34c8853ce55f7d3d351b2cbd33.zip
op-kernel-dev-2ad7b44f5dd63a34c8853ce55f7d3d351b2cbd33.tar.gz
Merge branch 'for-linus-clk' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull clkdev updates from Russell King: "This series addresses some breakage in clkdev caused by a previous patch set from the clk tree which introduced per-user clk structures. This basically renamed the existing 'struct clk' to 'struct clk_hw', and introduced a new 'struct clk'. This change will break anyone using clk_add_alias() with the common clk code enabled. Thankfully, the intersection of users of clk_add_alias() and those using the common clk code is practically zero, but this is something which should be fixed to keep the code sane. The problem is that clk_add_alias() does this: r = clk_get(...); l = clkdev_alloc(r, ...); clk_put(...); which causes the alias to store a pointer to 'r', which has been freed. The original patch set tried to work around this problem incorrectly - at clk_get() time, it tried to convert the struct clk to a struct clk_hw, and then creating a new struct clk from that. Clearly, if the original struct clk has been freed, then we have a use-after-free bug. We have other places in the tree which do something similar, so this series also addresses those locations too. This series addresses this problem by converting clkdev to store and use the clk_hw pointer. This allows clk_get() to only have to create it's per-user struct clk from the clk_hw. We can also get to the desired clk_hw at clk_add_alias() or clk lookup creation time, when the struct clk is "alive". We also perform some cleanups of the code: - replacing looped calls to clkdev_add() with clkdev_add_table() - replacing open-coded lookup allocation (which should have been using clkdev_alloc()) and subsequent clkdev_add() with clkdev_create() - replacing open-coded clk_add_alias() with clk_add_alias()" * 'for-linus-clk' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: clk: s2mps11: use clkdev_create() ASoC: migor: use clkdev_create() ARM: omap2: use clkdev_add_alias() ARM: omap2: use clkdev_create() ARM: orion: use clkdev_create() ARM: lpc32xx: convert to use clkdev_add_table() SH: use clkdev_add_table() clkdev: add clkdev_create() helper clkdev: const-ify connection id to clk_add_alias() clkdev: get rid of redundant clk_add_alias() prototype in linux/clk.h clkdev: drop __init from clkdev_add_table() clk: update clk API documentation to clarify clk_round_rate() clkdev: use clk_hw internally
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/eseries.c1
-rw-r--r--arch/arm/mach-pxa/lubbock.c1
-rw-r--r--arch/arm/mach-pxa/tosa.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index cfb8641..4427bf2 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -10,6 +10,7 @@
*
*/
+#include <linux/clkdev.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/gpio.h>
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 4ac9ab8..7518310 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -11,6 +11,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/clkdev.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/module.h>
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 7780d1fa..92e56d8 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -12,6 +12,7 @@
*
*/
+#include <linux/clkdev.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
OpenPOWER on IntegriCloud