提交 ba20085c 编写于 作者: K 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: NKyle McMartin <kyle@redhat.com>
上级 caf96194
...@@ -32,6 +32,9 @@ static __inline__ int irq_canonicalize(int irq) ...@@ -32,6 +32,9 @@ static __inline__ int irq_canonicalize(int irq)
} }
struct irq_chip; 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 * Some useful "we don't have to do anything here" handlers. Should
......
...@@ -151,7 +151,7 @@ static struct irq_chip cpu_interrupt_type = { ...@@ -151,7 +151,7 @@ static struct irq_chip cpu_interrupt_type = {
.enable = cpu_enable_irq, .enable = cpu_enable_irq,
.disable = cpu_disable_irq, .disable = cpu_disable_irq,
.ack = cpu_ack_irq, .ack = cpu_ack_irq,
.end = cpu_end_irq, .eoi = cpu_end_irq,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = cpu_set_affinity_irq, .set_affinity = cpu_set_affinity_irq,
#endif #endif
...@@ -247,10 +247,11 @@ int cpu_claim_irq(unsigned int irq, struct irq_chip *type, void *data) ...@@ -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) if (irq_desc[irq].chip != &cpu_interrupt_type)
return -EBUSY; return -EBUSY;
/* for iosapic interrupts */
if (type) { if (type) {
irq_desc[irq].chip = type; set_irq_chip_and_handler(irq, type, parisc_do_IRQ);
irq_desc[irq].chip_data = data; set_irq_chip_data(irq, data);
cpu_interrupt_type.enable(irq); cpu_enable_irq(irq);
} }
return 0; return 0;
} }
...@@ -368,7 +369,7 @@ void do_cpu_irq_mask(struct pt_regs *regs) ...@@ -368,7 +369,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
goto set_out; goto set_out;
} }
#endif #endif
__do_IRQ(irq); generic_handle_irq(irq);
out: out:
irq_exit(); irq_exit();
...@@ -398,14 +399,14 @@ static void claim_cpu_irqs(void) ...@@ -398,14 +399,14 @@ static void claim_cpu_irqs(void)
{ {
int i; int i;
for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; 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; set_irq_handler(TIMER_IRQ, handle_percpu_irq);
irq_desc[TIMER_IRQ].status = IRQ_PER_CPU; setup_irq(TIMER_IRQ, &timer_action);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
irq_desc[IPI_IRQ].action = &ipi_action; set_irq_handler(IPI_IRQ, handle_percpu_irq);
irq_desc[IPI_IRQ].status = IRQ_PER_CPU; setup_irq(IPI_IRQ, &ipi_action);
#endif #endif
} }
...@@ -423,3 +424,8 @@ void __init init_IRQ(void) ...@@ -423,3 +424,8 @@ void __init init_IRQ(void)
set_eiem(cpu_eiem); /* EIEM : enable all external intr */ 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 = { ...@@ -298,8 +298,7 @@ static struct pci_port_ops dino_port_ops = {
static void dino_disable_irq(unsigned int irq) static void dino_disable_irq(unsigned int irq)
{ {
struct irq_desc *desc = irq_to_desc(irq); struct dino_device *dino_dev = get_irq_chip_data(irq);
struct dino_device *dino_dev = desc->chip_data;
int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 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); DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq);
...@@ -311,8 +310,7 @@ static void dino_disable_irq(unsigned int irq) ...@@ -311,8 +310,7 @@ static void dino_disable_irq(unsigned int irq)
static void dino_enable_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 = get_irq_chip_data(irq);
struct dino_device *dino_dev = desc->chip_data;
int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
u32 tmp; u32 tmp;
...@@ -391,7 +389,7 @@ static irqreturn_t dino_isr(int irq, void *intr_dev) ...@@ -391,7 +389,7 @@ static irqreturn_t dino_isr(int irq, void *intr_dev)
int irq = dino_dev->global_irq[local_irq]; int irq = dino_dev->global_irq[local_irq];
DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n", DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n",
__func__, irq, intr_dev, mask); __func__, irq, intr_dev, mask);
__do_IRQ(irq); generic_handle_irq(irq);
mask &= ~(1 << local_irq); mask &= ~(1 << local_irq);
} while (mask); } while (mask);
......
...@@ -233,7 +233,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) ...@@ -233,7 +233,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev)
} }
spin_unlock_irqrestore(&eisa_irq_lock, flags); spin_unlock_irqrestore(&eisa_irq_lock, flags);
__do_IRQ(irq); generic_handle_irq(irq);
spin_lock_irqsave(&eisa_irq_lock, flags); spin_lock_irqsave(&eisa_irq_lock, flags);
/* unmask */ /* unmask */
...@@ -346,10 +346,10 @@ static int __init eisa_probe(struct parisc_device *dev) ...@@ -346,10 +346,10 @@ static int __init eisa_probe(struct parisc_device *dev)
} }
/* Reserve IRQ2 */ /* Reserve IRQ2 */
irq_to_desc(2)->action = &irq2_action; setup_irq(2, &irq2_action);
for (i = 0; i < 16; i++) { 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; EISA_bus = 1;
......
...@@ -86,7 +86,7 @@ irqreturn_t gsc_asic_intr(int gsc_asic_irq, void *dev) ...@@ -86,7 +86,7 @@ irqreturn_t gsc_asic_intr(int gsc_asic_irq, void *dev)
do { do {
int local_irq = __ffs(irr); int local_irq = __ffs(irr);
unsigned int irq = gsc_asic->global_irq[local_irq]; unsigned int irq = gsc_asic->global_irq[local_irq];
__do_IRQ(irq); generic_handle_irq(irq);
irr &= ~(1 << local_irq); irr &= ~(1 << local_irq);
} while (irr); } while (irr);
...@@ -107,8 +107,7 @@ int gsc_find_local_irq(unsigned int irq, int *global_irqs, int limit) ...@@ -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) static void gsc_asic_disable_irq(unsigned int irq)
{ {
struct irq_desc *desc = irq_to_desc(irq); struct gsc_asic *irq_dev = get_irq_chip_data(irq);
struct gsc_asic *irq_dev = desc->chip_data;
int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32);
u32 imr; u32 imr;
...@@ -123,8 +122,7 @@ static void gsc_asic_disable_irq(unsigned int irq) ...@@ -123,8 +122,7 @@ static void gsc_asic_disable_irq(unsigned int irq)
static void gsc_asic_enable_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 = get_irq_chip_data(irq);
struct gsc_asic *irq_dev = desc->chip_data;
int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32);
u32 imr; u32 imr;
...@@ -160,14 +158,13 @@ static struct irq_chip gsc_asic_interrupt_type = { ...@@ -160,14 +158,13 @@ static struct irq_chip gsc_asic_interrupt_type = {
int gsc_assign_irq(struct irq_chip *type, void *data) int gsc_assign_irq(struct irq_chip *type, void *data)
{ {
static int irq = GSC_IRQ_BASE; static int irq = GSC_IRQ_BASE;
struct irq_desc *desc;
if (irq > GSC_IRQ_MAX) if (irq > GSC_IRQ_MAX)
return NO_IRQ; return NO_IRQ;
desc = irq_to_desc(irq); set_irq_chip_and_handler(irq, type, parisc_do_IRQ);
desc->chip = type; set_irq_chip_data(irq, data);
desc->chip_data = data;
return irq++; return irq++;
} }
......
...@@ -615,17 +615,10 @@ iosapic_set_irt_data( struct vector_info *vi, u32 *dp0, u32 *dp1) ...@@ -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) static void iosapic_disable_irq(unsigned int irq)
{ {
unsigned long flags; unsigned long flags;
struct vector_info *vi = iosapic_get_vector(irq); struct vector_info *vi = get_irq_chip_data(irq);
u32 d0, d1; u32 d0, d1;
spin_lock_irqsave(&iosapic_lock, flags); spin_lock_irqsave(&iosapic_lock, flags);
...@@ -637,7 +630,7 @@ static void iosapic_disable_irq(unsigned int irq) ...@@ -637,7 +630,7 @@ static void iosapic_disable_irq(unsigned int irq)
static void iosapic_enable_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; u32 d0, d1;
/* data is initialized by fixup_irq */ /* data is initialized by fixup_irq */
...@@ -688,7 +681,7 @@ printk("\n"); ...@@ -688,7 +681,7 @@ printk("\n");
*/ */
static void iosapic_end_irq(unsigned int irq) 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, DBG(KERN_DEBUG "end_irq(%d): eoi(%p, 0x%x)\n", irq,
vi->eoi_addr, vi->eoi_data); vi->eoi_addr, vi->eoi_data);
iosapic_eoi(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) ...@@ -705,7 +698,7 @@ static unsigned int iosapic_startup_irq(unsigned int irq)
static int iosapic_set_affinity_irq(unsigned int irq, static int iosapic_set_affinity_irq(unsigned int irq,
const struct cpumask *dest) 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; u32 d0, d1, dummy_d0;
unsigned long flags; unsigned long flags;
int dest_cpu; int dest_cpu;
......
...@@ -139,7 +139,7 @@ superio_interrupt(int parent_irq, void *devp) ...@@ -139,7 +139,7 @@ superio_interrupt(int parent_irq, void *devp)
} }
/* Call the appropriate device's interrupt */ /* 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 /* set EOI - forces a new interrupt if a lower priority device
* still needs service. * still needs service.
...@@ -363,9 +363,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) ...@@ -363,9 +363,7 @@ int superio_fixup_irq(struct pci_dev *pcidev)
#endif #endif
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
struct irq_desc *desc = irq_to_desc(i); set_irq_chip_and_handler(i, &superio_interrupt_type, parisc_do_IRQ);
desc->chip = &superio_interrupt_type;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册