diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-18 01:18:15 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-18 22:19:13 -0500 |
commit | e53566409c38d38680cc02299fa9fa5fe8623e9f (patch) | |
tree | 3ff9ea238f125925d5e4042cea6c3530b6e324a6 /arch/powerpc | |
parent | b286e39207237e2f6929959372bf66d9a8d05a82 (diff) |
[PATCH] powerpc: Fix setting MPIC priority
Trying to set the priority would just disable the interrupt due to an
incorrect mask used. We rarely use that call, in fact, I think only in
the powermac code for the cmd-power key combo that triggers xmon. So it
got unnoticed for a while.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 105f05341a41..58d1cc2023c8 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -361,7 +361,8 @@ static void mpic_enable_irq(unsigned int irq) | |||
361 | DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); | 361 | DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); |
362 | 362 | ||
363 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, | 363 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, |
364 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & ~MPIC_VECPRI_MASK); | 364 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & |
365 | ~MPIC_VECPRI_MASK); | ||
365 | 366 | ||
366 | /* make sure mask gets to controller before we return to user */ | 367 | /* make sure mask gets to controller before we return to user */ |
367 | do { | 368 | do { |
@@ -381,7 +382,8 @@ static void mpic_disable_irq(unsigned int irq) | |||
381 | DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); | 382 | DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); |
382 | 383 | ||
383 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, | 384 | mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, |
384 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | MPIC_VECPRI_MASK); | 385 | mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) | |
386 | MPIC_VECPRI_MASK); | ||
385 | 387 | ||
386 | /* make sure mask gets to controller before we return to user */ | 388 | /* make sure mask gets to controller before we return to user */ |
387 | do { | 389 | do { |
@@ -735,12 +737,13 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri) | |||
735 | 737 | ||
736 | spin_lock_irqsave(&mpic_lock, flags); | 738 | spin_lock_irqsave(&mpic_lock, flags); |
737 | if (is_ipi) { | 739 | if (is_ipi) { |
738 | reg = mpic_ipi_read(irq - mpic->ipi_offset) & MPIC_VECPRI_PRIORITY_MASK; | 740 | reg = mpic_ipi_read(irq - mpic->ipi_offset) & |
741 | ~MPIC_VECPRI_PRIORITY_MASK; | ||
739 | mpic_ipi_write(irq - mpic->ipi_offset, | 742 | mpic_ipi_write(irq - mpic->ipi_offset, |
740 | reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); | 743 | reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); |
741 | } else { | 744 | } else { |
742 | reg = mpic_irq_read(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI) | 745 | reg = mpic_irq_read(irq - mpic->irq_offset,MPIC_IRQ_VECTOR_PRI) |
743 | & MPIC_VECPRI_PRIORITY_MASK; | 746 | & ~MPIC_VECPRI_PRIORITY_MASK; |
744 | mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI, | 747 | mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI, |
745 | reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); | 748 | reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); |
746 | } | 749 | } |