From: Greg Kroah-Hartman Date: Fri, 15 May 2015 18:23:49 +0000 (-0700) Subject: 4.0-stable patches X-Git-Tag: v3.10.79~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29060701a626d7bc3ab37c2f60af33ed6de3688d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.0-stable patches added patches: arm-8307-1-psci-move-psci-firmware-calls-out-of-line.patch --- diff --git a/queue-4.0/arm-8307-1-psci-move-psci-firmware-calls-out-of-line.patch b/queue-4.0/arm-8307-1-psci-move-psci-firmware-calls-out-of-line.patch new file mode 100644 index 00000000000..19e86ad18fd --- /dev/null +++ b/queue-4.0/arm-8307-1-psci-move-psci-firmware-calls-out-of-line.patch @@ -0,0 +1,135 @@ +From c097877319ab61dd045b6497953b4e3df8f2bb44 Mon Sep 17 00:00:00 2001 +From: Mark Rutland +Date: Fri, 6 Mar 2015 12:08:30 +0100 +Subject: ARM: 8307/1: psci: move psci firmware calls out of line + +From: Mark Rutland + +commit c097877319ab61dd045b6497953b4e3df8f2bb44 upstream. + +arm64 builds with GCC 5 have caused the __asmeq assertions in the PSCI +calling code to fire, so move the ARM PSCI calls out of line into their +own assembly file for consistency and to safeguard against the same +issue occuring with the 32-bit toolchain. + +[will: brought into line with arm64 implementation] + +Reported-by: Andy Whitcroft +Signed-off-by: Mark Rutland +Signed-off-by: Will Deacon +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/kernel/Makefile | 2 +- + arch/arm/kernel/psci-call.S | 31 +++++++++++++++++++++++++++++++ + arch/arm/kernel/psci.c | 39 +++------------------------------------ + 3 files changed, 35 insertions(+), 37 deletions(-) + +--- a/arch/arm/kernel/Makefile ++++ b/arch/arm/kernel/Makefile +@@ -86,7 +86,7 @@ obj-$(CONFIG_EARLY_PRINTK) += early_prin + + obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o + ifeq ($(CONFIG_ARM_PSCI),y) +-obj-y += psci.o ++obj-y += psci.o psci-call.o + obj-$(CONFIG_SMP) += psci_smp.o + endif + +--- /dev/null ++++ b/arch/arm/kernel/psci-call.S +@@ -0,0 +1,31 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Copyright (C) 2015 ARM Limited ++ * ++ * Author: Mark Rutland ++ */ ++ ++#include ++ ++#include ++#include ++ ++/* int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */ ++ENTRY(__invoke_psci_fn_hvc) ++ __HVC(0) ++ bx lr ++ENDPROC(__invoke_psci_fn_hvc) ++ ++/* int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */ ++ENTRY(__invoke_psci_fn_smc) ++ __SMC(0) ++ bx lr ++ENDPROC(__invoke_psci_fn_smc) +--- a/arch/arm/kernel/psci.c ++++ b/arch/arm/kernel/psci.c +@@ -23,8 +23,6 @@ + + #include + #include +-#include +-#include + #include + #include + +@@ -33,6 +31,9 @@ struct psci_operations psci_ops; + static int (*invoke_psci_fn)(u32, u32, u32, u32); + typedef int (*psci_initcall_t)(const struct device_node *); + ++asmlinkage int __invoke_psci_fn_hvc(u32, u32, u32, u32); ++asmlinkage int __invoke_psci_fn_smc(u32, u32, u32, u32); ++ + enum psci_function { + PSCI_FN_CPU_SUSPEND, + PSCI_FN_CPU_ON, +@@ -71,40 +72,6 @@ static u32 psci_power_state_pack(struct + & PSCI_0_2_POWER_STATE_AFFL_MASK); + } + +-/* +- * The following two functions are invoked via the invoke_psci_fn pointer +- * and will not be inlined, allowing us to piggyback on the AAPCS. +- */ +-static noinline int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1, +- u32 arg2) +-{ +- asm volatile( +- __asmeq("%0", "r0") +- __asmeq("%1", "r1") +- __asmeq("%2", "r2") +- __asmeq("%3", "r3") +- __HVC(0) +- : "+r" (function_id) +- : "r" (arg0), "r" (arg1), "r" (arg2)); +- +- return function_id; +-} +- +-static noinline int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1, +- u32 arg2) +-{ +- asm volatile( +- __asmeq("%0", "r0") +- __asmeq("%1", "r1") +- __asmeq("%2", "r2") +- __asmeq("%3", "r3") +- __SMC(0) +- : "+r" (function_id) +- : "r" (arg0), "r" (arg1), "r" (arg2)); +- +- return function_id; +-} +- + static int psci_get_version(void) + { + int err; diff --git a/queue-4.0/series b/queue-4.0/series index ccc9e26a68c..002edea5a27 100644 --- a/queue-4.0/series +++ b/queue-4.0/series @@ -51,3 +51,4 @@ pinctrl-don-t-just-pretend-to-protect-pinctrl_maps-do-it-for-real.patch mmc-card-don-t-access-rpmb-partitions-for-normal-read-write.patch mmc-core-add-missing-pm-event-in-mmc_pm_notify-to-fix-hib-restore.patch mmc-sh_mmcif-fix-timeout-value-for-command-request.patch +arm-8307-1-psci-move-psci-firmware-calls-out-of-line.patch