All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ARM: actions: Put OF nodes after use
@ 2018-12-11  8:07 Linus Walleij
  2018-12-11  8:07 ` [PATCH 2/5] ARM: actions: Localize some variables Linus Walleij
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Linus Walleij @ 2018-12-11  8:07 UTC (permalink / raw)
  To: Andreas Färber, Manivannan Sadhasivam
  Cc: Linus Walleij, linux-arm-kernel

After using of_find_compatible_node() we need to issue
of_node_put() on the node to keep refcount.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-actions/platsmp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index 3efaa10efc43..02d17ed0ca31 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -122,6 +122,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 	}
 
 	timer_base_addr = of_iomap(node, 0);
+	of_node_put(node);
 	if (!timer_base_addr) {
 		pr_err("%s: could not map timer registers\n", __func__);
 		return;
@@ -134,6 +135,8 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 	}
 
 	sps_base_addr = of_iomap(node, 0);
+	of_node_put(node);
+
 	if (!sps_base_addr) {
 		pr_err("%s: could not map sps registers\n", __func__);
 		return;
@@ -147,6 +150,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 		}
 
 		scu_base_addr = of_iomap(node, 0);
+		of_node_put(node);
 		if (!scu_base_addr) {
 			pr_err("%s: could not map scu registers\n", __func__);
 			return;
-- 
2.19.2


_______________________________________________
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] 13+ messages in thread

* [PATCH 2/5] ARM: actions: Localize some variables
  2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
@ 2018-12-11  8:07 ` Linus Walleij
  2018-12-12 11:18   ` Russell King - ARM Linux
  2018-12-18 19:35   ` Andreas Färber
  2018-12-11  8:07 ` [PATCH 3/5] ARM: actions: Drop unused function Linus Walleij
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 13+ messages in thread
From: Linus Walleij @ 2018-12-11  8:07 UTC (permalink / raw)
  To: Andreas Färber, Manivannan Sadhasivam
  Cc: Linus Walleij, linux-arm-kernel

The ncores and scu_base_addr variables are only used
inside s500_smp_prepare_cpus() so no need to have them
static local.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-actions/platsmp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index 02d17ed0ca31..98fbcaa764a5 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -34,11 +34,8 @@
 #define OWL_SPS_PG_CTL_ACK_CPU2	BIT(21)
 #define OWL_SPS_PG_CTL_ACK_CPU3	BIT(22)
 
-static void __iomem *scu_base_addr;
 static void __iomem *sps_base_addr;
 static void __iomem *timer_base_addr;
-static int ncores;
-
 static DEFINE_SPINLOCK(boot_lock);
 
 void owl_secondary_startup(void);
@@ -113,7 +110,9 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 {
+	static void __iomem *scu_base_addr;
 	struct device_node *node;
+	static int ncores;
 
 	node = of_find_compatible_node(NULL, NULL, "actions,s500-timer");
 	if (!node) {
-- 
2.19.2


_______________________________________________
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] 13+ messages in thread

* [PATCH 3/5] ARM: actions: Drop unused function
  2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
  2018-12-11  8:07 ` [PATCH 2/5] ARM: actions: Localize some variables Linus Walleij
@ 2018-12-11  8:07 ` Linus Walleij
  2018-12-18 19:30   ` Andreas Färber
  2018-12-11  8:07 ` [PATCH 4/5] ARM: actions: Set possible CPUs from ncores Linus Walleij
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2018-12-11  8:07 UTC (permalink / raw)
  To: Andreas Färber, Manivannan Sadhasivam
  Cc: Linus Walleij, linux-arm-kernel

The owl_secondary_startup() prototype isn't used anywhere
and seems to be some development artifact.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-actions/platsmp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index 98fbcaa764a5..b66a768afedd 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -38,8 +38,6 @@ static void __iomem *sps_base_addr;
 static void __iomem *timer_base_addr;
 static DEFINE_SPINLOCK(boot_lock);
 
-void owl_secondary_startup(void);
-
 static int s500_wakeup_secondary(unsigned int cpu)
 {
 	int ret;
-- 
2.19.2


_______________________________________________
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] 13+ messages in thread

* [PATCH 4/5] ARM: actions: Set possible CPUs from ncores
  2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
  2018-12-11  8:07 ` [PATCH 2/5] ARM: actions: Localize some variables Linus Walleij
  2018-12-11  8:07 ` [PATCH 3/5] ARM: actions: Drop unused function Linus Walleij
@ 2018-12-11  8:07 ` Linus Walleij
  2018-12-12 11:21   ` Russell King - ARM Linux
  2018-12-11  8:07 ` [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot Linus Walleij
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2018-12-11  8:07 UTC (permalink / raw)
  To: Andreas Färber, Manivannan Sadhasivam
  Cc: Linus Walleij, linux-arm-kernel

The codes figured out how many cores the SCU is reporting
so let's say that these CPUs are usable.

Possibly this code is redundant to the device tree parsing
code looping over the CPUs in arch/arm/kernel/devtree.c
but most other platform do this and it looks coherent.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-actions/platsmp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index b66a768afedd..26ddc12ea4a7 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -111,6 +111,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 	static void __iomem *scu_base_addr;
 	struct device_node *node;
 	static int ncores;
+	int i;
 
 	node = of_find_compatible_node(NULL, NULL, "actions,s500-timer");
 	if (!node) {
@@ -162,6 +163,11 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 		pr_debug("%s: ncores %d\n", __func__, ncores);
 
 		scu_enable(scu_base_addr);
+
+		for (i = 0; i < ncores; i++)
+			set_cpu_possible(i, true);
+
+		iounmap(scu_base_addr);
 	}
 }
 
-- 
2.19.2


_______________________________________________
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] 13+ messages in thread

* [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot
  2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
                   ` (2 preceding siblings ...)
  2018-12-11  8:07 ` [PATCH 4/5] ARM: actions: Set possible CPUs from ncores Linus Walleij
@ 2018-12-11  8:07 ` Linus Walleij
  2018-12-12 11:30   ` Russell King - ARM Linux
  2018-12-11 13:02 ` [PATCH 1/5] ARM: actions: Put OF nodes after use Stefan Agner
  2018-12-18 19:49 ` Andreas Färber
  5 siblings, 1 reply; 13+ messages in thread
From: Linus Walleij @ 2018-12-11  8:07 UTC (permalink / raw)
  To: Andreas Färber, Manivannan Sadhasivam
  Cc: Linus Walleij, linux-arm-kernel

The Actions SMP boot contain some cargo cult code that
we need to get rid of: it uses a probably completely
unnecessary spinlock (the ARM core SMP code will lock
properly already) and tries to keep CPUs in the "pen"
(CPU enclosure) using the custom variable that should
only be used with ARM Versatile test chips.

Simply drop this and also remove the smp_send_reschedule()
that no other ARM machine is using to start a secondary
CPU and just send arch_send_wakeup_ipi_mask() to kick
secondary CPUs out of WFI.

Reported-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
This patch was made after talking to Russell about ARM
machines doing pointless "pen holding" and using
pointless boot locks. Would be great if you can test
if it simply works like this, make sure both CPUs
come up, I usually just start a few dummy processes
and cat /proc/interrupts to see that the different
CPUs are getting work done.
---
 arch/arm/mach-actions/platsmp.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index 26ddc12ea4a7..c19477fed340 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -36,7 +36,6 @@
 
 static void __iomem *sps_base_addr;
 static void __iomem *timer_base_addr;
-static DEFINE_SPINLOCK(boot_lock);
 
 static int s500_wakeup_secondary(unsigned int cpu)
 {
@@ -79,7 +78,6 @@ static int s500_wakeup_secondary(unsigned int cpu)
 
 static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
-	unsigned long timeout;
 	int ret;
 
 	ret = s500_wakeup_secondary(cpu);
@@ -88,20 +86,10 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 	udelay(10);
 
-	spin_lock(&boot_lock);
-
-	smp_send_reschedule(cpu);
-
-	timeout = jiffies + (1 * HZ);
-	while (time_before(jiffies, timeout)) {
-		if (pen_release == -1)
-			break;
-	}
-
 	writel(0, timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4);
 	writel(0, timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4);
 
-	spin_unlock(&boot_lock);
+	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 
 	return 0;
 }
-- 
2.19.2


_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 1/5] ARM: actions: Put OF nodes after use
  2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
                   ` (3 preceding siblings ...)
  2018-12-11  8:07 ` [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot Linus Walleij
@ 2018-12-11 13:02 ` Stefan Agner
  2018-12-18 19:49 ` Andreas Färber
  5 siblings, 0 replies; 13+ messages in thread
From: Stefan Agner @ 2018-12-11 13:02 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andreas Färber, linux-arm-kernel, Manivannan Sadhasivam

On 11.12.2018 09:07, Linus Walleij wrote:
> After using of_find_compatible_node() we need to issue
> of_node_put() on the node to keep refcount.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-actions/platsmp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
> index 3efaa10efc43..02d17ed0ca31 100644
> --- a/arch/arm/mach-actions/platsmp.c
> +++ b/arch/arm/mach-actions/platsmp.c
> @@ -122,6 +122,7 @@ static void __init s500_smp_prepare_cpus(unsigned
> int max_cpus)
>  	}
>  
>  	timer_base_addr = of_iomap(node, 0);
> +	of_node_put(node);
>  	if (!timer_base_addr) {
>  		pr_err("%s: could not map timer registers\n", __func__);
>  		return;
> @@ -134,6 +135,8 @@ static void __init s500_smp_prepare_cpus(unsigned
> int max_cpus)
>  	}
>  
>  	sps_base_addr = of_iomap(node, 0);
> +	of_node_put(node);
> +

Can you drop this newline to be consistent?

Otherwise looks good to me:

Reviewed-by: Stefan Agner <stefan@agner.ch>

>  	if (!sps_base_addr) {
>  		pr_err("%s: could not map sps registers\n", __func__);
>  		return;
> @@ -147,6 +150,7 @@ static void __init s500_smp_prepare_cpus(unsigned
> int max_cpus)
>  		}
>  
>  		scu_base_addr = of_iomap(node, 0);
> +		of_node_put(node);
>  		if (!scu_base_addr) {
>  			pr_err("%s: could not map scu registers\n", __func__);
>  			return;

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 2/5] ARM: actions: Localize some variables
  2018-12-11  8:07 ` [PATCH 2/5] ARM: actions: Localize some variables Linus Walleij
@ 2018-12-12 11:18   ` Russell King - ARM Linux
  2018-12-18 19:35   ` Andreas Färber
  1 sibling, 0 replies; 13+ messages in thread
From: Russell King - ARM Linux @ 2018-12-12 11:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andreas Färber, linux-arm-kernel, Manivannan Sadhasivam

On Tue, Dec 11, 2018 at 09:07:56AM +0100, Linus Walleij wrote:
> The ncores and scu_base_addr variables are only used
> inside s500_smp_prepare_cpus() so no need to have them
> static local.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-actions/platsmp.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
> index 02d17ed0ca31..98fbcaa764a5 100644
> --- a/arch/arm/mach-actions/platsmp.c
> +++ b/arch/arm/mach-actions/platsmp.c
> @@ -34,11 +34,8 @@
>  #define OWL_SPS_PG_CTL_ACK_CPU2	BIT(21)
>  #define OWL_SPS_PG_CTL_ACK_CPU3	BIT(22)
>  
> -static void __iomem *scu_base_addr;
>  static void __iomem *sps_base_addr;
>  static void __iomem *timer_base_addr;
> -static int ncores;
> -
>  static DEFINE_SPINLOCK(boot_lock);
>  
>  void owl_secondary_startup(void);
> @@ -113,7 +110,9 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  
>  static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
>  {
> +	static void __iomem *scu_base_addr;
>  	struct device_node *node;
> +	static int ncores;

Do these need to be static?  We only prepare once.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 4/5] ARM: actions: Set possible CPUs from ncores
  2018-12-11  8:07 ` [PATCH 4/5] ARM: actions: Set possible CPUs from ncores Linus Walleij
@ 2018-12-12 11:21   ` Russell King - ARM Linux
  0 siblings, 0 replies; 13+ messages in thread
From: Russell King - ARM Linux @ 2018-12-12 11:21 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andreas Färber, linux-arm-kernel, Manivannan Sadhasivam

On Tue, Dec 11, 2018 at 09:07:58AM +0100, Linus Walleij wrote:
> The codes figured out how many cores the SCU is reporting
> so let's say that these CPUs are usable.
> 
> Possibly this code is redundant to the device tree parsing
> code looping over the CPUs in arch/arm/kernel/devtree.c
> but most other platform do this and it looks coherent.

Maybe it's another cargo-cult issue - presumably the platform already
boots fine without this, so it is likely redundant.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot
  2018-12-11  8:07 ` [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot Linus Walleij
@ 2018-12-12 11:30   ` Russell King - ARM Linux
  2018-12-12 12:03     ` Linus Walleij
  0 siblings, 1 reply; 13+ messages in thread
From: Russell King - ARM Linux @ 2018-12-12 11:30 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andreas Färber, linux-arm-kernel, Manivannan Sadhasivam

On Tue, Dec 11, 2018 at 09:07:59AM +0100, Linus Walleij wrote:
> The Actions SMP boot contain some cargo cult code that
> we need to get rid of: it uses a probably completely
> unnecessary spinlock (the ARM core SMP code will lock
> properly already) and tries to keep CPUs in the "pen"
> (CPU enclosure) using the custom variable that should
> only be used with ARM Versatile test chips.
> 
> Simply drop this and also remove the smp_send_reschedule()
> that no other ARM machine is using to start a secondary
> CPU and just send arch_send_wakeup_ipi_mask() to kick
> secondary CPUs out of WFI.
> 
> Reported-by: Russell King <linux@armlinux.org.uk>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> This patch was made after talking to Russell about ARM
> machines doing pointless "pen holding" and using
> pointless boot locks. Would be great if you can test
> if it simply works like this, make sure both CPUs
> come up, I usually just start a few dummy processes
> and cat /proc/interrupts to see that the different
> CPUs are getting work done.

Provided it does work:

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>

Also, be sure to exercise the hotplug paths during testing, not
simply "does it still boot".

Thanks.

> ---
>  arch/arm/mach-actions/platsmp.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
> index 26ddc12ea4a7..c19477fed340 100644
> --- a/arch/arm/mach-actions/platsmp.c
> +++ b/arch/arm/mach-actions/platsmp.c
> @@ -36,7 +36,6 @@
>  
>  static void __iomem *sps_base_addr;
>  static void __iomem *timer_base_addr;
> -static DEFINE_SPINLOCK(boot_lock);
>  
>  static int s500_wakeup_secondary(unsigned int cpu)
>  {
> @@ -79,7 +78,6 @@ static int s500_wakeup_secondary(unsigned int cpu)
>  
>  static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  {
> -	unsigned long timeout;
>  	int ret;
>  
>  	ret = s500_wakeup_secondary(cpu);
> @@ -88,20 +86,10 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  
>  	udelay(10);
>  
> -	spin_lock(&boot_lock);
> -
> -	smp_send_reschedule(cpu);
> -
> -	timeout = jiffies + (1 * HZ);
> -	while (time_before(jiffies, timeout)) {
> -		if (pen_release == -1)
> -			break;
> -	}
> -
>  	writel(0, timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4);
>  	writel(0, timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4);
>  
> -	spin_unlock(&boot_lock);
> +	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
>  
>  	return 0;
>  }
> -- 
> 2.19.2
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot
  2018-12-12 11:30   ` Russell King - ARM Linux
@ 2018-12-12 12:03     ` Linus Walleij
  0 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2018-12-12 12:03 UTC (permalink / raw)
  To: Russell King; +Cc: Andreas Färber, Linux ARM, Manivannan Sadhasivam

On Wed, Dec 12, 2018 at 12:30 PM Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:

> Also, be sure to exercise the hotplug paths during testing, not
> simply "does it still boot".

Indeed. If the platform support suspend-to-ram then
echo mem > /sys/power/state
and then bring the system up again, as a specific
test that offlines all CPUs and then brings them back
online.

Yiyrs,
Linus Walleij

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 3/5] ARM: actions: Drop unused function
  2018-12-11  8:07 ` [PATCH 3/5] ARM: actions: Drop unused function Linus Walleij
@ 2018-12-18 19:30   ` Andreas Färber
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2018-12-18 19:30 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-actions, linux-arm-kernel, Manivannan Sadhasivam

Hi,

+ linux-actions

Am 11.12.18 um 09:07 schrieb Linus Walleij:
> The owl_secondary_startup() prototype isn't used anywhere
> and seems to be some development artifact.
> 

No, it's a leftover from a previous cleanup:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=6c2eb3e76fb84e2eb46d484f71fab469c0d9532c

Fixes: 6c2eb3e76fb8 ("ARM: owl: smp: Drop owl_secondary_boot()")

Also note that all previous patches in there had "ARM: owl:", so let's
stick with that for consistency, just like we stick with ARM despite the
corporate rebranding to arm. I can fix the text up.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/arch/arm/mach-actions

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-actions/platsmp.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
> index 98fbcaa764a5..b66a768afedd 100644
> --- a/arch/arm/mach-actions/platsmp.c
> +++ b/arch/arm/mach-actions/platsmp.c
> @@ -38,8 +38,6 @@ static void __iomem *sps_base_addr;
>  static void __iomem *timer_base_addr;
>  static DEFINE_SPINLOCK(boot_lock);
>  
> -void owl_secondary_startup(void);
> -
>  static int s500_wakeup_secondary(unsigned int cpu)
>  {
>  	int ret;

Thanks,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 2/5] ARM: actions: Localize some variables
  2018-12-11  8:07 ` [PATCH 2/5] ARM: actions: Localize some variables Linus Walleij
  2018-12-12 11:18   ` Russell King - ARM Linux
@ 2018-12-18 19:35   ` Andreas Färber
  1 sibling, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2018-12-18 19:35 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-actions, linux-arm-kernel, Manivannan Sadhasivam

+ linux-actions

Am 11.12.18 um 09:07 schrieb Linus Walleij:
> The ncores and scu_base_addr variables are only used
> inside s500_smp_prepare_cpus() so no need to have them
> static local.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-actions/platsmp.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
> index 02d17ed0ca31..98fbcaa764a5 100644
> --- a/arch/arm/mach-actions/platsmp.c
> +++ b/arch/arm/mach-actions/platsmp.c
> @@ -34,11 +34,8 @@
>  #define OWL_SPS_PG_CTL_ACK_CPU2	BIT(21)
>  #define OWL_SPS_PG_CTL_ACK_CPU3	BIT(22)
>  
> -static void __iomem *scu_base_addr;
>  static void __iomem *sps_base_addr;
>  static void __iomem *timer_base_addr;
> -static int ncores;
> -
>  static DEFINE_SPINLOCK(boot_lock);
>  
>  void owl_secondary_startup(void);
> @@ -113,7 +110,9 @@ static int s500_smp_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  
>  static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
>  {
> +	static void __iomem *scu_base_addr;
>  	struct device_node *node;
> +	static int ncores;
>  
>  	node = of_find_compatible_node(NULL, NULL, "actions,s500-timer");
>  	if (!node) {

I fail to see what's wrong about the code, so I would rather not
needlessly refactor it.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

_______________________________________________
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] 13+ messages in thread

* Re: [PATCH 1/5] ARM: actions: Put OF nodes after use
  2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
                   ` (4 preceding siblings ...)
  2018-12-11 13:02 ` [PATCH 1/5] ARM: actions: Put OF nodes after use Stefan Agner
@ 2018-12-18 19:49 ` Andreas Färber
  5 siblings, 0 replies; 13+ messages in thread
From: Andreas Färber @ 2018-12-18 19:49 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-actions, linux-arm-kernel, Manivannan Sadhasivam

+ linux-actions

Am 11.12.18 um 09:07 schrieb Linus Walleij:
> After using of_find_compatible_node() we need to issue
> of_node_put() on the node to keep refcount.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/mach-actions/platsmp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
> index 3efaa10efc43..02d17ed0ca31 100644
> --- a/arch/arm/mach-actions/platsmp.c
> +++ b/arch/arm/mach-actions/platsmp.c
> @@ -122,6 +122,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
>  	}
>  
>  	timer_base_addr = of_iomap(node, 0);
> +	of_node_put(node);
>  	if (!timer_base_addr) {
>  		pr_err("%s: could not map timer registers\n", __func__);
>  		return;
> @@ -134,6 +135,8 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
>  	}
>  
>  	sps_base_addr = of_iomap(node, 0);
> +	of_node_put(node);
> +
>  	if (!sps_base_addr) {
>  		pr_err("%s: could not map sps registers\n", __func__);
>  		return;
> @@ -147,6 +150,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
>  		}
>  
>  		scu_base_addr = of_iomap(node, 0);
> +		of_node_put(node);
>  		if (!scu_base_addr) {
>  			pr_err("%s: could not map scu registers\n", __func__);
>  			return;

Looks okay, but does it matter? To my understanding this is all
non-reentrant code.

If you do consider it a bugfix, then we should add a Fixes header:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/mach-actions?id=172067e0bc8721af3e8626596f91b03f691e88a8

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

_______________________________________________
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] 13+ messages in thread

end of thread, other threads:[~2018-12-18 19:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11  8:07 [PATCH 1/5] ARM: actions: Put OF nodes after use Linus Walleij
2018-12-11  8:07 ` [PATCH 2/5] ARM: actions: Localize some variables Linus Walleij
2018-12-12 11:18   ` Russell King - ARM Linux
2018-12-18 19:35   ` Andreas Färber
2018-12-11  8:07 ` [PATCH 3/5] ARM: actions: Drop unused function Linus Walleij
2018-12-18 19:30   ` Andreas Färber
2018-12-11  8:07 ` [PATCH 4/5] ARM: actions: Set possible CPUs from ncores Linus Walleij
2018-12-12 11:21   ` Russell King - ARM Linux
2018-12-11  8:07 ` [PATCH 5/5] RFT: ARM: actions: Simplify secondary boot Linus Walleij
2018-12-12 11:30   ` Russell King - ARM Linux
2018-12-12 12:03     ` Linus Walleij
2018-12-11 13:02 ` [PATCH 1/5] ARM: actions: Put OF nodes after use Stefan Agner
2018-12-18 19:49 ` Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.