Skip to contentSkip to conversation

powerpc: Use physical cpu id when setting the processor affinity

PATCH In review Kumar Gala 2 participants 3 messages Dec 2, 2008 PowerPC

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 powerpc: Use physical cpu id when setting the processor affinity

In the CONFIG_SMP case the irq_choose_cpu() code was returning back a logical cpu id not the physical id. We were writing that directly into the HW register.

We need to be calling get_hard_smp_processor_id() so irq_choose_cpu() always returns a physical cpu id.

---
 arch/powerpc/sysdev/mpic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/sysdev/mpic.c +1 -1
index b24e1d0..1890fb0 100644
@@ -600,7 +600,7 @@ static int irq_choose_cpu(unsigned int virt_irq)
 		cpuid = first_cpu(tmp);
 	}
 
-	return cpuid;
+	return get_hard_smp_processor_id(cpuid);
 }
 #else
 static int irq_choose_cpu(unsigned int virt_irq)
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 6 lines · Kumar Gala

In the CONFIG_SMP case the irq_choose_cpu() code was returning back a logical cpu id not the physical id. We were writing that directly into the HW register.

We need to be calling get_hard_smp_processor_id() so irq_choose_cpu() always returns a physical cpu id.

That will probably do for now but if we ever move that routine to generic code, I'd rather have the caller do the conversion.

Cheers,
Ben.

author
#2 lore raw
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 6 lines · Kumar Gala

In the CONFIG_SMP case the irq_choose_cpu() code was returning back a logical cpu id not the physical id. We were writing that directly into the HW register.

We need to be calling get_hard_smp_processor_id() so irq_choose_cpu() always returns a physical cpu id.

That will probably do for now but if we ever move that routine to generic code, I'd rather have the caller do the conversion.

Fair.. I felt at this point matching what the !CONFIG_SMP case of irq_choose_cpu() is doing was the best choice.

- k