linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match
@ 2013-10-21 12:30 Sudeep KarkadaNagesha
  2014-01-07 16:58 ` Mark Rutland
  0 siblings, 1 reply; 5+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-10-21 12:30 UTC (permalink / raw)
  To: linux-arm-kernel

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

The MPIDR contains specific bitfields(MPIDR.Aff{2..0}) which uniquely
identify a CPU, in addition to some non-identifying information and
reserved bits. The ARM cpu binding defines the 'reg' property to only
contain the affinity bits, and any cpu nodes with other bits set in
their 'reg' entry are skipped.

As such it is not necessary to mask the phys_id with MPIDR_HWID_BITMASK,
and doing so could lead to matching erroneous CPU nodes in the device
tree. This patch removes the masking of the physical identifier.

Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
---
 arch/arm/kernel/devtree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index f35906b..41960fb 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -171,7 +171,7 @@ void __init arm_dt_init_cpu_maps(void)
 
 bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
 {
-	return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
+	return phys_id == cpu_logical_map(cpu);
 }
 
 /**
-- 
1.8.1.2

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

* [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match
  2013-10-21 12:30 [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match Sudeep KarkadaNagesha
@ 2014-01-07 16:58 ` Mark Rutland
  2014-01-08 10:58   ` Sudeep Holla
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Rutland @ 2014-01-07 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I was just looking in devtree.c and I noticed this seems to have fallen
by the wayside. Given that this fixes a possible bug and there have been
no negative comments, I think it's good for mainline.

Could you place this in the patch system, assuming Russell has no
comments?

Cheers,
Mark.

On Mon, Oct 21, 2013 at 01:30:32PM +0100, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> 
> The MPIDR contains specific bitfields(MPIDR.Aff{2..0}) which uniquely
> identify a CPU, in addition to some non-identifying information and
> reserved bits. The ARM cpu binding defines the 'reg' property to only
> contain the affinity bits, and any cpu nodes with other bits set in
> their 'reg' entry are skipped.
> 
> As such it is not necessary to mask the phys_id with MPIDR_HWID_BITMASK,
> and doing so could lead to matching erroneous CPU nodes in the device
> tree. This patch removes the masking of the physical identifier.
> 
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> ---
>  arch/arm/kernel/devtree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> index f35906b..41960fb 100644
> --- a/arch/arm/kernel/devtree.c
> +++ b/arch/arm/kernel/devtree.c
> @@ -171,7 +171,7 @@ void __init arm_dt_init_cpu_maps(void)
>  
>  bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
>  {
> -	return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
> +	return phys_id == cpu_logical_map(cpu);
>  }
>  
>  /**
> -- 
> 1.8.1.2
> 

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

* [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match
  2014-01-07 16:58 ` Mark Rutland
@ 2014-01-08 10:58   ` Sudeep Holla
  2014-01-08 18:02     ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2014-01-08 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Russell,

On 07/01/14 16:58, Mark Rutland wrote:
> Hi,
> 
> I was just looking in devtree.c and I noticed this seems to have fallen
> by the wayside. Given that this fixes a possible bug and there have been
> no negative comments, I think it's good for mainline.
> 
> Could you place this in the patch system, assuming Russell has no
> comments?
> 

Can I put this in patch tracker if you have no objections ?

Regards,
Sudeep

> Cheers,
> Mark.
> 
> On Mon, Oct 21, 2013 at 01:30:32PM +0100, Sudeep KarkadaNagesha wrote:
>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>
>> The MPIDR contains specific bitfields(MPIDR.Aff{2..0}) which uniquely
>> identify a CPU, in addition to some non-identifying information and
>> reserved bits. The ARM cpu binding defines the 'reg' property to only
>> contain the affinity bits, and any cpu nodes with other bits set in
>> their 'reg' entry are skipped.
>>
>> As such it is not necessary to mask the phys_id with MPIDR_HWID_BITMASK,
>> and doing so could lead to matching erroneous CPU nodes in the device
>> tree. This patch removes the masking of the physical identifier.
>>
>> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>> Acked-by: Mark Rutland <mark.rutland@arm.com>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> ---
>>  arch/arm/kernel/devtree.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
>> index f35906b..41960fb 100644
>> --- a/arch/arm/kernel/devtree.c
>> +++ b/arch/arm/kernel/devtree.c
>> @@ -171,7 +171,7 @@ void __init arm_dt_init_cpu_maps(void)
>>  
>>  bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
>>  {
>> -	return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
>> +	return phys_id == cpu_logical_map(cpu);
>>  }
>>  
>>  /**
>> -- 
>> 1.8.1.2
>>

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

* [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match
  2014-01-08 10:58   ` Sudeep Holla
@ 2014-01-08 18:02     ` Russell King - ARM Linux
  2014-01-08 18:23       ` Sudeep Holla
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2014-01-08 18:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 08, 2014 at 10:58:34AM +0000, Sudeep Holla wrote:
> Hi Russell,
> 
> On 07/01/14 16:58, Mark Rutland wrote:
> > Hi,
> > 
> > I was just looking in devtree.c and I noticed this seems to have fallen
> > by the wayside. Given that this fixes a possible bug and there have been
> > no negative comments, I think it's good for mainline.
> > 
> > Could you place this in the patch system, assuming Russell has no
> > comments?
> > 
> 
> Can I put this in patch tracker if you have no objections ?

Yes please.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match
  2014-01-08 18:02     ` Russell King - ARM Linux
@ 2014-01-08 18:23       ` Sudeep Holla
  0 siblings, 0 replies; 5+ messages in thread
From: Sudeep Holla @ 2014-01-08 18:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/01/14 18:02, Russell King - ARM Linux wrote:
> On Wed, Jan 08, 2014 at 10:58:34AM +0000, Sudeep Holla wrote:
>> Hi Russell,
>>
>> On 07/01/14 16:58, Mark Rutland wrote:
>>> Hi,
>>>
>>> I was just looking in devtree.c and I noticed this seems to have fallen
>>> by the wayside. Given that this fixes a possible bug and there have been
>>> no negative comments, I think it's good for mainline.
>>>
>>> Could you place this in the patch system, assuming Russell has no
>>> comments?
>>>
>>
>> Can I put this in patch tracker if you have no objections ?
> 
> Yes please.
> 

Thanks and it's done(7934/1).

Regards,
Sudeep

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

end of thread, other threads:[~2014-01-08 18:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 12:30 [PATCH] ARM: DT/kernel: fix arch_match_cpu_phys_id to avoid erroneous match Sudeep KarkadaNagesha
2014-01-07 16:58 ` Mark Rutland
2014-01-08 10:58   ` Sudeep Holla
2014-01-08 18:02     ` Russell King - ARM Linux
2014-01-08 18:23       ` Sudeep Holla

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