powerpc: Convert i8259_lock to raw_spinlock
i8259_lock needs to be a real spinlock in RT. Convert it to raw_spinlock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
7cc8a5e3f5
commit
47e3c9046b
@ -23,7 +23,7 @@ static unsigned char cached_8259[2] = { 0xff, 0xff };
|
|||||||
#define cached_A1 (cached_8259[0])
|
#define cached_A1 (cached_8259[0])
|
||||||
#define cached_21 (cached_8259[1])
|
#define cached_21 (cached_8259[1])
|
||||||
|
|
||||||
static DEFINE_SPINLOCK(i8259_lock);
|
static DEFINE_RAW_SPINLOCK(i8259_lock);
|
||||||
|
|
||||||
static struct irq_host *i8259_host;
|
static struct irq_host *i8259_host;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ unsigned int i8259_irq(void)
|
|||||||
if (pci_intack)
|
if (pci_intack)
|
||||||
irq = readb(pci_intack);
|
irq = readb(pci_intack);
|
||||||
else {
|
else {
|
||||||
spin_lock(&i8259_lock);
|
raw_spin_lock(&i8259_lock);
|
||||||
lock = 1;
|
lock = 1;
|
||||||
|
|
||||||
/* Perform an interrupt acknowledge cycle on controller 1. */
|
/* Perform an interrupt acknowledge cycle on controller 1. */
|
||||||
@ -74,7 +74,7 @@ unsigned int i8259_irq(void)
|
|||||||
irq = NO_IRQ;
|
irq = NO_IRQ;
|
||||||
|
|
||||||
if (lock)
|
if (lock)
|
||||||
spin_unlock(&i8259_lock);
|
raw_spin_unlock(&i8259_lock);
|
||||||
return irq;
|
return irq;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
|
|||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&i8259_lock, flags);
|
raw_spin_lock_irqsave(&i8259_lock, flags);
|
||||||
if (irq_nr > 7) {
|
if (irq_nr > 7) {
|
||||||
cached_A1 |= 1 << (irq_nr-8);
|
cached_A1 |= 1 << (irq_nr-8);
|
||||||
inb(0xA1); /* DUMMY */
|
inb(0xA1); /* DUMMY */
|
||||||
@ -95,7 +95,7 @@ static void i8259_mask_and_ack_irq(unsigned int irq_nr)
|
|||||||
outb(cached_21, 0x21);
|
outb(cached_21, 0x21);
|
||||||
outb(0x20, 0x20); /* Non-specific EOI */
|
outb(0x20, 0x20); /* Non-specific EOI */
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&i8259_lock, flags);
|
raw_spin_unlock_irqrestore(&i8259_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i8259_set_irq_mask(int irq_nr)
|
static void i8259_set_irq_mask(int irq_nr)
|
||||||
@ -110,13 +110,13 @@ static void i8259_mask_irq(unsigned int irq_nr)
|
|||||||
|
|
||||||
pr_debug("i8259_mask_irq(%d)\n", irq_nr);
|
pr_debug("i8259_mask_irq(%d)\n", irq_nr);
|
||||||
|
|
||||||
spin_lock_irqsave(&i8259_lock, flags);
|
raw_spin_lock_irqsave(&i8259_lock, flags);
|
||||||
if (irq_nr < 8)
|
if (irq_nr < 8)
|
||||||
cached_21 |= 1 << irq_nr;
|
cached_21 |= 1 << irq_nr;
|
||||||
else
|
else
|
||||||
cached_A1 |= 1 << (irq_nr-8);
|
cached_A1 |= 1 << (irq_nr-8);
|
||||||
i8259_set_irq_mask(irq_nr);
|
i8259_set_irq_mask(irq_nr);
|
||||||
spin_unlock_irqrestore(&i8259_lock, flags);
|
raw_spin_unlock_irqrestore(&i8259_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i8259_unmask_irq(unsigned int irq_nr)
|
static void i8259_unmask_irq(unsigned int irq_nr)
|
||||||
@ -125,13 +125,13 @@ static void i8259_unmask_irq(unsigned int irq_nr)
|
|||||||
|
|
||||||
pr_debug("i8259_unmask_irq(%d)\n", irq_nr);
|
pr_debug("i8259_unmask_irq(%d)\n", irq_nr);
|
||||||
|
|
||||||
spin_lock_irqsave(&i8259_lock, flags);
|
raw_spin_lock_irqsave(&i8259_lock, flags);
|
||||||
if (irq_nr < 8)
|
if (irq_nr < 8)
|
||||||
cached_21 &= ~(1 << irq_nr);
|
cached_21 &= ~(1 << irq_nr);
|
||||||
else
|
else
|
||||||
cached_A1 &= ~(1 << (irq_nr-8));
|
cached_A1 &= ~(1 << (irq_nr-8));
|
||||||
i8259_set_irq_mask(irq_nr);
|
i8259_set_irq_mask(irq_nr);
|
||||||
spin_unlock_irqrestore(&i8259_lock, flags);
|
raw_spin_unlock_irqrestore(&i8259_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip i8259_pic = {
|
static struct irq_chip i8259_pic = {
|
||||||
@ -241,7 +241,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
/* initialize the controller */
|
/* initialize the controller */
|
||||||
spin_lock_irqsave(&i8259_lock, flags);
|
raw_spin_lock_irqsave(&i8259_lock, flags);
|
||||||
|
|
||||||
/* Mask all first */
|
/* Mask all first */
|
||||||
outb(0xff, 0xA1);
|
outb(0xff, 0xA1);
|
||||||
@ -273,7 +273,7 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
|
|||||||
outb(cached_A1, 0xA1);
|
outb(cached_A1, 0xA1);
|
||||||
outb(cached_21, 0x21);
|
outb(cached_21, 0x21);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&i8259_lock, flags);
|
raw_spin_unlock_irqrestore(&i8259_lock, flags);
|
||||||
|
|
||||||
/* create a legacy host */
|
/* create a legacy host */
|
||||||
i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY,
|
i8259_host = irq_alloc_host(node, IRQ_HOST_MAP_LEGACY,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user