* [PATCH v2] ARM: tango: Improve ARCH_MULTIPLATFORM compatibility
@ 2019-01-16 15:49 Marc Gonzalez
2019-01-16 22:05 ` Pavel Machek
0 siblings, 1 reply; 3+ messages in thread
From: Marc Gonzalez @ 2019-01-16 15:49 UTC (permalink / raw)
To: arm-soc
Cc: Mans Rullgard, Rafael Wysocki, Pavel Machek, Linux ARM, Paolo Pisati
Calling platform-specific code unconditionally blows up when running
an ARCH_MULTIPLATFORM kernel on a different platform. Don't do it.
Reported-by: Paolo Pisati <p.pisati@gmail.com>
Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
---
v1 was Paolo's patch: https://patchwork.kernel.org/patch/10573007/
Paolo: Sorry for procrastinating with your patch.
---
arch/arm/mach-tango/pm.c | 6 ++----
arch/arm/mach-tango/pm.h | 7 +++++++
arch/arm/mach-tango/setup.c | 2 ++
3 files changed, 11 insertions(+), 4 deletions(-)
create mode 100644 arch/arm/mach-tango/pm.h
diff --git a/arch/arm/mach-tango/pm.c b/arch/arm/mach-tango/pm.c
index 028e50c6383f..a32c3b631484 100644
--- a/arch/arm/mach-tango/pm.c
+++ b/arch/arm/mach-tango/pm.c
@@ -3,6 +3,7 @@
#include <linux/suspend.h>
#include <asm/suspend.h>
#include "smc.h"
+#include "pm.h"
static int tango_pm_powerdown(unsigned long arg)
{
@@ -24,10 +25,7 @@ static const struct platform_suspend_ops tango_pm_ops = {
.valid = suspend_valid_only_mem,
};
-static int __init tango_pm_init(void)
+void __init tango_pm_init(void)
{
suspend_set_ops(&tango_pm_ops);
- return 0;
}
-
-late_initcall(tango_pm_init);
diff --git a/arch/arm/mach-tango/pm.h b/arch/arm/mach-tango/pm.h
new file mode 100644
index 000000000000..35ea705a0ee2
--- /dev/null
+++ b/arch/arm/mach-tango/pm.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifdef CONFIG_SUSPEND
+void __init tango_pm_init(void);
+#else
+#define tango_pm_init NULL
+#endif
diff --git a/arch/arm/mach-tango/setup.c b/arch/arm/mach-tango/setup.c
index 677dd7b5efd9..824f90737b04 100644
--- a/arch/arm/mach-tango/setup.c
+++ b/arch/arm/mach-tango/setup.c
@@ -2,6 +2,7 @@
#include <asm/mach/arch.h>
#include <asm/hardware/cache-l2x0.h>
#include "smc.h"
+#include "pm.h"
static void tango_l2c_write(unsigned long val, unsigned int reg)
{
@@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
.dt_compat = tango_dt_compat,
.l2c_aux_mask = ~0,
.l2c_write_sec = tango_l2c_write,
+ .init_late = tango_pm_init,
MACHINE_END
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ARM: tango: Improve ARCH_MULTIPLATFORM compatibility
2019-01-16 15:49 [PATCH v2] ARM: tango: Improve ARCH_MULTIPLATFORM compatibility Marc Gonzalez
@ 2019-01-16 22:05 ` Pavel Machek
2019-01-30 10:47 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2019-01-16 22:05 UTC (permalink / raw)
To: Marc Gonzalez
Cc: Rafael Wysocki, arm-soc, Mans Rullgard, Linux ARM, Paolo Pisati
[-- Attachment #1.1: Type: text/plain, Size: 1287 bytes --]
On Wed 2019-01-16 16:49:58, Marc Gonzalez wrote:
> Calling platform-specific code unconditionally blows up when running
> an ARCH_MULTIPLATFORM kernel on a different platform. Don't do it.
>
> Reported-by: Paolo Pisati <p.pisati@gmail.com>
> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Acked-by: Pavel Machek <pavel@ucw.cz>
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifdef CONFIG_SUSPEND
> +void __init tango_pm_init(void);
> +#else
> +#define tango_pm_init NULL
> +#endif
> diff --git a/arch/arm/mach-tango/setup.c b/arch/arm/mach-tango/setup.c
> index 677dd7b5efd9..824f90737b04 100644
> --- a/arch/arm/mach-tango/setup.c
> +++ b/arch/arm/mach-tango/setup.c
> @@ -2,6 +2,7 @@
> #include <asm/mach/arch.h>
> #include <asm/hardware/cache-l2x0.h>
> #include "smc.h"
> +#include "pm.h"
>
> static void tango_l2c_write(unsigned long val, unsigned int reg)
> {
> @@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
> .dt_compat = tango_dt_compat,
> .l2c_aux_mask = ~0,
> .l2c_write_sec = tango_l2c_write,
> + .init_late = tango_pm_init,
> MACHINE_END
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ARM: tango: Improve ARCH_MULTIPLATFORM compatibility
2019-01-16 22:05 ` Pavel Machek
@ 2019-01-30 10:47 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-01-30 10:47 UTC (permalink / raw)
To: Pavel Machek
Cc: Mans Rullgard, Marc Gonzalez, Rafael Wysocki, arm-soc,
Paolo Pisati, Linux ARM
On Wed, Jan 16, 2019 at 11:05 PM Pavel Machek <pavel@ucw.cz> wrote:
>
> On Wed 2019-01-16 16:49:58, Marc Gonzalez wrote:
> > Calling platform-specific code unconditionally blows up when running
> > an ARCH_MULTIPLATFORM kernel on a different platform. Don't do it.
> >
> > Reported-by: Paolo Pisati <p.pisati@gmail.com>
> > Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
>
> Acked-by: Pavel Machek <pavel@ucw.cz>
Applied to fixes branch, and marked cc:stable for backports to 4.9, 4.14,
4.19 and 4.20.
Thanks!
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-30 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 15:49 [PATCH v2] ARM: tango: Improve ARCH_MULTIPLATFORM compatibility Marc Gonzalez
2019-01-16 22:05 ` Pavel Machek
2019-01-30 10:47 ` Arnd Bergmann
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).