lkml.org 
[lkml]   [2009]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 01/14] [VOYAGER] x86: add {safe,hard}_smp_processor_id to smp_ops
From
Date
[sent to correct cc list this time]
On Tue, 2009-04-14 at 20:31 +0400, Cyrill Gorcunov wrote:
> [James Bottomley - Tue, Apr 14, 2009 at 10:51:27AM -0500]
> | Not having apics, Voyager can't use the default apic implementation of
> | these, it has to read from a special port in the VIC to get the
> | processor ID, so abstract these functions in smp_ops to allow voyager
> | to live simultaneously with the apic code.
> |
> Hi James, wouldn't it break summit32 platform?
> This snippet from summit_32.c
>
> static void summit_init_apic_ldr(void)
> {
> unsigned long val, id;
> int count = 0;
> ---> u8 my_id = (u8)hard_smp_processor_id();
> u8 my_cluster = APIC_CLUSTER(my_id);
>
> if we have CONFIG_SMP _not_ set smp_ops.hard_smp_processor_id
> would be plain NULL deref (or linker warning)? I could be missing something...

I think so, yes, thanks!

Apparently it missed out on the coversion to read_apic_id().

This should fix it up, I'll fold it into the 01 patch

James

---
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c
index 9cfe1f4..6e1c7ed 100644
--- a/arch/x86/kernel/apic/summit_32.c
+++ b/arch/x86/kernel/apic/summit_32.c
@@ -206,7 +206,7 @@ static void summit_init_apic_ldr(void)
{
unsigned long val, id;
int count = 0;
- u8 my_id = (u8)hard_smp_processor_id();
+ u8 my_id = (u8)read_apic_id();
u8 my_cluster = APIC_CLUSTER(my_id);
#ifdef CONFIG_SMP
u8 lid;
@@ -333,7 +333,7 @@ static unsigned int summit_cpu_mask_to_apicid_and(const struct cpumask *inmask,
*/
static int summit_phys_pkg_id(int cpuid_apic, int index_msb)
{
- return hard_smp_processor_id() >> index_msb;
+ return read_apic_id() >> index_msb;
}

static int probe_summit(void)




\
 
 \ /
  Last update: 2009-04-14 18:57    [W:0.055 / U:2.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site