Bug 5128

Summary: Handle NR_CPUS > 256 properly in cpu_index calculation in processor_core.c
Product: ACPI Reporter: Venkatesh Pallipadi (venki)
Component: Power-ProcessorAssignee: Venkatesh Pallipadi (venki)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: acpi-bugzilla, d.bellegueulle, schwab
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.13-rc7 Subsystem:
Regression: --- Bisected commit-id:
Attachments: Patch that fixes the processor_core warning when NR_CPUS > 256
Patch to apply on post-lindent'd processor_core.c

Description Venkatesh Pallipadi 2005-08-25 15:51:51 UTC
Distribution:
Hardware Environment:
Software Environment:
Problem Description:
Current cpu_index calculation in processor_core.c can handle CPUs with id < 
255. It can also result in compilation warning when NR_CPUS is greater than 
256. The patch fixes it.

Steps to reproduce:
Comment 1 Venkatesh Pallipadi 2005-08-25 15:53:46 UTC
Created attachment 5766 [details]
Patch that fixes the processor_core warning when NR_CPUS > 256
Comment 2 Andrew Morton 2005-08-25 22:06:36 UTC
Please email me the match by the normal means:
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt
and copy linux-kernel.

Thanks.
Comment 3 Len Brown 2005-08-26 18:50:03 UTC
the acpi patch has Lindented acpi/processor_core.c,  
so this patch will no longer apply.  
Can you supply a patch formatted  
on top of the acpi patch?  
Comment 4 Venkatesh Pallipadi 2005-08-30 17:55:55 UTC
Created attachment 5823 [details]
Patch to apply on post-lindent'd processor_core.c
Comment 5 Len Brown 2005-09-02 21:59:25 UTC
applied
Comment 6 Len Brown 2005-09-03 09:34:36 UTC
un-applied & re-opened
processor module didn't load/unload properly with this patch,
it created a build warning for CONFIG_SMP,
and created a build failure for !CONFIG_SMP.
Comment 7 Len Brown 2005-09-07 18:41:22 UTC
*** Bug 5190 has been marked as a duplicate of this bug. ***
Comment 8 Venkatesh Pallipadi 2005-09-27 16:39:51 UTC
Len,

Can you post the config where you saw SMP compilation warning?

I have fixed the UP case, but I am not seeing any warning fro some reason and
module load/unload works fine.

Thanks,
Venki
Comment 9 Andreas Schwab 2005-10-09 08:53:32 UTC
This part of the patch should be removed, IMHO. 
 
-	if (cpu_index >= NR_CPUS) { 
+	if (retval) { 
 
Comment 10 Venkatesh Pallipadi 2007-07-25 19:06:09 UTC
This bug is fixed in latest kernel. Closing the bugzilla. Please reopen if there is issue still.