linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: at91: add support for secure suspend on sama5d2
@ 2022-02-22 15:08 Clément Léger
  2022-02-22 15:08 ` [PATCH 1/4] ARM: at91: add code to handle secure calls Clément Léger
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Clément Léger @ 2022-02-22 15:08 UTC (permalink / raw)
  To: Russell King, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches
  Cc: linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

Now that OP-TEE support for sama5d2 is more complete, add support to
execute SMC calls and to set suspend mode. This series adds new files
to be able to execute SMC calls targeting OP-TEE secure monitor and
secure suspend support uses it.

Clément Léger (4):
  ARM: at91: add code to handle secure calls
  ARM: at91: pm: move "atmel.pm_modes" parsing into a common file
  ARM: at91: pm: add support for sama5d2 secure suspend
  ARM: at91: pm: fix defines to select *_pm_init functions

 arch/arm/mach-at91/Kconfig          | 14 ++++++-
 arch/arm/mach-at91/Makefile         |  5 ++-
 arch/arm/mach-at91/generic.h        |  2 +-
 arch/arm/mach-at91/pm.c             | 31 +-------------
 arch/arm/mach-at91/pm.h             |  7 ++++
 arch/arm/mach-at91/pm_common.c      | 39 ++++++++++++++++++
 arch/arm/mach-at91/pm_secure.c      | 64 +++++++++++++++++++++++++++++
 arch/arm/mach-at91/sam_secure.c     | 46 +++++++++++++++++++++
 arch/arm/mach-at91/sam_secure.h     | 18 ++++++++
 arch/arm/mach-at91/sama5.c          |  2 +
 include/linux/platform_data/atmel.h |  2 +-
 11 files changed, 195 insertions(+), 35 deletions(-)
 create mode 100644 arch/arm/mach-at91/pm_common.c
 create mode 100644 arch/arm/mach-at91/pm_secure.c
 create mode 100644 arch/arm/mach-at91/sam_secure.c
 create mode 100644 arch/arm/mach-at91/sam_secure.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] ARM: at91: add code to handle secure calls
  2022-02-22 15:08 [PATCH 0/4] ARM: at91: add support for secure suspend on sama5d2 Clément Léger
@ 2022-02-22 15:08 ` Clément Léger
  2022-02-22 15:08 ` [PATCH 2/4] ARM: at91: pm: move "atmel.pm_modes" parsing into a common file Clément Léger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Clément Léger @ 2022-02-22 15:08 UTC (permalink / raw)
  To: Russell King, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches
  Cc: linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

Since OP-TEE now has a more complete support for sama5d2, add necessary
code to perform SMC calls. The detection of OP-TEE is based on a
specific device-tree node path (/firmware/optee) such has done by some
other SoC. A check is added to avoid doing SMC calls without having
OP-TEE.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 arch/arm/mach-at91/Makefile     |  2 +-
 arch/arm/mach-at91/sam_secure.c | 46 +++++++++++++++++++++++++++++++++
 arch/arm/mach-at91/sam_secure.h | 14 ++++++++++
 arch/arm/mach-at91/sama5.c      |  2 ++
 4 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-at91/sam_secure.c
 create mode 100644 arch/arm/mach-at91/sam_secure.h

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 522b680b6446..0dcc37180588 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -7,7 +7,7 @@
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o
 obj-$(CONFIG_SOC_AT91SAM9)	+= at91sam9.o
 obj-$(CONFIG_SOC_SAM9X60)	+= sam9x60.o
-obj-$(CONFIG_SOC_SAMA5)		+= sama5.o
+obj-$(CONFIG_SOC_SAMA5)		+= sama5.o sam_secure.o
 obj-$(CONFIG_SOC_SAMA7)		+= sama7.o
 obj-$(CONFIG_SOC_SAMV7)		+= samv7.o
 
diff --git a/arch/arm/mach-at91/sam_secure.c b/arch/arm/mach-at91/sam_secure.c
new file mode 100644
index 000000000000..979fc3c892a3
--- /dev/null
+++ b/arch/arm/mach-at91/sam_secure.c
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2012, Bootlin
+ */
+
+#include <linux/arm-smccc.h>
+#include <linux/of.h>
+
+#include "sam_secure.h"
+
+static bool optee_available;
+
+#define SAM_SIP_SMC_STD_CALL_VAL(func_num) \
+	ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL, ARM_SMCCC_SMC_32, \
+	ARM_SMCCC_OWNER_SIP, (func_num))
+
+struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1)
+{
+	struct arm_smccc_res res = {.a0 = -1};
+
+	if (WARN_ON(!optee_available))
+		return res;
+
+	arm_smccc_smc(SAM_SIP_SMC_STD_CALL_VAL(fn), arg0, arg1,
+		      0, 0, 0, 0, 0, &res);
+
+	return res;
+}
+
+void __init sam_secure_init(void)
+{
+	struct device_node *np;
+
+	/*
+	 * We only check that the OP-TEE node is present and available. The
+	 * OP-TEE kernel driver is not needed for the type of interaction made
+	 * with OP-TEE here so the driver's status is not checked.
+	 */
+	np = of_find_node_by_path("/firmware/optee");
+	if (np && of_device_is_available(np))
+		optee_available = true;
+	of_node_put(np);
+
+	if (optee_available)
+		pr_info("Running under OP-TEE firmware\n");
+}
diff --git a/arch/arm/mach-at91/sam_secure.h b/arch/arm/mach-at91/sam_secure.h
new file mode 100644
index 000000000000..af19e24ca59e
--- /dev/null
+++ b/arch/arm/mach-at91/sam_secure.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2012, Bootlin
+ */
+
+#ifndef SAM_SECURE_H
+#define SAM_SECURE_H
+
+#include <linux/arm-smccc.h>
+
+void __init sam_secure_init(void);
+struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1);
+
+#endif /* SAM_SECURE_H */
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index 89dab7cf01e8..de5dd28b392e 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -14,6 +14,7 @@
 #include <asm/system_misc.h>
 
 #include "generic.h"
+#include "sam_secure.h"
 
 static void __init sama5_dt_device_init(void)
 {
@@ -47,6 +48,7 @@ MACHINE_END
 static void __init sama5d2_init(void)
 {
 	of_platform_default_populate(NULL, NULL, NULL);
+	sam_secure_init();
 	sama5d2_pm_init();
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] ARM: at91: pm: move "atmel.pm_modes" parsing into a common file
  2022-02-22 15:08 [PATCH 0/4] ARM: at91: add support for secure suspend on sama5d2 Clément Léger
  2022-02-22 15:08 ` [PATCH 1/4] ARM: at91: add code to handle secure calls Clément Léger
@ 2022-02-22 15:08 ` Clément Léger
  2022-02-22 23:41   ` kernel test robot
  2022-02-22 15:08 ` [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend Clément Léger
  2022-02-22 15:08 ` [PATCH 4/4] ARM: at91: pm: fix defines to select *_pm_init functions Clément Léger
  3 siblings, 1 reply; 9+ messages in thread
From: Clément Léger @ 2022-02-22 15:08 UTC (permalink / raw)
  To: Russell King, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches
  Cc: linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

In order to add secure suspend support, split out code that will be
reused to parse the boot argument "atmel.pm_modes".

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 arch/arm/mach-at91/Makefile    |  2 +-
 arch/arm/mach-at91/pm.c        | 31 ++-------------------------
 arch/arm/mach-at91/pm.h        |  7 ++++++
 arch/arm/mach-at91/pm_common.c | 39 ++++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 30 deletions(-)
 create mode 100644 arch/arm/mach-at91/pm_common.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 0dcc37180588..23620ccf7ab6 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_SOC_SAMA7)		+= sama7.o
 obj-$(CONFIG_SOC_SAMV7)		+= samv7.o
 
 # Power Management
-obj-$(CONFIG_ATMEL_PM)		+= pm.o pm_suspend.o
+obj-$(CONFIG_ATMEL_PM)		+= pm.o pm_suspend.o pm_common.o
 
 ifeq ($(CONFIG_CPU_V7),y)
 AFLAGS_pm_suspend.o := -march=armv7-a
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index dd6f4ce3f766..b575304ccf63 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -99,15 +99,6 @@ static struct at91_soc_pm soc_pm = {
 	},
 };
 
-static const match_table_t pm_modes __initconst = {
-	{ AT91_PM_STANDBY,	"standby" },
-	{ AT91_PM_ULP0,		"ulp0" },
-	{ AT91_PM_ULP0_FAST,    "ulp0-fast" },
-	{ AT91_PM_ULP1,		"ulp1" },
-	{ AT91_PM_BACKUP,	"backup" },
-	{ -1, NULL },
-};
-
 #define at91_ramc_read(id, field) \
 	__raw_readl(soc_pm.data.ramc[id] + field)
 
@@ -1243,25 +1234,7 @@ void __init sama7_pm_init(void)
 
 static int __init at91_pm_modes_select(char *str)
 {
-	char *s;
-	substring_t args[MAX_OPT_ARGS];
-	int standby, suspend;
-
-	if (!str)
-		return 0;
-
-	s = strsep(&str, ",");
-	standby = match_token(s, pm_modes, args);
-	if (standby < 0)
-		return 0;
-
-	suspend = match_token(str, pm_modes, args);
-	if (suspend < 0)
-		return 0;
-
-	soc_pm.data.standby_mode = standby;
-	soc_pm.data.suspend_mode = suspend;
-
-	return 0;
+	return at91_pm_common_modes_select(str, &soc_pm.data.standby_mode,
+					   &soc_pm.data.suspend_mode);
 }
 early_param("atmel.pm_modes", at91_pm_modes_select);
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 53bdc9000e44..e9f7f9841afd 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -40,6 +40,13 @@ struct at91_pm_data {
 	unsigned int pmc_mckr_offset;
 	unsigned int pmc_version;
 };
+
+#include <linux/parser.h>
+
+extern const match_table_t pm_modes;
+
+int at91_pm_common_modes_select(char *str, int *standby_mode, int *suspend_mode);
+
 #endif
 
 #endif
diff --git a/arch/arm/mach-at91/pm_common.c b/arch/arm/mach-at91/pm_common.c
new file mode 100644
index 000000000000..45b74fb0a211
--- /dev/null
+++ b/arch/arm/mach-at91/pm_common.c
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+#include <linux/kernel.h>
+#include <linux/parser.h>
+#include <linux/string.h>
+
+#include "pm.h"
+
+const match_table_t pm_modes __initconst = {
+	{ AT91_PM_STANDBY,	"standby" },
+	{ AT91_PM_ULP0,		"ulp0" },
+	{ AT91_PM_ULP0_FAST,    "ulp0-fast" },
+	{ AT91_PM_ULP1,		"ulp1" },
+	{ AT91_PM_BACKUP,	"backup" },
+	{ -1, NULL },
+};
+
+int at91_pm_common_modes_select(char *str, int *standby_mode, int *suspend_mode)
+{
+	char *s;
+	substring_t args[MAX_OPT_ARGS];
+	int standby, suspend;
+
+	if (!str)
+		return 0;
+
+	s = strsep(&str, ",");
+	standby = match_token(s, pm_modes, args);
+	if (standby < 0)
+		return 0;
+
+	suspend = match_token(str, pm_modes, args);
+	if (suspend < 0)
+		return 0;
+
+	*standby_mode = standby;
+	*suspend_mode = suspend;
+
+	return 0;
+}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend
  2022-02-22 15:08 [PATCH 0/4] ARM: at91: add support for secure suspend on sama5d2 Clément Léger
  2022-02-22 15:08 ` [PATCH 1/4] ARM: at91: add code to handle secure calls Clément Léger
  2022-02-22 15:08 ` [PATCH 2/4] ARM: at91: pm: move "atmel.pm_modes" parsing into a common file Clément Léger
@ 2022-02-22 15:08 ` Clément Léger
  2022-02-23  5:50   ` kernel test robot
  2022-02-23  9:15   ` kernel test robot
  2022-02-22 15:08 ` [PATCH 4/4] ARM: at91: pm: fix defines to select *_pm_init functions Clément Léger
  3 siblings, 2 replies; 9+ messages in thread
From: Clément Léger @ 2022-02-22 15:08 UTC (permalink / raw)
  To: Russell King, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches
  Cc: linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

When running with OP-TEE, the suspend control is handled securely.
Since the sama5d2 supports multiple suspend modes add a new
CONFIG_ATMEL_SECURE_PM which is mutually exclusive with CONFIG_ATMEL_PM
and allows to issue a SMC call to select the suspend mode.
"atmel.pm_modes" boot argument is still supported for compatibility
purposes but the standby value is actually ignored since PSCI suspend
is used and it only support one mode (suspend).

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 arch/arm/mach-at91/Kconfig          | 14 ++++++-
 arch/arm/mach-at91/Makefile         |  1 +
 arch/arm/mach-at91/pm_secure.c      | 64 +++++++++++++++++++++++++++++
 arch/arm/mach-at91/sam_secure.h     |  4 ++
 include/linux/platform_data/atmel.h |  2 +-
 5 files changed, 82 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-at91/pm_secure.c

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 02f6b108fd5d..bb11a914ad3e 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -201,14 +201,24 @@ config SOC_SAM_V7
 config SOC_SAMA5
 	bool
 	select ATMEL_AIC5_IRQ
-	select ATMEL_PM if PM
 	select ATMEL_SDRAMC
 	select MEMORY
 	select SOC_SAM_V7
 	select SRAM if PM
 
 config ATMEL_PM
-	bool
+	bool "Atmel PM support"
+	default y if SOC_SAMA5 && PM
+	depends on !ATMEL_SECURE_PM
+
+config ATMEL_SECURE_PM
+	bool "Atmel Secure PM support"
+	depends on SOC_SAMA5D2 && PM
+	help
+	  When running under a TEE, the suspend mode must be requested to be set
+	  at TEE level. When enable, this option will use secure monitor calls
+	  to set the suspend level.
+	  NOTE: This support is mutually exclusive with CONFIG_ATMEL_PM
 
 config SOC_SAMA7
 	bool
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 23620ccf7ab6..ebd88de8d0e7 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_SOC_SAMV7)		+= samv7.o
 
 # Power Management
 obj-$(CONFIG_ATMEL_PM)		+= pm.o pm_suspend.o pm_common.o
+obj-$(CONFIG_ATMEL_SECURE_PM)	+= pm_secure.o pm_common.o
 
 ifeq ($(CONFIG_CPU_V7),y)
 AFLAGS_pm_suspend.o := -march=armv7-a
diff --git a/arch/arm/mach-at91/pm_secure.c b/arch/arm/mach-at91/pm_secure.c
new file mode 100644
index 000000000000..2f63ff8c6226
--- /dev/null
+++ b/arch/arm/mach-at91/pm_secure.c
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2012, Bootlin
+ */
+
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/parser.h>
+#include <linux/string.h>
+#include "generic.h"
+#include "sam_secure.h"
+#include "pm.h"
+
+static int suspend_mode = AT91_PM_ULP0;
+
+static void at91_pm_secure_init(void)
+{
+	struct arm_smccc_res res;
+
+	res = sam_smccc_call(SAMA5_SMC_SIP_SET_SUSPEND_MODE, suspend_mode, 0);
+	if (res.a0 == 0) {
+		pr_info("AT91: Secure PM: suspend mode set to %s\n",
+			pm_modes[suspend_mode].pattern);
+		return;
+	}
+
+	pr_warn("AT91: Secure PM: %s mode not supported !\n",
+		pm_modes[suspend_mode].pattern);
+
+	res = sam_smccc_call(SAMA5_SMC_SIP_GET_SUSPEND_MODE, 0, 0);
+	if (res.a0 == 0) {
+		pr_warn("AT91: Secure PM: failed to get default mode\n");
+		return;
+	}
+	suspend_mode = res.a1;
+
+	pr_info("AT91: Secure PM: using default suspend mode %s\n",
+		pm_modes[suspend_mode].pattern);
+}
+
+void __init sama5_pm_init(void)
+{
+}
+
+void __init sama5d2_pm_init(void)
+{
+	at91_pm_secure_init();
+}
+
+int at91_suspend_entering_slow_clock(void)
+{
+	return (suspend_mode >= AT91_PM_ULP0);
+}
+EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
+
+static int __init at91_pm_modes_select(char *str)
+{
+	int dummy;
+
+	pr_warn("AT91: Secure PM: ignoring standby mode\n");
+
+	return at91_pm_common_modes_select(str, &dummy, &suspend_mode);
+}
+early_param("atmel.pm_modes", at91_pm_modes_select);
diff --git a/arch/arm/mach-at91/sam_secure.h b/arch/arm/mach-at91/sam_secure.h
index af19e24ca59e..b169317f61f6 100644
--- a/arch/arm/mach-at91/sam_secure.h
+++ b/arch/arm/mach-at91/sam_secure.h
@@ -8,6 +8,10 @@
 
 #include <linux/arm-smccc.h>
 
+/* Secure Monitor mode APIs */
+#define SAMA5_SMC_SIP_SET_SUSPEND_MODE	0x400
+#define SAMA5_SMC_SIP_GET_SUSPEND_MODE	0x401
+
 void __init sam_secure_init(void);
 struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1);
 
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index 73f63be509c4..cbb19712b4f0 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -7,7 +7,7 @@
 #define __ATMEL_H__
 
 /* FIXME: this needs a better location, but gets stuff building again */
-#ifdef CONFIG_ATMEL_PM
+#if defined(CONFIG_ATMEL_PM) || defined(CONFIG_ATMEL_SECURE_PM)
 extern int at91_suspend_entering_slow_clock(void);
 #else
 static inline int at91_suspend_entering_slow_clock(void)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] ARM: at91: pm: fix defines to select *_pm_init functions
  2022-02-22 15:08 [PATCH 0/4] ARM: at91: add support for secure suspend on sama5d2 Clément Léger
                   ` (2 preceding siblings ...)
  2022-02-22 15:08 ` [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend Clément Léger
@ 2022-02-22 15:08 ` Clément Léger
  3 siblings, 0 replies; 9+ messages in thread
From: Clément Léger @ 2022-02-22 15:08 UTC (permalink / raw)
  To: Russell King, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches
  Cc: linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

These defines actually don't depend on CONFIG_PM but CONFIG_ATMEL_PM.
In the same time, add a "or" with CONFIG_ATMEL_SECURE_PM since it can
also provides these functions.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 arch/arm/mach-at91/generic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 0c3960a8b3eb..279ab7e0cdca 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -8,7 +8,7 @@
 #ifndef _AT91_GENERIC_H
 #define _AT91_GENERIC_H
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_ATMEL_PM) || defined(CONFIG_ATMEL_SECURE_PM)
 extern void __init at91rm9200_pm_init(void);
 extern void __init at91sam9_pm_init(void);
 extern void __init sam9x60_pm_init(void);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] ARM: at91: pm: move "atmel.pm_modes" parsing into a common file
  2022-02-22 15:08 ` [PATCH 2/4] ARM: at91: pm: move "atmel.pm_modes" parsing into a common file Clément Léger
@ 2022-02-22 23:41   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2022-02-22 23:41 UTC (permalink / raw)
  To: Clément Léger, Russell King, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches
  Cc: kbuild-all, linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

Hi "Clément,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on arm/for-next abelloni/rtc-next linus/master v5.17-rc5 next-20220217]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cl-ment-L-ger/ARM-at91-add-support-for-secure-suspend-on-sama5d2/20220222-231305
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: arm-multi_v4t_defconfig (https://download.01.org/0day-ci/archive/20220223/202202230722.7V2NTBn5-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2f5afeeacfd5e7985d4ef768c9a3f2b430fe3fa3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cl-ment-L-ger/ARM-at91-add-support-for-secure-suspend-on-sama5d2/20220222-231305
        git checkout 2f5afeeacfd5e7985d4ef768c9a3f2b430fe3fa3
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> WARNING: modpost: vmlinux.o(.text+0xb79c): Section mismatch in reference from the function at91_pm_common_modes_select() to the (unknown reference) .init.rodata:(unknown)
The function at91_pm_common_modes_select() references
the (unknown reference) __initconst (unknown).
This is often because at91_pm_common_modes_select lacks a __initconst
annotation or the annotation of (unknown) is wrong.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend
  2022-02-22 15:08 ` [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend Clément Léger
@ 2022-02-23  5:50   ` kernel test robot
  2022-02-23  9:15   ` kernel test robot
  1 sibling, 0 replies; 9+ messages in thread
From: kernel test robot @ 2022-02-23  5:50 UTC (permalink / raw)
  To: Clément Léger, Russell King, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches
  Cc: kbuild-all, linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

Hi "Clément,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on soc/for-next]
[also build test WARNING on arm/for-next abelloni/rtc-next linus/master v5.17-rc5 next-20220217]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cl-ment-L-ger/ARM-at91-add-support-for-secure-suspend-on-sama5d2/20220222-231305
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20220223/202202231329.2hzbFwiR-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e7f524a6f3693c0e84b0258766c98a24046c9ba1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cl-ment-L-ger/ARM-at91-add-support-for-secure-suspend-on-sama5d2/20220222-231305
        git checkout e7f524a6f3693c0e84b0258766c98a24046c9ba1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> arch/arm/mach-at91/pm_secure.c:50:5: warning: no previous prototype for 'at91_suspend_entering_slow_clock' [-Wmissing-prototypes]
      50 | int at91_suspend_entering_slow_clock(void)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ATMEL_PM
   Depends on ARCH_AT91 && !ATMEL_SECURE_PM
   Selected by
   - SOC_SAMA7 && ARCH_AT91 && PM


vim +/at91_suspend_entering_slow_clock +50 arch/arm/mach-at91/pm_secure.c

    49	
  > 50	int at91_suspend_entering_slow_clock(void)
    51	{
    52		return (suspend_mode >= AT91_PM_ULP0);
    53	}
    54	EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
    55	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend
  2022-02-22 15:08 ` [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend Clément Léger
  2022-02-23  5:50   ` kernel test robot
@ 2022-02-23  9:15   ` kernel test robot
  2022-02-23  9:30     ` Clément Léger
  1 sibling, 1 reply; 9+ messages in thread
From: kernel test robot @ 2022-02-23  9:15 UTC (permalink / raw)
  To: Clément Léger, Russell King, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches
  Cc: kbuild-all, linux-arm-kernel, linux-kernel, Thomas Petazzoni,
	Clément Léger

Hi "Clément,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on soc/for-next]
[also build test ERROR on abelloni/rtc-next linus/master v5.17-rc5 next-20220222]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cl-ment-L-ger/ARM-at91-add-support-for-secure-suspend-on-sama5d2/20220222-231305
base:   https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20220223/202202231708.CAFCHZIn-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/e7f524a6f3693c0e84b0258766c98a24046c9ba1
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cl-ment-L-ger/ARM-at91-add-support-for-secure-suspend-on-sama5d2/20220222-231305
        git checkout e7f524a6f3693c0e84b0258766c98a24046c9ba1
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arm-linux-gnueabi-ld: arch/arm/mach-at91/pm_secure.o: in function `sama5_pm_init':
>> (.init.text+0x10c): multiple definition of `sama5_pm_init'; arch/arm/mach-at91/pm.o:(.init.text+0x1b58): first defined here
   arm-linux-gnueabi-ld: arch/arm/mach-at91/pm_secure.o: in function `sama5d2_pm_init':
>> (.init.text+0x160): multiple definition of `sama5d2_pm_init'; arch/arm/mach-at91/pm.o:(.init.text+0x1c0c): first defined here
   arm-linux-gnueabi-ld: arch/arm/mach-at91/pm_secure.o: in function `at91_suspend_entering_slow_clock':
>> (.text+0x0): multiple definition of `at91_suspend_entering_slow_clock'; arch/arm/mach-at91/pm.o:(.text+0x80): first defined here

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for ATMEL_PM
   Depends on ARCH_AT91 && !ATMEL_SECURE_PM
   Selected by
   - SOC_SAMA7 && ARCH_AT91 && PM

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend
  2022-02-23  9:15   ` kernel test robot
@ 2022-02-23  9:30     ` Clément Léger
  0 siblings, 0 replies; 9+ messages in thread
From: Clément Léger @ 2022-02-23  9:30 UTC (permalink / raw)
  To: kernel test robot
  Cc: Russell King, Nicolas Ferre, Alexandre Belloni,
	Ludovic Desroches, kbuild-all, linux-arm-kernel, linux-kernel,
	Thomas Petazzoni

Le Wed, 23 Feb 2022 17:15:44 +0800,
kernel test robot <lkp@intel.com> a écrit :

>    arm-linux-gnueabi-ld: arch/arm/mach-at91/pm_secure.o: in function `sama5_pm_init':
> >> (.init.text+0x10c): multiple definition of `sama5_pm_init'; arch/arm/mach-at91/pm.o:(.init.text+0x1b58): first defined here  
>    arm-linux-gnueabi-ld: arch/arm/mach-at91/pm_secure.o: in function `sama5d2_pm_init':
> >> (.init.text+0x160): multiple definition of `sama5d2_pm_init'; arch/arm/mach-at91/pm.o:(.init.text+0x1c0c): first defined here  
>    arm-linux-gnueabi-ld: arch/arm/mach-at91/pm_secure.o: in function `at91_suspend_entering_slow_clock':
> >> (.text+0x0): multiple definition of `at91_suspend_entering_slow_clock'; arch/arm/mach-at91/pm.o:(.text+0x80): first defined here  
> 
> Kconfig warnings: (for reference only)
>    WARNING: unmet direct dependencies detected for ATMEL_PM
>    Depends on ARCH_AT91 && !ATMEL_SECURE_PM
>    Selected by
>    - SOC_SAMA7 && ARCH_AT91 && PM

Actually, using mutually exclusive option for ATMEL_PM and
ATMEL_SECURE_PM does not seems to fit this really well. I guess it
would be better to integrate secure PM handling inside existing PM.c
code.

-- 
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-23  9:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 15:08 [PATCH 0/4] ARM: at91: add support for secure suspend on sama5d2 Clément Léger
2022-02-22 15:08 ` [PATCH 1/4] ARM: at91: add code to handle secure calls Clément Léger
2022-02-22 15:08 ` [PATCH 2/4] ARM: at91: pm: move "atmel.pm_modes" parsing into a common file Clément Léger
2022-02-22 23:41   ` kernel test robot
2022-02-22 15:08 ` [PATCH 3/4] ARM: at91: pm: add support for sama5d2 secure suspend Clément Léger
2022-02-23  5:50   ` kernel test robot
2022-02-23  9:15   ` kernel test robot
2022-02-23  9:30     ` Clément Léger
2022-02-22 15:08 ` [PATCH 4/4] ARM: at91: pm: fix defines to select *_pm_init functions Clément Léger

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).