Skip to contentSkip to conversation

Restore big.LITTLE cpuidle driver for Exynos

PATCH Applied Marek Szyprowski 6 participants 26 messages Jun 16, 2020 – Aug 24, 2020 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20200616081248eucas1p168faa343ce333a28c8fd3cf9a6a58b3c@eucas1p1.samsung.com

#1 lore raw

cover Restore big.LITTLE cpuidle driver for Exynos

The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked only on those boards.

However, support for it was broken by the commit 833b5794e330 ("ARM:
EXYNOS: reset Little cores when cpu is up") and then never enabled in the exynos_defconfig. This patchset provides the needed fix to the common code and restores support for it. Thanks to Lukasz Luba who motivated me to take a look into this issue.

Best regards
Marek Szyprowski
Samsung R&D Institute Poland

Patch summary:

Marek Szyprowski (4):
ARM: exynos: Apply little core workaround only under secure firmware
cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks
ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver
ARM: multi_v7_defconfig: Enable big.LITTLE cpuidle driver

 arch/arm/configs/exynos_defconfig    |  1 +
 arch/arm/configs/multi_v7_defconfig  |  1 +
 arch/arm/mach-exynos/mcpm-exynos.c   | 10 +++++++---
 drivers/cpuidle/cpuidle-big_little.c |  3 +--
 4 files changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/4 ARM: exynos: Apply little core workaround only under secure firmware

The additional soft-reset call during little core power up was needed to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks).

Apply the workaround only when board is running under secure firmware.

Fixes 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up")
---
 arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-exynos/mcpm-exynos.c +7 -3
index 9a681b421ae1..cd861c57d5ad 100644
@@ -26,6 +26,7 @@
 #define EXYNOS5420_USE_L2_COMMON_UP_STATE	BIT(30)
 
 static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
 
 /*
  * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
 static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
 {
 	unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);
+	bool state;
 
 	pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
 	if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
 		cluster >= EXYNOS5420_NR_CLUSTERS)
 		return -EINVAL;
 
-	if (!exynos_cpu_power_state(cpunr)) {
-		exynos_cpu_power_up(cpunr);
-
+	state = exynos_cpu_power_state(cpunr);
+	exynos_cpu_power_up(cpunr);
+	if (!state && secure_firmware) {
 		/*
 		 * This assumes the cluster number of the big cores(Cortex A15)
 		 * is 0 and the Little cores(Cortex A7) is 1.
@@ -258,6 +260,8 @@ static int __init exynos_mcpm_init(void)
 		return -ENOMEM;
 	}
 
+	secure_firmware = exynos_secure_firmware_available();
+
 	/*
 	 * To increase the stability of KFC reset we need to program
 	 * the PMU SPARE3 register
Signature · 1 line
2.17.1
#3 lore raw

Re: [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware

Hi Marek,

I've give it a try with hotplug torture tests and has only one a minor comment.

Quoted 32 lines · Marek Szyprowski

The additional soft-reset call during little core power up was needed to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks).

Apply the workaround only when board is running under secure firmware.

Fixes 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up")
---
  arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
  1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
index 9a681b421ae1..cd861c57d5ad 100644
@@ -26,6 +26,7 @@
  #define EXYNOS5420_USE_L2_COMMON_UP_STATE	BIT(30)
 
  static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
 
  /*
   * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
  static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
  {
  	unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);
+	bool state;
 

arch/arm/mach-exynos/mcpm-exynos.c static void __iomem *ns_sram_base_addr __ro_after_init; · line 70

Quoted 10 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -3
  	pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
  	if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
  		cluster >= EXYNOS5420_NR_CLUSTERS)
  		return -EINVAL;
 
-	if (!exynos_cpu_power_state(cpunr)) {
-		exynos_cpu_power_up(cpunr);
-
+	state = exynos_cpu_power_state(cpunr);
+	exynos_cpu_power_up(cpunr);

I can see that you have moved this call up, probably to avoid more 'if-else' stuff. I just wanted to notify you that this function 'exynos_cpu_powerup' is called twice when cpu is going up:
1. by the already running cpu i.e. CPU0 and the 'state' is 0 for i.e. CPU2
2. by the newly starting cpu i.e. CPU2 by running 'secondary_start_kernel' and the state is 3.

In this scenario the 'exynos_cpu_power_up' will be called twice. I have checked in hotplug that this is not causing any issues, but thought maybe it's worth share it with you. Maybe you can double check in TRM that this is not causing anything.

Quoted 6 lines
arch/arm/mach-exynos/mcpm-exynos.c +1 -0
+	if (!state && secure_firmware) {
  		/*
  		 * This assumes the cluster number of the big cores(Cortex A15)
  		 * is 0 and the Little cores(Cortex A7) is 1.

arch/arm/mach-exynos/mcpm-exynos.c static int __init exynos_mcpm_init(void) · line 267

Quoted 8 lines
arch/arm/mach-exynos/mcpm-exynos.c +2 -0
@@ -258,6 +260,8 @@ static int __init exynos_mcpm_init(void)
  		return -ENOMEM;
  	}
 
+	secure_firmware = exynos_secure_firmware_available();
+
  	/*
  	 * To increase the stability of KFC reset we need to program
  	 * the PMU SPARE3 register

Other than that, the patch set looks good to me.

Regards,
Lukasz

#4 lore raw

Re: [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware

Quoted 15 lines · Lukasz Luba

Hi Marek,

I've give it a try with hotplug torture tests and has only one a minor comment.

Quoted 9 lines · Marek Szyprowski

The additional soft-reset call during little core power up was needed to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks).

Apply the workaround only when board is running under secure firmware.

Fixes 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up")

Fix the Fixes tag (in case of resend, otherwise I'll do it).

Quoted 38 lines
Quoted 19 lines
---
  arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
  1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-exynos/mcpm-exynos.c +1 -0
index 9a681b421ae1..cd861c57d5ad 100644
@@ -26,6 +26,7 @@
  #define EXYNOS5420_USE_L2_COMMON_UP_STATE	BIT(30)
  static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
  /*
   * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
  static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
  {
  	unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);

arch/arm/mach-exynos/mcpm-exynos.c static void __iomem *ns_sram_base_addr __ro_after_init; · line 68

Quoted 10 lines
arch/arm/mach-exynos/mcpm-exynos.c +3 -3
+	bool state;
  	pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
  	if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
  		cluster >= EXYNOS5420_NR_CLUSTERS)
  		return -EINVAL;
-	if (!exynos_cpu_power_state(cpunr)) {
-		exynos_cpu_power_up(cpunr);
-
+	state = exynos_cpu_power_state(cpunr);
+	exynos_cpu_power_up(cpunr);

I can see that you have moved this call up, probably to avoid more 'if-else' stuff. I just wanted to notify you that this function 'exynos_cpu_powerup' is called twice when cpu is going up:
1. by the already running cpu i.e. CPU0 and the 'state' is 0 for i.e. CPU2
2. by the newly starting cpu i.e. CPU2 by running 'secondary_start_kernel' and the state is 3.

Quoted 4 lines

In this scenario the 'exynos_cpu_power_up' will be called twice. I have checked in hotplug that this is not causing any issues, but thought maybe it's worth share it with you. Maybe you can double check in TRM that this is not causing anything.

This brings the old code, before 833b5794e33. I wonder why? I understood that only soft-reset should be skipped.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware

Hi Krzysztof,

Quoted 53 lines · Krzysztof Kozlowski
Quoted 13 lines · Lukasz Luba

I've give it a try with hotplug torture tests and has only one a minor comment.

Quoted 9 lines · Marek Szyprowski

The additional soft-reset call during little core power up was needed to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks).

Apply the workaround only when board is running under secure firmware.

Fixes 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up")

Fix the Fixes tag (in case of resend, otherwise I'll do it).

Quoted 37 lines
Quoted 19 lines
---
   arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
   1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-exynos/mcpm-exynos.c +1 -0
index 9a681b421ae1..cd861c57d5ad 100644
@@ -26,6 +26,7 @@
   #define EXYNOS5420_USE_L2_COMMON_UP_STATE	BIT(30)
   static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
   /*
    * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
   static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
   {
   	unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);

arch/arm/mach-exynos/mcpm-exynos.c static void __iomem *ns_sram_base_addr __ro_after_init; · line 68

Quoted 10 lines
arch/arm/mach-exynos/mcpm-exynos.c +3 -3
+	bool state;
   	pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
   	if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
   		cluster >= EXYNOS5420_NR_CLUSTERS)
   		return -EINVAL;
-	if (!exynos_cpu_power_state(cpunr)) {
-		exynos_cpu_power_up(cpunr);
-
+	state = exynos_cpu_power_state(cpunr);
+	exynos_cpu_power_up(cpunr);

I can see that you have moved this call up, probably to avoid more 'if-else' stuff. I just wanted to notify you that this function 'exynos_cpu_powerup' is called twice when cpu is going up:
1. by the already running cpu i.e. CPU0 and the 'state' is 0 for i.e. CPU2
2. by the newly starting cpu i.e. CPU2 by running 'secondary_start_kernel' and the state is 3.

Quoted 6 lines
Quoted 4 lines

In this scenario the 'exynos_cpu_power_up' will be called twice. I have checked in hotplug that this is not causing any issues, but thought maybe it's worth share it with you. Maybe you can double check in TRM that this is not causing anything.

This brings the old code, before 833b5794e33. I wonder why? I understood that only soft-reset should be skipped.

Because otherwise the Peach boards hangs during the cpuidle. I didn't analyze the code that much to judge if it is really necessary in all cases, I only restored what worked initially. I can add a comment about that to the commit log if needed.

Best regards

Signature · 8 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#6 lore raw

Re: [PATCH 1/4] ARM: exynos: Apply little core workaround only under secure firmware

Quoted 60 lines · Marek Szyprowski

Hi Krzysztof,

Quoted 57 lines · Krzysztof Kozlowski
Quoted 13 lines · Lukasz Luba

I've give it a try with hotplug torture tests and has only one a minor comment.

Quoted 9 lines · Marek Szyprowski

The additional soft-reset call during little core power up was needed to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks).

Apply the workaround only when board is running under secure firmware.

Fixes 833b 5794 e330 ("ARM: EXYNOS: reset Little cores when cpu is up")

Fix the Fixes tag (in case of resend, otherwise I'll do it).

Quoted 41 lines
Quoted 19 lines
---
   arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
   1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-exynos/mcpm-exynos.c +1 -0
index 9a681b421ae1..cd861c57d5ad 100644
@@ -26,6 +26,7 @@
   #define EXYNOS5420_USE_L2_COMMON_UP_STATE	BIT(30)
   static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
   /*
    * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
   static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
   {
   	unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);

arch/arm/mach-exynos/mcpm-exynos.c static void __iomem *ns_sram_base_addr __ro_after_init; · line 68

Quoted 10 lines
arch/arm/mach-exynos/mcpm-exynos.c +3 -3
+	bool state;
   	pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
   	if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
   		cluster >= EXYNOS5420_NR_CLUSTERS)
   		return -EINVAL;
-	if (!exynos_cpu_power_state(cpunr)) {
-		exynos_cpu_power_up(cpunr);
-
+	state = exynos_cpu_power_state(cpunr);
+	exynos_cpu_power_up(cpunr);

I can see that you have moved this call up, probably to avoid more 'if-else' stuff. I just wanted to notify you that this function 'exynos_cpu_powerup' is called twice when cpu is going up:
1. by the already running cpu i.e. CPU0 and the 'state' is 0 for i.e. CPU2
2. by the newly starting cpu i.e. CPU2 by running 'secondary_start_kernel' and the state is 3.

In this scenario the 'exynos_cpu_power_up' will be called twice. I have checked in hotplug that this is not causing any issues, but thought maybe it's worth share it with you. Maybe you can double check in TRM that this is not causing anything.

Quoted 7 lines
Quoted 2 lines

This brings the old code, before 833b5794e33. I wonder why? I understood that only soft-reset should be skipped.

Because otherwise the Peach boards hangs during the cpuidle. I didn't analyze the code that much to judge if it is really necessary in all cases, I only restored what worked initially. I can add a comment about that to the commit log if needed.

Yes, please mention this in commit msg.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#7 lore raw

PATCH v2 1/4 ARM: exynos: MCPM: Restore big.LITTLE cpuidle support

Call exynos_cpu_power_up(cpunr) unconditionally. This is needed by the big.LITTLE cpuidle driver and has no side-effects on other code paths.

The additional soft-reset call during little core power up has been added to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks). Apply the workaround only when board is running under secure firmware.

Fixes 833b5794e330 ("ARM: EXYNOS: reset Little cores when cpu is up")

---
v2:
- adjusted patch subject to better describe the change
- added a comment about exynos_cpu_power_up(cpunr) call

---
 arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
arch/arm/mach-exynos/mcpm-exynos.c +7 -3
index 9a681b421ae1..cd861c57d5ad 100644
@@ -26,6 +26,7 @@
 #define EXYNOS5420_USE_L2_COMMON_UP_STATE	BIT(30)
 
 static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
 
 /*
  * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
 static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
 {
 	unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);
+	bool state;
 
 	pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
 	if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
 		cluster >= EXYNOS5420_NR_CLUSTERS)
 		return -EINVAL;
 
-	if (!exynos_cpu_power_state(cpunr)) {
-		exynos_cpu_power_up(cpunr);
-
+	state = exynos_cpu_power_state(cpunr);
+	exynos_cpu_power_up(cpunr);
+	if (!state && secure_firmware) {
 		/*
 		 * This assumes the cluster number of the big cores(Cortex A15)
 		 * is 0 and the Little cores(Cortex A7) is 1.
@@ -258,6 +260,8 @@ static int __init exynos_mcpm_init(void)
 		return -ENOMEM;
 	}
 
+	secure_firmware = exynos_secure_firmware_available();
+
 	/*
 	 * To increase the stability of KFC reset we need to program
 	 * the PMU SPARE3 register
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v2 1/4
#8 lore raw

Re: [PATCH v2 1/4] ARM: exynos: MCPM: Restore big.LITTLE cpuidle support

Quoted 10 lines · Marek Szyprowski

Call exynos_cpu_power_up(cpunr) unconditionally. This is needed by the big.LITTLE cpuidle driver and has no side-effects on other code paths.

The additional soft-reset call during little core power up has been added to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks). Apply the workaround only when board is running under secure firmware.

Quoted 7 lines
Fixes 833b5794e330 ("ARM: EXYNOS: reset Little cores when cpu is up")

---
v2:
- adjusted patch subject to better describe the change
- added a comment about exynos_cpu_power_up(cpunr) call
---

Regards,
Lukasz

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer Applied
#9 lore raw

Re: [PATCH v2 1/4] ARM: exynos: MCPM: Restore big.LITTLE cpuidle support

In reply to Marek Szyprowski
Quoted 12 lines · Marek Szyprowski

Call exynos_cpu_power_up(cpunr) unconditionally. This is needed by the big.LITTLE cpuidle driver and has no side-effects on other code paths.

The additional soft-reset call during little core power up has been added to properly boot all cores on the Exynos5422-based boards with secure firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE CPUidle driver, which worked only on boards without secure firmware (like Peach-Pit/Pi Chromebooks). Apply the workaround only when board is running under secure firmware.

Fixes 833b5794e330 ("ARM: EXYNOS: reset Little cores when cpu is up")
Quoted 7 lines

---
v2:
- adjusted patch subject to better describe the change
- added a comment about exynos_cpu_power_up(cpunr) call

---
 arch/arm/mach-exynos/mcpm-exynos.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Thanks, applied (but somehow your patch did not make it to the linux-samsung-soc list).

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#10 lore raw

PATCH 2/4 cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

In reply to Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

---
 drivers/cpuidle/cpuidle-big_little.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cpuidle/cpuidle-big_little.c +1 -2
index 7f8ddc04342d..abe51185f243 100644
@@ -155,8 +155,7 @@ static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int part_id)
 
 static const struct of_device_id compatible_machine_match[] = {
 	{ .compatible = "arm,vexpress,v2p-ca15_a7" },
-	{ .compatible = "samsung,exynos5420" },
-	{ .compatible = "samsung,exynos5800" },
+	{ .compatible = "google,peach" },
 	{},
 };
 
Signature · 1 line
2.17.1
maintainer Acked-by on v1 2/4
#11 lore raw

Re: [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

Quoted 11 lines · Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

---
 drivers/cpuidle/cpuidle-big_little.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Best regards,
Krzysztof

Reviewed-by on v1 2/4
#12 lore raw

Re: [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

In reply to Marek Szyprowski
Quoted 8 lines · Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 19 lines
---
 drivers/cpuidle/cpuidle-big_little.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cpuidle/cpuidle-big_little.c +1 -2
index 7f8ddc04342d..abe51185f243 100644
@@ -155,8 +155,7 @@ static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int part_id)
 
 static const struct of_device_id compatible_machine_match[] = {
 	{ .compatible = "arm,vexpress,v2p-ca15_a7" },
-	{ .compatible = "samsung,exynos5420" },
-	{ .compatible = "samsung,exynos5800" },
+	{ .compatible = "google,peach" },
 	{},
 };
 
maintainer Applied
#13 lore raw

Re: [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

Quoted 9 lines · Bartlomiej Zolnierkiewicz
Quoted 7 lines · Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

Quoted 3 lines
Quoted 1 line

This patch waited on list for almost two months and was not picked up. Therefore I'll take it for v5.10.

Thanks, applied.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#14 lore raw

Re: [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · Bartlomiej Zolnierkiewicz
Quoted 7 lines · Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

This patch waited on list for almost two months and was not picked up. Therefore I'll take it for v5.10.

It happens some patches can fall into the cracks, especially when we are fully busy with a peak of work. Also, we have filters in our mailers which are not perfect. A gentle ping is enough to ask to pay attention to the series.

I can understand that is annoying, but preemptively pick the patch is not adequate.

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#15 lore raw

Re: [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

Quoted 18 lines · Daniel Lezcano
Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · Bartlomiej Zolnierkiewicz
Quoted 7 lines · Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

This patch waited on list for almost two months and was not picked up. Therefore I'll take it for v5.10.

Quoted 7 lines

It happens some patches can fall into the cracks, especially when we are fully busy with a peak of work. Also, we have filters in our mailers which are not perfect. A gentle ping is enough to ask to pay attention to the series.

I can understand that is annoying, but preemptively pick the patch is not adequate.

I apologize if my message was harsh or sounded rude. That was not my intention.

I understand that patches soometimes got missed. That's life. This patch here is quite simple, non-intrusive, got independent ack. Also in the past SoC-specific drivers were sometimes going through SoC tree (so in this case - mine for Samsung). Patch also blocks the dependant DT change (for entire cycle). Therefore I guessed that it won't be a problem and it is just simpler to apply it.

If it is an issue, I can drop it and rebase my branch.

Best regards,
Krzysztof

#16 lore raw

Re: [PATCH 2/4] cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks

Quoted 24 lines · Krzysztof Kozlowski
Quoted 23 lines · Daniel Lezcano
Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · Bartlomiej Zolnierkiewicz
Quoted 7 lines · Marek Szyprowski

This driver always worked properly only on the Exynos 5420/5800 based Chromebooks (Peach-Pit/Pi), so change the required compatible string to the 'google,peach', to avoid enabling it on the other Exynos 542x/5800 boards, which hangs in such case. The main difference between Peach-Pit/Pi and other Exynos 542x/5800 boards is the firmware - Peach platform doesn't use secure firmware at all.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

This patch waited on list for almost two months and was not picked up. Therefore I'll take it for v5.10.

It happens some patches can fall into the cracks, especially when we are fully busy with a peak of work. Also, we have filters in our mailers which are not perfect. A gentle ping is enough to ask to pay attention to the series.

Quoted 5 lines
Quoted 2 lines

I can understand that is annoying, but preemptively pick the patch is not adequate.

I apologize if my message was harsh or sounded rude. That was not my intention.

No worries.

Quoted 8 lines

I understand that patches soometimes got missed. That's life. This patch here is quite simple, non-intrusive, got independent ack. Also in the past SoC-specific drivers were sometimes going through SoC tree (so in this case - mine for Samsung). Patch also blocks the dependant DT change (for entire cycle). Therefore I guessed that it won't be a problem and it is just simpler to apply it.

If it is an issue, I can drop it and rebase my branch.

It is fine if you can add my ack.

Thanks

-- Daniel

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#17 lore raw

PATCH 3/4 ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver

In reply to Marek Szyprowski

Enable big.LITTLE cpuidle driver, which can be used on Exynos-based Peach Pit/Pi Chromebooks.

---
 arch/arm/configs/exynos_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/exynos_defconfig +1 -0
index 374fbff8eaa6..c928bc710c48 100644
@@ -28,6 +28,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
 CONFIG_CPUFREQ_DT=y
 CONFIG_CPU_IDLE=y
+CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
Signature · 1 line
2.17.1
#18 lore raw

Re: [PATCH 3/4] ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver

Quoted 7 lines · Marek Szyprowski

Enable big.LITTLE cpuidle driver, which can be used on Exynos-based Peach Pit/Pi Chromebooks.

---
 arch/arm/configs/exynos_defconfig | 1 +
 1 file changed, 1 insertion(+)

I guess this should be enabled after adjusting the compatibles in patch 2/4? If yes, then it will have to wait.

Best regards,
Krzysztof

Quoted 16 lines
arch/arm/configs/exynos_defconfig +1 -0
index 374fbff8eaa6..c928bc710c48 100644
@@ -28,6 +28,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
 CONFIG_CPUFREQ_DT=y
 CONFIG_CPU_IDLE=y
+CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
Signature · 1 line
2.17.1
#19 lore raw

Re: [PATCH 3/4] ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver

Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Marek Szyprowski

Enable big.LITTLE cpuidle driver, which can be used on Exynos-based Peach Pit/Pi Chromebooks.

---
  arch/arm/configs/exynos_defconfig | 1 +
  1 file changed, 1 insertion(+)

I guess this should be enabled after adjusting the compatibles in patch 2/4? If yes, then it will have to wait.

Indeed, this one and multi_v7 patch have to wait one cycle to avoid breaking Odroid XU3/XU4 board family.

Best regards

Signature · 8 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 3/4
#20 lore raw

Re: [PATCH 3/4] ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver

In reply to Marek Szyprowski
Quoted 4 lines · Marek Szyprowski

Enable big.LITTLE cpuidle driver, which can be used on Exynos-based Peach Pit/Pi Chromebooks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 17 lines
---
 arch/arm/configs/exynos_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/exynos_defconfig +1 -0
index 374fbff8eaa6..c928bc710c48 100644
@@ -28,6 +28,7 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
 CONFIG_CPUFREQ_DT=y
 CONFIG_CPU_IDLE=y
+CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
#21 lore raw

PATCH 4/4 ARM: multi_v7_defconfig: Enable big.LITTLE cpuidle driver

In reply to Marek Szyprowski

Enable big.LITTLE cpuidle driver, which can be used on Exynos-based Peach Pit/Pi Chromebooks.

---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index 95543914d3c7..6a922a8ef712 100644
@@ -111,6 +111,7 @@ CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
 CONFIG_QORIQ_CPUFREQ=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
 CONFIG_ARM_ZYNQ_CPUIDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_ARM_TEGRA_CPUIDLE=y
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 4/4
#22 lore raw

Re: [PATCH 4/4] ARM: multi_v7_defconfig: Enable big.LITTLE cpuidle driver

Quoted 4 lines · Marek Szyprowski

Enable big.LITTLE cpuidle driver, which can be used on Exynos-based Peach Pit/Pi Chromebooks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 17 lines
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
index 95543914d3c7..6a922a8ef712 100644
@@ -111,6 +111,7 @@ CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
 CONFIG_QORIQ_CPUFREQ=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_BIG_LITTLE_CPUIDLE=y
 CONFIG_ARM_ZYNQ_CPUIDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_ARM_TEGRA_CPUIDLE=y
#23 lore raw
In reply to Marek Szyprowski

Hi Marek,

Quoted 11 lines · Marek Szyprowski

The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked only on those boards.

However, support for it was broken by the commit 833b5794e330 ("ARM:
EXYNOS: reset Little cores when cpu is up") and then never enabled in the exynos_defconfig. This patchset provides the needed fix to the common code and restores support for it. Thanks to Lukasz Luba who motivated me to take a look into this issue.

Thanks for this updates.

But I feel some DTS changes are missing for example d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT

But I feel that this feature is not working as desired since still some missing code changes for cluster idle states are missing. like clock PWR_CTR and PWR_CTRL2.

-Anand

Quoted 27 lines

Best regards
Marek Szyprowski
Samsung R&D Institute Poland

Patch summary:

Marek Szyprowski (4):
ARM: exynos: Apply little core workaround only under secure firmware
cpuidle: big.LITTLE: enable driver only on Peach-Pit/Pi Chromebooks
ARM: exynos_defconfig: Enable big.LITTLE cpuidle driver
ARM: multi_v7_defconfig: Enable big.LITTLE cpuidle driver

 arch/arm/configs/exynos_defconfig    |  1 +
 arch/arm/configs/multi_v7_defconfig  |  1 +
 arch/arm/mach-exynos/mcpm-exynos.c   | 10 +++++++---
 drivers/cpuidle/cpuidle-big_little.c |  3 +--
 4 files changed, 10 insertions(+), 5 deletions(-)

--
2.17.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#24 lore raw

Hi Anand,

Quoted 11 lines · Anand Moon
Quoted 10 lines · Marek Szyprowski

The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked only on those boards.

However, support for it was broken by the commit 833b5794e330 ("ARM:
EXYNOS: reset Little cores when cpu is up") and then never enabled in the exynos_defconfig. This patchset provides the needed fix to the common code and restores support for it. Thanks to Lukasz Luba who motivated me to take a look into this issue.

Quoted 4 lines

Thanks for this updates.

But I feel some DTS changes are missing for example d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT

This is not strictly needed. The bl-cpuidle matches also to the A7/A15 CPU product ids and it is properly instantiated on the Peach Pit/Pi Chromebooks. Those CPU DT properties were added as a future-proof generic solution. I won't hurt to add them though.

Quoted 3 lines

But I feel that this feature is not working as desired since still some missing code changes for cluster idle states are missing. like clock PWR_CTR and PWR_CTRL2.

I cannot judge now. All I can test now is a that the boards enters those idle states and system works stable. I cannot measure power consumption, because currently I have only remote access to the boards.

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#25 lore raw
Quoted 25 lines · Marek Szyprowski

Hi Anand,

Quoted 11 lines · Anand Moon
Quoted 10 lines · Marek Szyprowski

The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked only on those boards.

However, support for it was broken by the commit 833b5794e330 ("ARM:
EXYNOS: reset Little cores when cpu is up") and then never enabled in the exynos_defconfig. This patchset provides the needed fix to the common code and restores support for it. Thanks to Lukasz Luba who motivated me to take a look into this issue.

Quoted 4 lines

Thanks for this updates.

But I feel some DTS changes are missing for example d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT

This is not strictly needed. The bl-cpuidle matches also to the A7/A15 CPU product ids and it is properly instantiated on the Peach Pit/Pi Chromebooks. Those CPU DT properties were added as a future-proof generic solution. I won't hurt to add them though.

Quoted 7 lines
Quoted 3 lines

But I feel that this feature is not working as desired since still some missing code changes for cluster idle states are missing. like clock PWR_CTR and PWR_CTRL2.

I cannot judge now. All I can test now is a that the boards enters those idle states and system works stable. I cannot measure power consumption, because currently I have only remote access to the boards.

I agree with Marek. This can be done incrementally. The series fixes the code path which was working. After the investigation with a power meter, a proper set of new patches might come if needed.

As a hint to measure this power consumption difference, because it might be tricky, I would suggest to heat up the SoC. The main difference between wfi and deeper idle which cut the power to some components (like caches) should be seen at higher voltage OPP and higher temperature. It's due to the fact that static power (leakage) is related to Vdd and temperature -
higher voltage -> higher leakage
higher temp -> higher leakage
This difference (idle state 0 vs 1) should be amplified in the above scenario and easier to measure.

I am going to review this series after finishing hotplug tests.

Regards,
Lukasz

#26 lore raw
In reply to Marek Szyprowski

Hi Marek,

Quoted 17 lines · Marek Szyprowski

Hi Anand,

Quoted 13 lines · Anand Moon
Quoted 10 lines · Marek Szyprowski

The ARM big.LITTLE cpuidle driver has been enabled and tested on Samsung Exynos 5420/5800 based Peach Pit/Pi Chromebooks and in fact it worked only on those boards.

However, support for it was broken by the commit 833b5794e330 ("ARM:
EXYNOS: reset Little cores when cpu is up") and then never enabled in the exynos_defconfig. This patchset provides the needed fix to the common code and restores support for it. Thanks to Lukasz Luba who motivated me to take a look into this issue.

Thanks for this updates.

Quoted 8 lines
Quoted 2 lines

But I feel some DTS changes are missing for example d2e5c871ed8a drivers: cpuidle: initialize big.LITTLE driver through DT

This is not strictly needed. The bl-cpuidle matches also to the A7/A15 CPU product ids and it is properly instantiated on the Peach Pit/Pi Chromebooks. Those CPU DT properties were added as a future-proof generic solution. I won't hurt to add them though.

Ok Thanks.

Quoted 8 lines
Quoted 3 lines

But I feel that this feature is not working as desired since still some missing code changes for cluster idle states are missing. like clock PWR_CTR and PWR_CTRL2.

I cannot judge now. All I can test now is a that the boards enters those idle states and system works stable. I cannot measure power consumption, because currently I have only remote access to the boards.

Ok, Thanks.

What I meant was in order to cpu cluster to enter into IDLE states, it's controlled by the EXYNOS5422_PWR_CTRL and EXYNOS5422_PWR_CTRL2 clk fields See below example from the Exynos5422 cpu idle driver.

[0] https://github.com/hardkernel/linux/blob/odroidxu3-3.10.y/arch/arm/mach-exynos/cpuidle-exynos5422.c#L319-L379

Just link Exynos5250 clk driver we need to Initialize PWR_CTRL and PWR_CTRL2 for Exynos542x clocks

[1] https://github.com/torvalds/linux/blob/master/drivers/clk/samsung/clk-exynos5250.c#L828-L846

which will help support cpu idle drivers.

-Anand