x86: ioapic: Convert mask to new irq_chip function

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Thomas Gleixner 2010-09-28 16:03:54 +02:00
parent 61a38ce3f5
commit 90297c5fe7

View file

@ -592,11 +592,9 @@ static void mask_ioapic(struct irq_cfg *cfg)
raw_spin_unlock_irqrestore(&ioapic_lock, flags); raw_spin_unlock_irqrestore(&ioapic_lock, flags);
} }
static void mask_ioapic_irq(unsigned int irq) static void mask_ioapic_irq(struct irq_data *data)
{ {
struct irq_cfg *cfg = get_irq_chip_data(irq); mask_ioapic(data->chip_data);
mask_ioapic(cfg);
} }
static void __unmask_ioapic(struct irq_cfg *cfg) static void __unmask_ioapic(struct irq_cfg *cfg)
@ -613,11 +611,9 @@ static void unmask_ioapic(struct irq_cfg *cfg)
raw_spin_unlock_irqrestore(&ioapic_lock, flags); raw_spin_unlock_irqrestore(&ioapic_lock, flags);
} }
static void unmask_ioapic_irq(unsigned int irq) static void unmask_ioapic_irq(struct irq_data *data)
{ {
struct irq_cfg *cfg = get_irq_chip_data(irq); unmask_ioapic(data->chip_data);
unmask_ioapic(cfg);
} }
static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin) static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
@ -2235,10 +2231,9 @@ static unsigned int startup_ioapic_irq(struct irq_data *data)
return was_pending; return was_pending;
} }
static int ioapic_retrigger_irq(unsigned int irq) static int ioapic_retrigger_irq(struct irq_data *data)
{ {
struct irq_cfg *cfg = data->chip_data;
struct irq_cfg *cfg = irq_cfg(irq);
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&vector_lock, flags); raw_spin_lock_irqsave(&vector_lock, flags);
@ -2519,12 +2514,10 @@ void irq_force_complete_move(int irq)
static inline void irq_complete_move(struct irq_cfg *cfg) { } static inline void irq_complete_move(struct irq_cfg *cfg) { }
#endif #endif
static void ack_apic_edge(unsigned int irq) static void ack_apic_edge(struct irq_data *data)
{ {
struct irq_cfg *cfg = get_irq_chip_data(irq); irq_complete_move(data->chip_data);
move_native_irq(data->irq);
irq_complete_move(cfg);
move_native_irq(irq);
ack_APIC_irq(); ack_APIC_irq();
} }
@ -2572,11 +2565,11 @@ static void eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
raw_spin_unlock_irqrestore(&ioapic_lock, flags); raw_spin_unlock_irqrestore(&ioapic_lock, flags);
} }
static void ack_apic_level(unsigned int irq) static void ack_apic_level(struct irq_data *data)
{ {
struct irq_cfg *cfg = data->chip_data;
int i, do_unmask_irq = 0, irq = data->irq;
struct irq_desc *desc = irq_to_desc(irq); struct irq_desc *desc = irq_to_desc(irq);
struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
int i, do_unmask_irq = 0;
unsigned long v; unsigned long v;
irq_complete_move(cfg); irq_complete_move(cfg);
@ -2677,46 +2670,44 @@ static void ack_apic_level(unsigned int irq)
} }
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
static void ir_ack_apic_edge(unsigned int irq) static void ir_ack_apic_edge(struct irq_data *data)
{ {
ack_APIC_irq(); ack_APIC_irq();
} }
static void ir_ack_apic_level(unsigned int irq) static void ir_ack_apic_level(struct irq_data *data)
{ {
struct irq_cfg *cfg = get_irq_chip_data(irq);
ack_APIC_irq(); ack_APIC_irq();
eoi_ioapic_irq(irq, cfg); eoi_ioapic_irq(data->irq, data->chip_data);
} }
#endif /* CONFIG_INTR_REMAP */ #endif /* CONFIG_INTR_REMAP */
static struct irq_chip ioapic_chip __read_mostly = { static struct irq_chip ioapic_chip __read_mostly = {
.name = "IO-APIC", .name = "IO-APIC",
.irq_startup = startup_ioapic_irq, .irq_startup = startup_ioapic_irq,
.mask = mask_ioapic_irq, .irq_mask = mask_ioapic_irq,
.unmask = unmask_ioapic_irq, .irq_unmask = unmask_ioapic_irq,
.ack = ack_apic_edge, .irq_ack = ack_apic_edge,
.eoi = ack_apic_level, .irq_eoi = ack_apic_level,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = set_ioapic_affinity_irq, .set_affinity = set_ioapic_affinity_irq,
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
static struct irq_chip ir_ioapic_chip __read_mostly = { static struct irq_chip ir_ioapic_chip __read_mostly = {
.name = "IR-IO-APIC", .name = "IR-IO-APIC",
.irq_startup = startup_ioapic_irq, .irq_startup = startup_ioapic_irq,
.mask = mask_ioapic_irq, .irq_mask = mask_ioapic_irq,
.unmask = unmask_ioapic_irq, .irq_unmask = unmask_ioapic_irq,
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
.ack = ir_ack_apic_edge, .irq_ack = ir_ack_apic_edge,
.eoi = ir_ack_apic_level, .irq_eoi = ir_ack_apic_level,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = set_ir_ioapic_affinity_irq, .set_affinity = set_ir_ioapic_affinity_irq,
#endif #endif
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
static inline void init_IO_APIC_traps(void) static inline void init_IO_APIC_traps(void)
@ -2757,7 +2748,7 @@ static inline void init_IO_APIC_traps(void)
* The local APIC irq-chip implementation: * The local APIC irq-chip implementation:
*/ */
static void mask_lapic_irq(unsigned int irq) static void mask_lapic_irq(struct irq_data *data)
{ {
unsigned long v; unsigned long v;
@ -2765,7 +2756,7 @@ static void mask_lapic_irq(unsigned int irq)
apic_write(APIC_LVT0, v | APIC_LVT_MASKED); apic_write(APIC_LVT0, v | APIC_LVT_MASKED);
} }
static void unmask_lapic_irq(unsigned int irq) static void unmask_lapic_irq(struct irq_data *data)
{ {
unsigned long v; unsigned long v;
@ -2773,16 +2764,16 @@ static void unmask_lapic_irq(unsigned int irq)
apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED); apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED);
} }
static void ack_lapic_irq(unsigned int irq) static void ack_lapic_irq(struct irq_data *data)
{ {
ack_APIC_irq(); ack_APIC_irq();
} }
static struct irq_chip lapic_chip __read_mostly = { static struct irq_chip lapic_chip __read_mostly = {
.name = "local-APIC", .name = "local-APIC",
.mask = mask_lapic_irq, .irq_mask = mask_lapic_irq,
.unmask = unmask_lapic_irq, .irq_unmask = unmask_lapic_irq,
.ack = ack_lapic_irq, .irq_ack = ack_lapic_irq,
}; };
static void lapic_register_intr(int irq, struct irq_desc *desc) static void lapic_register_intr(int irq, struct irq_desc *desc)
@ -3417,11 +3408,11 @@ static struct irq_chip msi_chip = {
.name = "PCI-MSI", .name = "PCI-MSI",
.irq_unmask = unmask_msi_irq, .irq_unmask = unmask_msi_irq,
.irq_mask = mask_msi_irq, .irq_mask = mask_msi_irq,
.ack = ack_apic_edge, .irq_ack = ack_apic_edge,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = set_msi_irq_affinity, .set_affinity = set_msi_irq_affinity,
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
static struct irq_chip msi_ir_chip = { static struct irq_chip msi_ir_chip = {
@ -3429,12 +3420,12 @@ static struct irq_chip msi_ir_chip = {
.irq_unmask = unmask_msi_irq, .irq_unmask = unmask_msi_irq,
.irq_mask = mask_msi_irq, .irq_mask = mask_msi_irq,
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
.ack = ir_ack_apic_edge, .irq_ack = ir_ack_apic_edge,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = ir_set_msi_irq_affinity, .set_affinity = ir_set_msi_irq_affinity,
#endif #endif
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
/* /*
@ -3589,11 +3580,11 @@ static struct irq_chip dmar_msi_type = {
.name = "DMAR_MSI", .name = "DMAR_MSI",
.unmask = dmar_msi_unmask, .unmask = dmar_msi_unmask,
.mask = dmar_msi_mask, .mask = dmar_msi_mask,
.ack = ack_apic_edge, .irq_ack = ack_apic_edge,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = dmar_msi_set_affinity, .set_affinity = dmar_msi_set_affinity,
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
int arch_setup_dmar_msi(unsigned int irq) int arch_setup_dmar_msi(unsigned int irq)
@ -3645,23 +3636,23 @@ static struct irq_chip ir_hpet_msi_type = {
.unmask = hpet_msi_unmask, .unmask = hpet_msi_unmask,
.mask = hpet_msi_mask, .mask = hpet_msi_mask,
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
.ack = ir_ack_apic_edge, .irq_ack = ir_ack_apic_edge,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = ir_set_msi_irq_affinity, .set_affinity = ir_set_msi_irq_affinity,
#endif #endif
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
static struct irq_chip hpet_msi_type = { static struct irq_chip hpet_msi_type = {
.name = "HPET_MSI", .name = "HPET_MSI",
.unmask = hpet_msi_unmask, .unmask = hpet_msi_unmask,
.mask = hpet_msi_mask, .mask = hpet_msi_mask,
.ack = ack_apic_edge, .irq_ack = ack_apic_edge,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = hpet_msi_set_affinity, .set_affinity = hpet_msi_set_affinity,
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
int arch_setup_hpet_msi(unsigned int irq, unsigned int id) int arch_setup_hpet_msi(unsigned int irq, unsigned int id)
@ -3743,11 +3734,11 @@ static struct irq_chip ht_irq_chip = {
.name = "PCI-HT", .name = "PCI-HT",
.mask = mask_ht_irq, .mask = mask_ht_irq,
.unmask = unmask_ht_irq, .unmask = unmask_ht_irq,
.ack = ack_apic_edge, .irq_ack = ack_apic_edge,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
.set_affinity = set_ht_irq_affinity, .set_affinity = set_ht_irq_affinity,
#endif #endif
.retrigger = ioapic_retrigger_irq, .irq_retrigger = ioapic_retrigger_irq,
}; };
int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)