[patch 27/47] x86: ioapic: Convert mask to new irq_chip function

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Gleixner
Date: Thursday, September 30, 2010 - 4:16 pm

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/io_apic.c |   95 ++++++++++++++++++-----------------------
 1 file changed, 43 insertions(+), 52 deletions(-)

Index: linux-2.6-tip/arch/x86/kernel/apic/io_apic.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6-tip/arch/x86/kernel/apic/io_apic.c
@@ -592,11 +592,9 @@ static void mask_ioapic(struct irq_cfg *
 	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(cfg);
+	mask_ioapic(data->chip_data);
 }
 
 static void __unmask_ioapic(struct irq_cfg *cfg)
@@ -613,11 +611,9 @@ static void unmask_ioapic(struct irq_cfg
 	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(cfg);
+	unmask_ioapic(data->chip_data);
 }
 
 static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
@@ -2249,10 +2245,9 @@ static unsigned int startup_ioapic_irq(s
 	return was_pending;
 }
 
-static int ioapic_retrigger_irq(unsigned int irq)
+static int ioapic_retrigger_irq(struct irq_data *data)
 {
-
-	struct irq_cfg *cfg = irq_cfg(irq);
+	struct irq_cfg *cfg = data->chip_data;
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&vector_lock, flags);
@@ -2533,12 +2528,10 @@ void irq_force_complete_move(int irq)
 static inline void irq_complete_move(struct irq_cfg *cfg) { }
 #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(cfg);
-	move_native_irq(irq);
+	irq_complete_move(data->chip_data);
+	move_native_irq(data->irq);
 	ack_APIC_irq();
 }
 
@@ -2586,11 +2579,11 @@ static void eoi_ioapic_irq(unsigned int 
 	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_cfg *cfg = get_irq_desc_chip_data(desc);
-	int i, do_unmask_irq = 0;
 	unsigned long v;
 
 	irq_complete_move(cfg);
@@ -2691,46 +2684,44 @@ static void ack_apic_level(unsigned int 
 }
 
 #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();
 }
 
-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();
-	eoi_ioapic_irq(irq, cfg);
+	eoi_ioapic_irq(data->irq, data->chip_data);
 }
 #endif /* CONFIG_INTR_REMAP */
 
 static struct irq_chip ioapic_chip __read_mostly = {
 	.name		= "IO-APIC",
 	.irq_startup	= startup_ioapic_irq,
-	.mask		= mask_ioapic_irq,
-	.unmask		= unmask_ioapic_irq,
-	.ack		= ack_apic_edge,
-	.eoi		= ack_apic_level,
+	.irq_mask	= mask_ioapic_irq,
+	.irq_unmask	= unmask_ioapic_irq,
+	.irq_ack	= ack_apic_edge,
+	.irq_eoi	= ack_apic_level,
 #ifdef CONFIG_SMP
 	.set_affinity	= set_ioapic_affinity_irq,
 #endif
-	.retrigger	= ioapic_retrigger_irq,
+	.irq_retrigger	= ioapic_retrigger_irq,
 };
 
 static struct irq_chip ir_ioapic_chip __read_mostly = {
 	.name		= "IR-IO-APIC",
 	.irq_startup	= startup_ioapic_irq,
-	.mask		= mask_ioapic_irq,
-	.unmask		= unmask_ioapic_irq,
+	.irq_mask	= mask_ioapic_irq,
+	.irq_unmask	= unmask_ioapic_irq,
 #ifdef CONFIG_INTR_REMAP
-	.ack		= ir_ack_apic_edge,
-	.eoi		= ir_ack_apic_level,
+	.irq_ack	= ir_ack_apic_edge,
+	.irq_eoi	= ir_ack_apic_level,
 #ifdef CONFIG_SMP
 	.set_affinity	= set_ir_ioapic_affinity_irq,
 #endif
 #endif
-	.retrigger	= ioapic_retrigger_irq,
+	.irq_retrigger	= ioapic_retrigger_irq,
 };
 
 static inline void init_IO_APIC_traps(void)
@@ -2771,7 +2762,7 @@ static inline void init_IO_APIC_traps(vo
  * 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;
 
@@ -2779,7 +2770,7 @@ static void mask_lapic_irq(unsigned int 
 	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;
 
@@ -2787,16 +2778,16 @@ static void unmask_lapic_irq(unsigned in
 	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();
 }
 
 static struct irq_chip lapic_chip __read_mostly = {
 	.name		= "local-APIC",
-	.mask		= mask_lapic_irq,
-	.unmask		= unmask_lapic_irq,
-	.ack		= ack_lapic_irq,
+	.irq_mask	= mask_lapic_irq,
+	.irq_unmask	= unmask_lapic_irq,
+	.irq_ack	= ack_lapic_irq,
 };
 
 static void lapic_register_intr(int irq, struct irq_desc *desc)
@@ -3438,11 +3429,11 @@ static struct irq_chip msi_chip = {
 	.name		= "PCI-MSI",
 	.unmask		= unmask_msi_irq,
 	.mask		= mask_msi_irq,
-	.ack		= ack_apic_edge,
+	.irq_ack	= ack_apic_edge,
 #ifdef CONFIG_SMP
 	.set_affinity	= set_msi_irq_affinity,
 #endif
-	.retrigger	= ioapic_retrigger_irq,
+	.irq_retrigger	= ioapic_retrigger_irq,
 };
 
 static struct irq_chip msi_ir_chip = {
@@ -3450,12 +3441,12 @@ static struct irq_chip msi_ir_chip = {
 	.unmask		= unmask_msi_irq,
 	.mask		= mask_msi_irq,
 #ifdef CONFIG_INTR_REMAP
-	.ack		= ir_ack_apic_edge,
+	.irq_ack	= ir_ack_apic_edge,
 #ifdef CONFIG_SMP
 	.set_affinity	= ir_set_msi_irq_affinity,
 #endif
 #endif
-	.retrigger	= ioapic_retrigger_irq,
+	.irq_retrigger	= ioapic_retrigger_irq,
 };
 
 /*
@@ -3610,11 +3601,11 @@ static struct irq_chip dmar_msi_type = {
 	.name = "DMAR_MSI",
 	.unmask = dmar_msi_unmask,
 	.mask = dmar_msi_mask,
-	.ack = ack_apic_edge,
+	.irq_ack = ack_apic_edge,
 #ifdef CONFIG_SMP
 	.set_affinity = dmar_msi_set_affinity,
 #endif
-	.retrigger = ioapic_retrigger_irq,
+	.irq_retrigger = ioapic_retrigger_irq,
 };
 
 int arch_setup_dmar_msi(unsigned int irq)
@@ -3666,23 +3657,23 @@ static struct irq_chip ir_hpet_msi_type 
 	.unmask = hpet_msi_unmask,
 	.mask = hpet_msi_mask,
 #ifdef CONFIG_INTR_REMAP
-	.ack = ir_ack_apic_edge,
+	.irq_ack = ir_ack_apic_edge,
 #ifdef CONFIG_SMP
 	.set_affinity = ir_set_msi_irq_affinity,
 #endif
 #endif
-	.retrigger = ioapic_retrigger_irq,
+	.irq_retrigger = ioapic_retrigger_irq,
 };
 
 static struct irq_chip hpet_msi_type = {
 	.name = "HPET_MSI",
 	.unmask = hpet_msi_unmask,
 	.mask = hpet_msi_mask,
-	.ack = ack_apic_edge,
+	.irq_ack = ack_apic_edge,
 #ifdef CONFIG_SMP
 	.set_affinity = hpet_msi_set_affinity,
 #endif
-	.retrigger = ioapic_retrigger_irq,
+	.irq_retrigger = ioapic_retrigger_irq,
 };
 
 int arch_setup_hpet_msi(unsigned int irq, unsigned int id)
@@ -3764,11 +3755,11 @@ static struct irq_chip ht_irq_chip = {
 	.name		= "PCI-HT",
 	.mask		= mask_ht_irq,
 	.unmask		= unmask_ht_irq,
-	.ack		= ack_apic_edge,
+	.irq_ack	= ack_apic_edge,
 #ifdef CONFIG_SMP
 	.set_affinity	= set_ht_irq_affinity,
 #endif
-	.retrigger	= ioapic_retrigger_irq,
+	.irq_retrigger	= ioapic_retrigger_irq,
 };
 
 int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/47] Sparse irq rework, Thomas Gleixner, (Thu Sep 30, 4:14 pm)
[patch 01/47] x86: Plug memory leak in sparse irq, Thomas Gleixner, (Thu Sep 30, 4:14 pm)
[patch 03/47] genirq: Provide status modifier, Thomas Gleixner, (Thu Sep 30, 4:14 pm)
[patch 04/47] arm: Use irq status modifier, Thomas Gleixner, (Thu Sep 30, 4:14 pm)
[patch 05/47] genirq-sanitize-irq-data-accessors.patch, Thomas Gleixner, (Thu Sep 30, 4:14 pm)
[patch 06/47] genirq: Distangle kernel/irq/handle.c, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 07/47] genirq: Remove early_init_irq_lock_class(), Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 08/47] genirq: Move core only inlines to kernel/irq, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 10/47] genirq: Remove export of kstat_irqs_cpu, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 11/47] genirq: Provide default irq init flags, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 12/47] arm: Use ARCH_IRQ_INIT_FLAGS, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 13/47] powerpc: Use ARCH_IRQ_INIT_FLAGS, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 14/47] genirq: Implement a sane sparse_irq allocator, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 16/47] genirq: Implement sane enumeration, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 17/47] genirq-update-kerneldoc.patch, Thomas Gleixner, (Thu Sep 30, 4:15 pm)
[patch 18/47] genirq: Use sane sparse allocator, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 21/47] x86: Sanitize apb timer interrupt handling, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 22/47] x86: lguest: Convert to new irq chip functions, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 23/47] x86: Cleanup visws interrupt handling, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 24/47] x86: i8259: Convert to new irq_chip functions, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 25/47] x86: Cleanup io_apic, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 27/47] x86: ioapic: Convert mask to new irq_chip fu ..., Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 29/47] pci: Convert msi to new irq_chip functions, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 30/47] dmar: Convert to new irq chip functions, Thomas Gleixner, (Thu Sep 30, 4:16 pm)
[patch 31/47] ht: Convert to new irq_chip functions, Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 33/47] pci: Cleanup the irq_desc mess in msi, Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 35/47] x86: ioapic: Cleanup some more, Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 36/47] x86: ioapic: Cleanup sparse irq code, Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 38/47] x86: Use sane enumeration, Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 39/47] genirq: Remove arch_init_chip_data(), Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 40/47] genirq: Sanitize dynamic irq handling, Thomas Gleixner, (Thu Sep 30, 4:17 pm)
[patch 41/47] arm: davinci: Cleanup irq_desc access, Thomas Gleixner, (Thu Sep 30, 4:18 pm)
[patch 43/47] x86: xen: Sanitise sparse_irq handling, Thomas Gleixner, (Thu Sep 30, 4:18 pm)
[patch 44/47] sh: Sanitize sparse irq, Thomas Gleixner, (Thu Sep 30, 4:18 pm)
[patch 45/47] x86: lguest: Use new irq allocator, Thomas Gleixner, (Thu Sep 30, 4:18 pm)
[patch 46/47] powerpc: Use new irq allocator, Thomas Gleixner, (Thu Sep 30, 4:18 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Benjamin Herrenschmidt, (Thu Sep 30, 5:42 pm)
Re: [patch 00/47] Sparse irq rework, Linus Torvalds, (Thu Sep 30, 8:32 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Thu Sep 30, 10:54 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Thomas Gleixner, (Fri Oct 1, 6:07 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Fri Oct 1, 1:35 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Benjamin Herrenschmidt, (Fri Oct 1, 1:46 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Grant Likely, (Fri Oct 1, 2:11 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Benjamin Herrenschmidt, (Fri Oct 1, 2:17 pm)
Re: [patch 16/47] genirq: Implement sane enumeration, Grant Likely, (Sun Oct 3, 3:55 am)
Re: [patch 00/47] Sparse irq rework, Grant Likely, (Sun Oct 3, 4:23 am)
Re: [patch 00/47] Sparse irq rework, Russell King - ARM Linux, (Sun Oct 3, 4:29 am)
Re: [patch 00/47] Sparse irq rework, Grant Likely, (Sun Oct 3, 4:57 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Sun Oct 3, 6:48 am)
Re: [patch 20/47] x86: Remove useless reinitialization of ..., Eric W. Biederman, (Sun Oct 3, 8:21 am)
Re: [patch 00/47] Sparse irq rework, Eric W. Biederman, (Sun Oct 3, 9:41 am)
Re: [patch 46/47] powerpc: Use new irq allocator, Eric W. Biederman, (Sun Oct 3, 9:53 am)
Re: [patch 46/47] powerpc: Use new irq allocator, Thomas Gleixner, (Sun Oct 3, 11:34 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Sun Oct 3, 12:16 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Thomas Gleixner, (Sun Oct 3, 1:04 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Benjamin Herrenschmidt, (Sun Oct 3, 3:54 pm)
Re: [patch 00/47] Sparse irq rework, Benjamin Herrenschmidt, (Sun Oct 3, 3:57 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Eric W. Biederman, (Sun Oct 3, 5:15 pm)
Re: [patch 46/47] powerpc: Use new irq allocator, Benjamin Herrenschmidt, (Sun Oct 3, 5:37 pm)
Re: [patch 00/47] Sparse irq rework, Eric W. Biederman, (Sun Oct 3, 5:49 pm)
Re: [patch 00/47] Sparse irq rework, Eric W. Biederman, (Sun Oct 3, 6:13 pm)
Re: [patch 00/47] Sparse irq rework, Ingo Molnar, (Sun Oct 3, 11:36 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Mon Oct 4, 1:05 am)
Re: [patch 00/47] Sparse irq rework, Grant Likely, (Mon Oct 4, 9:31 am)
Re: [patch 46/47] powerpc: Use new irq allocator, Grant Likely, (Mon Oct 4, 9:46 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Tue Oct 5, 3:22 am)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Wed Oct 6, 3:45 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Wed Oct 6, 3:52 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Wed Oct 6, 4:37 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Wed Oct 6, 5:16 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Wed Oct 6, 9:01 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Wed Oct 6, 9:38 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Fri Oct 8, 2:50 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Fri Oct 8, 2:54 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Fri Oct 8, 9:26 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Fri Oct 8, 10:44 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Fri Oct 8, 11:10 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Fri Oct 8, 11:34 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Sat Oct 9, 12:03 am)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Sat Oct 9, 12:08 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Sat Oct 9, 5:08 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Sat Oct 9, 5:12 am)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Sat Oct 9, 7:32 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Sat Oct 9, 10:11 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Sun Oct 10, 1:20 am)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Sun Oct 10, 2:32 am)
Re: [patch 00/47] Sparse irq rework, Anca Emanuel, (Sun Oct 10, 6:30 am)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Sun Oct 10, 7:20 pm)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Sun Oct 10, 8:50 pm)
Re: [patch 00/47] Sparse irq rework, Thomas Gleixner, (Mon Oct 11, 1:16 am)
Re: [patch 00/47] Sparse irq rework, Benjamin Herrenschmidt, (Mon Oct 11, 4:34 am)
Re: [patch 00/47] Sparse irq rework, Yinghai Lu, (Mon Oct 11, 9:19 am)
Re: [patch 33/47] pci: Cleanup the irq_desc mess in msi, Jesse Barnes, (Mon Oct 11, 10:08 am)
[tip:irq/core] x86: Don't setup ioapic irq for sci twice, tip-bot for Yinghai Lu, (Tue Oct 12, 1:23 pm)