Skip to content

Commit 6550904

Browse files
Jacob PanH. Peter Anvin
authored andcommitted
x86, mrst: Set correct APB timer IRQ affinity for secondary cpu
Offlining the secondary CPU causes the timer irq affinity to be set to CPU 0. When the secondary CPU is back online again, the wrong irq affinity will be used. This patch ensures secondary per CPU timer always has the correct IRQ affinity when enabled. Signed-off-by: Jacob Pan <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]> Cc: <[email protected]> 2.6.37
1 parent 62627be commit 6550904

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

arch/x86/kernel/apb_timer.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,16 @@ static void apbt_setup_irq(struct apbt_dev *adev)
313313
if (adev->irq == 0)
314314
return;
315315

316+
irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
317+
irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
318+
/* APB timer irqs are set up as mp_irqs, timer is edge type */
319+
__set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");
320+
316321
if (system_state == SYSTEM_BOOTING) {
317-
irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
318-
irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
319-
/* APB timer irqs are set up as mp_irqs, timer is edge type */
320-
__set_irq_handler(adev->irq, handle_edge_irq, 0, "edge");
321322
if (request_irq(adev->irq, apbt_interrupt_handler,
322-
IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING,
323-
adev->name, adev)) {
323+
IRQF_TIMER | IRQF_DISABLED |
324+
IRQF_NOBALANCING,
325+
adev->name, adev)) {
324326
printk(KERN_ERR "Failed request IRQ for APBT%d\n",
325327
adev->num);
326328
}

0 commit comments

Comments
 (0)