]>
Commit | Line | Data |
---|---|---|
2cab9253 GKH |
1 | From d0f9f16788e15d9eb40f68b047732d49658c5a3a Mon Sep 17 00:00:00 2001 |
2 | From: Marc Gonzalez <marc.w.gonzalez@free.fr> | |
3 | Date: Wed, 16 Jan 2019 16:49:58 +0100 | |
4 | Subject: ARM: tango: Improve ARCH_MULTIPLATFORM compatibility | |
5 | ||
6 | From: Marc Gonzalez <marc.w.gonzalez@free.fr> | |
7 | ||
8 | commit d0f9f16788e15d9eb40f68b047732d49658c5a3a upstream. | |
9 | ||
10 | Calling platform-specific code unconditionally blows up when running | |
11 | an ARCH_MULTIPLATFORM kernel on a different platform. Don't do it. | |
12 | ||
13 | Reported-by: Paolo Pisati <p.pisati@gmail.com> | |
14 | Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr> | |
15 | Acked-by: Pavel Machek <pavel@ucw.cz> | |
16 | Cc: stable@vger.kernel.org # v4.8+ | |
17 | Fixes: a30eceb7a59d ("ARM: tango: add Suspend-to-RAM support") | |
18 | Signed-off-by: Arnd Bergmann <arnd@arndb.de> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
20 | ||
21 | --- | |
22 | arch/arm/mach-tango/pm.c | 6 ++---- | |
23 | arch/arm/mach-tango/pm.h | 7 +++++++ | |
24 | arch/arm/mach-tango/setup.c | 2 ++ | |
25 | 3 files changed, 11 insertions(+), 4 deletions(-) | |
26 | ||
27 | --- a/arch/arm/mach-tango/pm.c | |
28 | +++ b/arch/arm/mach-tango/pm.c | |
29 | @@ -3,6 +3,7 @@ | |
30 | #include <linux/suspend.h> | |
31 | #include <asm/suspend.h> | |
32 | #include "smc.h" | |
33 | +#include "pm.h" | |
34 | ||
35 | static int tango_pm_powerdown(unsigned long arg) | |
36 | { | |
37 | @@ -24,10 +25,7 @@ static const struct platform_suspend_ops | |
38 | .valid = suspend_valid_only_mem, | |
39 | }; | |
40 | ||
41 | -static int __init tango_pm_init(void) | |
42 | +void __init tango_pm_init(void) | |
43 | { | |
44 | suspend_set_ops(&tango_pm_ops); | |
45 | - return 0; | |
46 | } | |
47 | - | |
48 | -late_initcall(tango_pm_init); | |
49 | --- /dev/null | |
50 | +++ b/arch/arm/mach-tango/pm.h | |
51 | @@ -0,0 +1,7 @@ | |
52 | +/* SPDX-License-Identifier: GPL-2.0 */ | |
53 | + | |
54 | +#ifdef CONFIG_SUSPEND | |
55 | +void __init tango_pm_init(void); | |
56 | +#else | |
57 | +#define tango_pm_init NULL | |
58 | +#endif | |
59 | --- a/arch/arm/mach-tango/setup.c | |
60 | +++ b/arch/arm/mach-tango/setup.c | |
61 | @@ -2,6 +2,7 @@ | |
62 | #include <asm/mach/arch.h> | |
63 | #include <asm/hardware/cache-l2x0.h> | |
64 | #include "smc.h" | |
65 | +#include "pm.h" | |
66 | ||
67 | static void tango_l2c_write(unsigned long val, unsigned int reg) | |
68 | { | |
69 | @@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango | |
70 | .dt_compat = tango_dt_compat, | |
71 | .l2c_aux_mask = ~0, | |
72 | .l2c_write_sec = tango_l2c_write, | |
73 | + .init_late = tango_pm_init, | |
74 | MACHINE_END |