From f4c87fd9b8e464c7cfb2fd812e5fc6ae354fa702 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 7 Jun 2014 19:01:29 -0700 Subject: [PATCH] 3.10-stable patches added patches: arm-8051-1-put_user-fix-possible-data-corruption-in-put_user.patch arm-imx-fix-error-handling-in-ipu-device-registration.patch arm-omap3-clock-back-propagate-rate-change-from-cam_mclk-to-dpll4_m5-on-all-omap3-platforms.patch arm-omap4-fix-the-boot-regression-with-cpu_idle-enabled.patch dm-cache-always-split-discards-on-cache-block-boundaries.patch --- ...possible-data-corruption-in-put_user.patch | 37 ++++++ ...-handling-in-ipu-device-registration.patch | 39 ++++++ ...k-to-dpll4_m5-on-all-omap3-platforms.patch | 38 ++++++ ...oot-regression-with-cpu_idle-enabled.patch | 122 ++++++++++++++++++ ...t-discards-on-cache-block-boundaries.patch | 33 +++++ queue-3.10/series | 5 + 6 files changed, 274 insertions(+) create mode 100644 queue-3.10/arm-8051-1-put_user-fix-possible-data-corruption-in-put_user.patch create mode 100644 queue-3.10/arm-imx-fix-error-handling-in-ipu-device-registration.patch create mode 100644 queue-3.10/arm-omap3-clock-back-propagate-rate-change-from-cam_mclk-to-dpll4_m5-on-all-omap3-platforms.patch create mode 100644 queue-3.10/arm-omap4-fix-the-boot-regression-with-cpu_idle-enabled.patch create mode 100644 queue-3.10/dm-cache-always-split-discards-on-cache-block-boundaries.patch diff --git a/queue-3.10/arm-8051-1-put_user-fix-possible-data-corruption-in-put_user.patch b/queue-3.10/arm-8051-1-put_user-fix-possible-data-corruption-in-put_user.patch new file mode 100644 index 00000000000..c5974214165 --- /dev/null +++ b/queue-3.10/arm-8051-1-put_user-fix-possible-data-corruption-in-put_user.patch @@ -0,0 +1,37 @@ +From 537094b64b229bf3ad146042f83e74cf6abe59df Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin +Date: Wed, 7 May 2014 08:07:25 +0100 +Subject: ARM: 8051/1: put_user: fix possible data corruption in put_user + +From: Andrey Ryabinin + +commit 537094b64b229bf3ad146042f83e74cf6abe59df upstream. + +According to arm procedure call standart r2 register is call-cloberred. +So after the result of x expression was put into r2 any following +function call in p may overwrite r2. To fix this, the result of p +expression must be saved to the temporary variable before the +assigment x expression to __r2. + +Signed-off-by: Andrey Ryabinin +Reviewed-by: Nicolas Pitre +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/include/asm/uaccess.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/include/asm/uaccess.h ++++ b/arch/arm/include/asm/uaccess.h +@@ -164,8 +164,9 @@ extern int __put_user_8(void *, unsigned + #define __put_user_check(x,p) \ + ({ \ + unsigned long __limit = current_thread_info()->addr_limit - 1; \ ++ const typeof(*(p)) __user *__tmp_p = (p); \ + register const typeof(*(p)) __r2 asm("r2") = (x); \ +- register const typeof(*(p)) __user *__p asm("r0") = (p);\ ++ register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \ + register unsigned long __l asm("r1") = __limit; \ + register int __e asm("r0"); \ + switch (sizeof(*(__p))) { \ diff --git a/queue-3.10/arm-imx-fix-error-handling-in-ipu-device-registration.patch b/queue-3.10/arm-imx-fix-error-handling-in-ipu-device-registration.patch new file mode 100644 index 00000000000..7a043868703 --- /dev/null +++ b/queue-3.10/arm-imx-fix-error-handling-in-ipu-device-registration.patch @@ -0,0 +1,39 @@ +From d1d70e5dc2cfa9047bb935c41ba808ebb8135696 Mon Sep 17 00:00:00 2001 +From: Emil Goode +Date: Mon, 19 May 2014 15:07:54 +0800 +Subject: ARM: imx: fix error handling in ipu device registration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Emil Goode + +commit d1d70e5dc2cfa9047bb935c41ba808ebb8135696 upstream. + +If we fail to allocate struct platform_device pdev we +dereference it after the goto label err. + +This bug was found using coccinelle. + +Fixes: afa77ef (ARM: mx3: dynamically allocate "ipu-core" devices) +Signed-off-by: Emil Goode +Acked-by: Uwe Kleine-König +Signed-off-by: Shawn Guo +Signed-off-by: Olof Johansson +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-imx/devices/platform-ipu-core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/mach-imx/devices/platform-ipu-core.c ++++ b/arch/arm/mach-imx/devices/platform-ipu-core.c +@@ -77,7 +77,7 @@ struct platform_device *__init imx_alloc + + pdev = platform_device_alloc("mx3-camera", 0); + if (!pdev) +- goto err; ++ return ERR_PTR(-ENOMEM); + + pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); + if (!pdev->dev.dma_mask) diff --git a/queue-3.10/arm-omap3-clock-back-propagate-rate-change-from-cam_mclk-to-dpll4_m5-on-all-omap3-platforms.patch b/queue-3.10/arm-omap3-clock-back-propagate-rate-change-from-cam_mclk-to-dpll4_m5-on-all-omap3-platforms.patch new file mode 100644 index 00000000000..daad5b99243 --- /dev/null +++ b/queue-3.10/arm-omap3-clock-back-propagate-rate-change-from-cam_mclk-to-dpll4_m5-on-all-omap3-platforms.patch @@ -0,0 +1,38 @@ +From 98d7e1aee6dd534f468993f8c6a1bc730d4cfa81 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Mon, 21 Apr 2014 15:06:23 +0200 +Subject: ARM: OMAP3: clock: Back-propagate rate change from cam_mclk to dpll4_m5 on all OMAP3 platforms +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Laurent Pinchart + +commit 98d7e1aee6dd534f468993f8c6a1bc730d4cfa81 upstream. + +Commit 7b2e1277598e4187c9be3e61fd9b0f0423f97986 ("ARM: OMAP3: clock: +Back-propagate rate change from cam_mclk to dpll4_m5") enabled clock +rate back-propagation from cam_mclk do dpll4_m5 on OMAP3630 only. +Perform back-propagation on other OMAP3 platforms as well. + +Reported-by: Jean-Philippe François +Signed-off-by: Laurent Pinchart +Signed-off-by: Paul Walmsley +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/cclock3xxx_data.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/mach-omap2/cclock3xxx_data.c ++++ b/arch/arm/mach-omap2/cclock3xxx_data.c +@@ -418,7 +418,8 @@ static struct clk_hw_omap dpll4_m5x2_ck_ + .clkdm_name = "dpll4_clkdm", + }; + +-DEFINE_STRUCT_CLK(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, dpll4_m5x2_ck_ops); ++DEFINE_STRUCT_CLK_FLAGS(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, ++ dpll4_m5x2_ck_ops, CLK_SET_RATE_PARENT); + + static struct clk dpll4_m5x2_ck_3630 = { + .name = "dpll4_m5x2_ck", diff --git a/queue-3.10/arm-omap4-fix-the-boot-regression-with-cpu_idle-enabled.patch b/queue-3.10/arm-omap4-fix-the-boot-regression-with-cpu_idle-enabled.patch new file mode 100644 index 00000000000..283f3419246 --- /dev/null +++ b/queue-3.10/arm-omap4-fix-the-boot-regression-with-cpu_idle-enabled.patch @@ -0,0 +1,122 @@ +From 4b353a706a86598ba47307c47301c3c428b79e09 Mon Sep 17 00:00:00 2001 +From: Santosh Shilimkar +Date: Mon, 12 May 2014 17:37:59 -0400 +Subject: ARM: OMAP4: Fix the boot regression with CPU_IDLE enabled + +From: Santosh Shilimkar + +commit 4b353a706a86598ba47307c47301c3c428b79e09 upstream. + +On OMAP4 panda board, there have been several bug reports about boot +hang and lock-ups with CPU_IDLE enabled. The root cause of the issue +is missing interrupts while in idle state. Commit cb7094e8 {cpuidle / omap4 : +use CPUIDLE_FLAG_TIMER_STOP flag} moved the broadcast notifiers to common +code for right reasons but on OMAP4 which suffers from a nasty ROM code +bug with GIC, commit ff999b8a {ARM: OMAP4460: Workaround for ROM bug ..}, +we loose interrupts which leads to issues like lock-up, hangs etc. + +Patch reverts commit cb7094 {cpuidle / omap4 : use CPUIDLE_FLAG_TIMER_STOP +flag} and 54769d6 {cpuidle: OMAP4: remove timer broadcast initialization} to +avoid the issue. With this change, OMAP4 panda boards, the mentioned +issues are getting fixed. We no longer loose interrupts which was the cause +of the regression. + +Fixes: cb7094e8 (cpuidle / omap4 : use CPUIDLE_FLAG_TIMER_STOP flag) +Fixes: ff999b8a (cpuidle: OMAP4: remove timer broadcast initialization) +Cc: Roger Quadros +Cc: Kevin Hilman +Cc: Tony Lindgren +Cc: Daniel Lezcano +Reported-tested-by: Roger Quadros +Reported-tested-by: Kevin Hilman +Tested-by: Tony Lindgren +Signed-off-by: Santosh Shilimkar +Signed-off-by: Tony Lindgren +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-omap2/cpuidle44xx.c | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) + +--- a/arch/arm/mach-omap2/cpuidle44xx.c ++++ b/arch/arm/mach-omap2/cpuidle44xx.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -80,6 +81,7 @@ static int omap_enter_idle_coupled(struc + int index) + { + struct idle_statedata *cx = state_ptr + index; ++ int cpu_id = smp_processor_id(); + + /* + * CPU0 has to wait and stay ON until CPU1 is OFF state. +@@ -104,6 +106,8 @@ static int omap_enter_idle_coupled(struc + } + } + ++ clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id); ++ + /* + * Call idle CPU PM enter notifier chain so that + * VFP and per CPU interrupt context is saved. +@@ -147,6 +151,8 @@ static int omap_enter_idle_coupled(struc + (cx->mpu_logic_state == PWRDM_POWER_OFF)) + cpu_cluster_pm_exit(); + ++ clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); ++ + fail: + cpuidle_coupled_parallel_barrier(dev, &abort_barrier); + cpu_done[dev->cpu] = false; +@@ -154,6 +160,16 @@ fail: + return index; + } + ++/* ++ * For each cpu, setup the broadcast timer because local timers ++ * stops for the states above C1. ++ */ ++static void omap_setup_broadcast_timer(void *arg) ++{ ++ int cpu = smp_processor_id(); ++ clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); ++} ++ + static struct cpuidle_driver omap4_idle_driver = { + .name = "omap4_idle", + .owner = THIS_MODULE, +@@ -171,8 +187,7 @@ static struct cpuidle_driver omap4_idle_ + /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ + .exit_latency = 328 + 440, + .target_residency = 960, +- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED | +- CPUIDLE_FLAG_TIMER_STOP, ++ .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, + .enter = omap_enter_idle_coupled, + .name = "C2", + .desc = "CPUx OFF, MPUSS CSWR", +@@ -181,8 +196,7 @@ static struct cpuidle_driver omap4_idle_ + /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ + .exit_latency = 460 + 518, + .target_residency = 1100, +- .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED | +- CPUIDLE_FLAG_TIMER_STOP, ++ .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, + .enter = omap_enter_idle_coupled, + .name = "C3", + .desc = "CPUx OFF, MPUSS OSWR", +@@ -213,5 +227,8 @@ int __init omap4_idle_init(void) + if (!cpu_clkdm[0] || !cpu_clkdm[1]) + return -ENODEV; + ++ /* Configure the broadcast timer on each cpu */ ++ on_each_cpu(omap_setup_broadcast_timer, NULL, 1); ++ + return cpuidle_register(&omap4_idle_driver, cpu_online_mask); + } diff --git a/queue-3.10/dm-cache-always-split-discards-on-cache-block-boundaries.patch b/queue-3.10/dm-cache-always-split-discards-on-cache-block-boundaries.patch new file mode 100644 index 00000000000..251aeb1f932 --- /dev/null +++ b/queue-3.10/dm-cache-always-split-discards-on-cache-block-boundaries.patch @@ -0,0 +1,33 @@ +From f1daa838e861ae1a0fb7cd9721a21258430fcc8c Mon Sep 17 00:00:00 2001 +From: Heinz Mauelshagen +Date: Fri, 23 May 2014 14:10:01 -0400 +Subject: dm cache: always split discards on cache block boundaries + +From: Heinz Mauelshagen + +commit f1daa838e861ae1a0fb7cd9721a21258430fcc8c upstream. + +The DM cache target cannot cope with discards that span multiple cache +blocks, so each discard bio that spans more than one cache block must +get split by the DM core. + +Signed-off-by: Heinz Mauelshagen +Acked-by: Joe Thornber +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/dm-cache-target.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/md/dm-cache-target.c ++++ b/drivers/md/dm-cache-target.c +@@ -1954,6 +1954,8 @@ static int cache_create(struct cache_arg + ti->num_discard_bios = 1; + ti->discards_supported = true; + ti->discard_zeroes_data_unsupported = true; ++ /* Discard bios must be split on a block boundary */ ++ ti->split_discard_bios = true; + + cache->features = ca->features; + ti->per_bio_data_size = get_per_bio_data_size(cache); diff --git a/queue-3.10/series b/queue-3.10/series index 141d25bfd7a..d31d91faea8 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -11,3 +11,8 @@ hwmon-ntc_thermistor-fix-of-device-id-mapping.patch drm-gf119-disp-fix-nasty-bug-which-can-clobber-sor0-s-clock-setup.patch drm-radeon-also-try-gart-for-cpu-accessed-buffers.patch drm-radeon-handle-non-vga-class-pci-devices-with-atrm.patch +arm-imx-fix-error-handling-in-ipu-device-registration.patch +arm-omap3-clock-back-propagate-rate-change-from-cam_mclk-to-dpll4_m5-on-all-omap3-platforms.patch +arm-omap4-fix-the-boot-regression-with-cpu_idle-enabled.patch +arm-8051-1-put_user-fix-possible-data-corruption-in-put_user.patch +dm-cache-always-split-discards-on-cache-block-boundaries.patch -- 2.47.3