All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep.KarkadaNagesha@arm.com (Sudeep KarkadaNagesha)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] arm: zynq: platsmp: Fix CPU presence check
Date: Thu, 31 Oct 2013 16:42:41 +0000	[thread overview]
Message-ID: <52728881.7000902@arm.com> (raw)
In-Reply-To: <1383235819-2552-2-git-send-email-soren.brinkmann@xilinx.com>

Hi Soren,

On 31/10/13 16:10, Soren Brinkmann wrote:
> From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> Fix an off-by-one error in the logic that checks if a CPU is present.
> The ncores variable is a count of cores while the cpu variable is a
> 0 based index. So if ncores == cpu, cpu is out of range. Fix this
> comparison so non-existent CPUs are not probed.
>

Not entirely related to this patch, I had found that zynq_smp_prepare_cpus is
setting cpu_present_mask which is redundant(CMIIW present == possible). I had
posted a patch[1] to remove that, consider including that in the series if you
think it make sense.

Regards,
Sudeep

[1] http://www.spinics.net/lists/arm-kernel/msg260734.html

> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>  arch/arm/mach-zynq/platsmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
> index 689fbbc3d9c8..2512624e657d 100644
> --- a/arch/arm/mach-zynq/platsmp.c
> +++ b/arch/arm/mach-zynq/platsmp.c
> @@ -39,7 +39,7 @@ int zynq_cpun_start(u32 address, int cpu)
>  	u32 trampoline_code_size = &zynq_secondary_trampoline_end -
>  						&zynq_secondary_trampoline;
>  
> -	if (cpu > ncores) {
> +	if (cpu >= ncores) {
>  		pr_warn("CPU No. is not available in the system\n");
>  		return -1;
>  	}
> 

WARNING: multiple messages have this Message-ID (diff)
From: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
To: Soren Brinkmann <soren.brinkmann@xilinx.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Russell King <linux@arm.linux.org.uk>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/6] arm: zynq: platsmp: Fix CPU presence check
Date: Thu, 31 Oct 2013 16:42:41 +0000	[thread overview]
Message-ID: <52728881.7000902@arm.com> (raw)
In-Reply-To: <1383235819-2552-2-git-send-email-soren.brinkmann@xilinx.com>

Hi Soren,

On 31/10/13 16:10, Soren Brinkmann wrote:
> From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> Fix an off-by-one error in the logic that checks if a CPU is present.
> The ncores variable is a count of cores while the cpu variable is a
> 0 based index. So if ncores == cpu, cpu is out of range. Fix this
> comparison so non-existent CPUs are not probed.
>

Not entirely related to this patch, I had found that zynq_smp_prepare_cpus is
setting cpu_present_mask which is redundant(CMIIW present == possible). I had
posted a patch[1] to remove that, consider including that in the series if you
think it make sense.

Regards,
Sudeep

[1] http://www.spinics.net/lists/arm-kernel/msg260734.html

> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>  arch/arm/mach-zynq/platsmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
> index 689fbbc3d9c8..2512624e657d 100644
> --- a/arch/arm/mach-zynq/platsmp.c
> +++ b/arch/arm/mach-zynq/platsmp.c
> @@ -39,7 +39,7 @@ int zynq_cpun_start(u32 address, int cpu)
>  	u32 trampoline_code_size = &zynq_secondary_trampoline_end -
>  						&zynq_secondary_trampoline;
>  
> -	if (cpu > ncores) {
> +	if (cpu >= ncores) {
>  		pr_warn("CPU No. is not available in the system\n");
>  		return -1;
>  	}
> 



  parent reply	other threads:[~2013-10-31 16:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 16:10 [PATCH 0/6] arm: zynq: BSP update Soren Brinkmann
2013-10-31 16:10 ` Soren Brinkmann
2013-10-31 16:10 ` [PATCH 1/6] arm: zynq: platsmp: Fix CPU presence check Soren Brinkmann
2013-10-31 16:10   ` Soren Brinkmann
2013-10-31 16:17   ` Russell King - ARM Linux
2013-10-31 16:17     ` Russell King - ARM Linux
2013-10-31 17:37     ` [PATCH] arm: zynq: platsmp: Remove " Soren Brinkmann
2013-10-31 17:37       ` Soren Brinkmann
2013-10-31 16:42   ` Sudeep KarkadaNagesha [this message]
2013-10-31 16:42     ` [PATCH 1/6] arm: zynq: platsmp: Fix " Sudeep KarkadaNagesha
2013-10-31 16:10 ` [PATCH 2/6] arm: zynq: Invalidate L1 in secondary boot Soren Brinkmann
2013-10-31 16:10   ` Soren Brinkmann
2013-10-31 16:10 ` [PATCH 3/6] arm: zynq: Add support for zynq_cpu_kill function Soren Brinkmann
2013-10-31 16:10   ` Soren Brinkmann
2013-10-31 16:10 ` [PATCH 4/6] arm: zynq: Use of_platform_populate instead of bus_probe Soren Brinkmann
2013-10-31 16:10   ` Soren Brinkmann
2013-10-31 16:10 ` [PATCH 5/6] arm: zynq: Set proper GIC flags Soren Brinkmann
2013-10-31 16:10   ` Soren Brinkmann
2013-10-31 16:10 ` [PATCH 6/6] arm: zynq: headsmp: Move .glbl out of actual code Soren Brinkmann
2013-10-31 16:10   ` Soren Brinkmann
2013-11-06  7:46   ` Michal Simek
2013-11-06  7:46     ` Michal Simek
2013-11-06 16:41     ` Sören Brinkmann
2013-11-06 16:41       ` Sören Brinkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52728881.7000902@arm.com \
    --to=sudeep.karkadanagesha@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.