Commit ba20085c authored by Kyle McMartin's avatar Kyle McMartin

parisc: lay groundwork for killing __do_IRQ

Use proper accessors and handlers for generic irq cleanups. We just
call back into __do_IRQ through desc->handler now, and remove the
explicit calls.
Signed-off-by: default avatarKyle McMartin <kyle@redhat.com>
parent caf96194
......@@ -32,6 +32,9 @@ static __inline__ int irq_canonicalize(int irq)
}
struct irq_chip;
struct irq_desc;
extern void parisc_do_IRQ(unsigned int irq, struct irq_desc *desc);
/*
* Some useful "we don't have to do anything here" handlers. Should
......
......@@ -151,7 +151,7 @@ static struct irq_chip cpu_interrupt_type = {
.enable = cpu_enable_irq,
.disable = cpu_disable_irq,
.ack = cpu_ack_irq,
.end = cpu_end_irq,
.eoi = cpu_end_irq,
#ifdef CONFIG_SMP
.set_affinity = cpu_set_affinity_irq,
#endif
......@@ -247,10 +247,11 @@ int cpu_claim_irq(unsigned int irq, struct irq_chip *type, void *data)
if (irq_desc[irq].chip != &cpu_interrupt_type)
return -EBUSY;
/* for iosapic interrupts */
if (type) {
irq_desc[irq].chip = type;
irq_desc[irq].chip_data = data;
cpu_interrupt_type.enable(irq);
set_irq_chip_and_handler(irq, type, parisc_do_IRQ);
set_irq_chip_data(irq, data);
cpu_enable_irq(irq);
}
return 0;
}
......@@ -368,7 +369,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
goto set_out;
}
#endif
__do_IRQ(irq);
generic_handle_irq(irq);
out:
irq_exit();
......@@ -398,14 +399,14 @@ static void claim_cpu_irqs(void)
{
int i;
for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) {
irq_desc[i].chip = &cpu_interrupt_type;
set_irq_chip_and_handler(i, &cpu_interrupt_type, parisc_do_IRQ);
}
irq_desc[TIMER_IRQ].action = &timer_action;
irq_desc[TIMER_IRQ].status = IRQ_PER_CPU;
set_irq_handler(TIMER_IRQ, handle_percpu_irq);
setup_irq(TIMER_IRQ, &timer_action);
#ifdef CONFIG_SMP
irq_desc[IPI_IRQ].action = &ipi_action;
irq_desc[IPI_IRQ].status = IRQ_PER_CPU;
set_irq_handler(IPI_IRQ, handle_percpu_irq);
setup_irq(IPI_IRQ, &ipi_action);
#endif
}
......@@ -423,3 +424,8 @@ void __init init_IRQ(void)
set_eiem(cpu_eiem); /* EIEM : enable all external intr */
}
void parisc_do_IRQ(unsigned int irq, struct irq_desc *desc)
{
__do_IRQ(irq);
}
......@@ -298,8 +298,7 @@ static struct pci_port_ops dino_port_ops = {
static void dino_disable_irq(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
struct dino_device *dino_dev = desc->chip_data;
struct dino_device *dino_dev = get_irq_chip_data(irq);
int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq);
......@@ -311,8 +310,7 @@ static void dino_disable_irq(unsigned int irq)
static void dino_enable_irq(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
struct dino_device *dino_dev = desc->chip_data;
struct dino_device *dino_dev = get_irq_chip_data(irq);
int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
u32 tmp;
......@@ -391,7 +389,7 @@ static irqreturn_t dino_isr(int irq, void *intr_dev)
int irq = dino_dev->global_irq[local_irq];
DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n",
__func__, irq, intr_dev, mask);
__do_IRQ(irq);
generic_handle_irq(irq);
mask &= ~(1 << local_irq);
} while (mask);
......
......@@ -233,7 +233,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev)
}
spin_unlock_irqrestore(&eisa_irq_lock, flags);
__do_IRQ(irq);
generic_handle_irq(irq);
spin_lock_irqsave(&eisa_irq_lock, flags);
/* unmask */
......@@ -346,10 +346,10 @@ static int __init eisa_probe(struct parisc_device *dev)
}
/* Reserve IRQ2 */
irq_to_desc(2)->action = &irq2_action;
setup_irq(2, &irq2_action);
for (i = 0; i < 16; i++) {
irq_to_desc(i)->chip = &eisa_interrupt_type;
set_irq_chip_and_handler(i, &eisa_interrupt_type,
parisc_do_IRQ);
}
EISA_bus = 1;
......
......@@ -86,7 +86,7 @@ irqreturn_t gsc_asic_intr(int gsc_asic_irq, void *dev)
do {
int local_irq = __ffs(irr);
unsigned int irq = gsc_asic->global_irq[local_irq];
__do_IRQ(irq);
generic_handle_irq(irq);
irr &= ~(1 << local_irq);
} while (irr);
......@@ -107,8 +107,7 @@ int gsc_find_local_irq(unsigned int irq, int *global_irqs, int limit)
static void gsc_asic_disable_irq(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
struct gsc_asic *irq_dev = desc->chip_data;
struct gsc_asic *irq_dev = get_irq_chip_data(irq);
int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32);
u32 imr;
......@@ -123,8 +122,7 @@ static void gsc_asic_disable_irq(unsigned int irq)
static void gsc_asic_enable_irq(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
struct gsc_asic *irq_dev = desc->chip_data;
struct gsc_asic *irq_dev = get_irq_chip_data(irq);
int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32);
u32 imr;
......@@ -160,14 +158,13 @@ static struct irq_chip gsc_asic_interrupt_type = {
int gsc_assign_irq(struct irq_chip *type, void *data)
{
static int irq = GSC_IRQ_BASE;
struct irq_desc *desc;
if (irq > GSC_IRQ_MAX)
return NO_IRQ;
desc = irq_to_desc(irq);
desc->chip = type;
desc->chip_data = data;
set_irq_chip_and_handler(irq, type, parisc_do_IRQ);
set_irq_chip_data(irq, data);
return irq++;
}
......
......@@ -615,17 +615,10 @@ iosapic_set_irt_data( struct vector_info *vi, u32 *dp0, u32 *dp1)
}
static struct vector_info *iosapic_get_vector(unsigned int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
return desc->chip_data;
}
static void iosapic_disable_irq(unsigned int irq)
{
unsigned long flags;
struct vector_info *vi = iosapic_get_vector(irq);
struct vector_info *vi = get_irq_chip_data(irq);
u32 d0, d1;
spin_lock_irqsave(&iosapic_lock, flags);
......@@ -637,7 +630,7 @@ static void iosapic_disable_irq(unsigned int irq)
static void iosapic_enable_irq(unsigned int irq)
{
struct vector_info *vi = iosapic_get_vector(irq);
struct vector_info *vi = get_irq_chip_data(irq);
u32 d0, d1;
/* data is initialized by fixup_irq */
......@@ -688,7 +681,7 @@ printk("\n");
*/
static void iosapic_end_irq(unsigned int irq)
{
struct vector_info *vi = iosapic_get_vector(irq);
struct vector_info *vi = get_irq_chip_data(irq);
DBG(KERN_DEBUG "end_irq(%d): eoi(%p, 0x%x)\n", irq,
vi->eoi_addr, vi->eoi_data);
iosapic_eoi(vi->eoi_addr, vi->eoi_data);
......@@ -705,7 +698,7 @@ static unsigned int iosapic_startup_irq(unsigned int irq)
static int iosapic_set_affinity_irq(unsigned int irq,
const struct cpumask *dest)
{
struct vector_info *vi = iosapic_get_vector(irq);
struct vector_info *vi = get_irq_chip_data(irq);
u32 d0, d1, dummy_d0;
unsigned long flags;
int dest_cpu;
......
......@@ -139,7 +139,7 @@ superio_interrupt(int parent_irq, void *devp)
}
/* Call the appropriate device's interrupt */
__do_IRQ(local_irq);
generic_handle_irq(local_irq);
/* set EOI - forces a new interrupt if a lower priority device
* still needs service.
......@@ -363,9 +363,7 @@ int superio_fixup_irq(struct pci_dev *pcidev)
#endif
for (i = 0; i < 16; i++) {
struct irq_desc *desc = irq_to_desc(i);
desc->chip = &superio_interrupt_type;
set_irq_chip_and_handler(i, &superio_interrupt_type, parisc_do_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