Commit d0eab3eb authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Benjamin Herrenschmidt

powerpc: Convert pmac_pic_lock to raw_spinlock

pmac_pic_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent f95e085b
...@@ -57,7 +57,7 @@ static int max_irqs; ...@@ -57,7 +57,7 @@ static int max_irqs;
static int max_real_irqs; static int max_real_irqs;
static u32 level_mask[4]; static u32 level_mask[4];
static DEFINE_SPINLOCK(pmac_pic_lock); static DEFINE_RAW_SPINLOCK(pmac_pic_lock);
#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) #define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; static unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
...@@ -85,7 +85,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq) ...@@ -85,7 +85,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
int i = src >> 5; int i = src >> 5;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
__clear_bit(src, ppc_cached_irq_mask); __clear_bit(src, ppc_cached_irq_mask);
if (__test_and_clear_bit(src, ppc_lost_interrupts)) if (__test_and_clear_bit(src, ppc_lost_interrupts))
atomic_dec(&ppc_n_lost_interrupts); atomic_dec(&ppc_n_lost_interrupts);
...@@ -97,7 +97,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq) ...@@ -97,7 +97,7 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
mb(); mb();
} while((in_le32(&pmac_irq_hw[i]->enable) & bit) } while((in_le32(&pmac_irq_hw[i]->enable) & bit)
!= (ppc_cached_irq_mask[i] & bit)); != (ppc_cached_irq_mask[i] & bit));
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
} }
static void pmac_ack_irq(unsigned int virq) static void pmac_ack_irq(unsigned int virq)
...@@ -107,12 +107,12 @@ static void pmac_ack_irq(unsigned int virq) ...@@ -107,12 +107,12 @@ static void pmac_ack_irq(unsigned int virq)
int i = src >> 5; int i = src >> 5;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
if (__test_and_clear_bit(src, ppc_lost_interrupts)) if (__test_and_clear_bit(src, ppc_lost_interrupts))
atomic_dec(&ppc_n_lost_interrupts); atomic_dec(&ppc_n_lost_interrupts);
out_le32(&pmac_irq_hw[i]->ack, bit); out_le32(&pmac_irq_hw[i]->ack, bit);
(void)in_le32(&pmac_irq_hw[i]->ack); (void)in_le32(&pmac_irq_hw[i]->ack);
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
} }
static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
...@@ -152,12 +152,12 @@ static unsigned int pmac_startup_irq(unsigned int virq) ...@@ -152,12 +152,12 @@ static unsigned int pmac_startup_irq(unsigned int virq)
unsigned long bit = 1UL << (src & 0x1f); unsigned long bit = 1UL << (src & 0x1f);
int i = src >> 5; int i = src >> 5;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0) if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0)
out_le32(&pmac_irq_hw[i]->ack, bit); out_le32(&pmac_irq_hw[i]->ack, bit);
__set_bit(src, ppc_cached_irq_mask); __set_bit(src, ppc_cached_irq_mask);
__pmac_set_irq_mask(src, 0); __pmac_set_irq_mask(src, 0);
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
return 0; return 0;
} }
...@@ -167,10 +167,10 @@ static void pmac_mask_irq(unsigned int virq) ...@@ -167,10 +167,10 @@ static void pmac_mask_irq(unsigned int virq)
unsigned long flags; unsigned long flags;
unsigned int src = irq_map[virq].hwirq; unsigned int src = irq_map[virq].hwirq;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
__clear_bit(src, ppc_cached_irq_mask); __clear_bit(src, ppc_cached_irq_mask);
__pmac_set_irq_mask(src, 1); __pmac_set_irq_mask(src, 1);
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
} }
static void pmac_unmask_irq(unsigned int virq) static void pmac_unmask_irq(unsigned int virq)
...@@ -178,19 +178,19 @@ static void pmac_unmask_irq(unsigned int virq) ...@@ -178,19 +178,19 @@ static void pmac_unmask_irq(unsigned int virq)
unsigned long flags; unsigned long flags;
unsigned int src = irq_map[virq].hwirq; unsigned int src = irq_map[virq].hwirq;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
__set_bit(src, ppc_cached_irq_mask); __set_bit(src, ppc_cached_irq_mask);
__pmac_set_irq_mask(src, 0); __pmac_set_irq_mask(src, 0);
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
} }
static int pmac_retrigger(unsigned int virq) static int pmac_retrigger(unsigned int virq)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
__pmac_retrigger(irq_map[virq].hwirq); __pmac_retrigger(irq_map[virq].hwirq);
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
return 1; return 1;
} }
...@@ -210,7 +210,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id) ...@@ -210,7 +210,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
int irq, bits; int irq, bits;
int rc = IRQ_NONE; int rc = IRQ_NONE;
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) { for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) {
int i = irq >> 5; int i = irq >> 5;
bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
...@@ -220,12 +220,12 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id) ...@@ -220,12 +220,12 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
if (bits == 0) if (bits == 0)
continue; continue;
irq += __ilog2(bits); irq += __ilog2(bits);
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
generic_handle_irq(irq); generic_handle_irq(irq);
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
rc = IRQ_HANDLED; rc = IRQ_HANDLED;
} }
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
return rc; return rc;
} }
...@@ -244,7 +244,7 @@ static unsigned int pmac_pic_get_irq(void) ...@@ -244,7 +244,7 @@ static unsigned int pmac_pic_get_irq(void)
return NO_IRQ_IGNORE; /* ignore, already handled */ return NO_IRQ_IGNORE; /* ignore, already handled */
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
spin_lock_irqsave(&pmac_pic_lock, flags); raw_spin_lock_irqsave(&pmac_pic_lock, flags);
for (irq = max_real_irqs; (irq -= 32) >= 0; ) { for (irq = max_real_irqs; (irq -= 32) >= 0; ) {
int i = irq >> 5; int i = irq >> 5;
bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i];
...@@ -256,7 +256,7 @@ static unsigned int pmac_pic_get_irq(void) ...@@ -256,7 +256,7 @@ static unsigned int pmac_pic_get_irq(void)
irq += __ilog2(bits); irq += __ilog2(bits);
break; break;
} }
spin_unlock_irqrestore(&pmac_pic_lock, flags); raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
if (unlikely(irq < 0)) if (unlikely(irq < 0))
return NO_IRQ; return NO_IRQ;
return irq_linear_revmap(pmac_pic_host, irq); return irq_linear_revmap(pmac_pic_host, irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment