public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 00/19] genirq: Cleanup and irq_chip functions overhaul
@ 2010-09-27 12:44 Thomas Gleixner
  2010-09-27 12:44 ` [patch 01/19] genirq: Cleanup access to irq_data Thomas Gleixner
                   ` (18 more replies)
  0 siblings, 19 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra,
	Julia Lawall

I'm working on a large scale overhaul of the generic irq code. One of
the goals is to sanitize the sparse irq code, which is pretty much
impossible right now as there are too many sites accessing and
fiddling with irq_desc directly (And I'm not even talking about the
__do_IRQ() cadavers).

Some of these accesses have legacy reasons, some grew out of laziness
and some are just due to shortcomings in the generic code, which need
to be addressed.

The long term plan is to make irq desc private to the generic irq code
to allow freeing of unused irq descriptors, moving the irq descriptor
to a different node when the irq affinity changes and to allow
internal optimizations.

Following problems need to be addressed:

 - irq chips, which need to access irq_desc->chip_data, msi_desc etc.
  
    This is a problem already today when sparse irq is enabled. We
    need to lookup the irq desc for the interrupt to gain access to
    the data. With sparse this requires a redundant radix tree lookup
    as the core code already has a pointer to irq desc when the low
    level chip functions are called.

    It was proposed to simply hand down irq_desc in the functions, but
    low level code should not know about the details of irq_desc at
    all.

    The solution to this is to switch to a new set of irq_chip
    functions which have as single argument a pointer to a new
    irq_data structure which holds the irq number, desc->handler_data,
    desc->chip_data, desc->msi_desc, desc->affinity and a reference to
    the chip itself. The structure is embedded into irq_desc for now,
    but that's going to change, when the first cleanup round is done.

    AFAICT, that should be sufficient to satisfy the requirements of
    all low level implementations.

    For a transition phase both the old and the new functions are
    handled with wrappers in the core code.

    The new functions are implemented in:
    [Patch 3/19] genirq: Provide advanced irq chip functions
    
    Note: chip->end() will be dropped as it is just related to the old
    __do_IRQ() function and not used in the flow based handler code.


 - direct access to irq desc in architecture / drivers code.

    That's mostly related to sparse, irq affinity settings,
    show_interrupts() and fixup of irqs on cpu hot unplug.

    sparse just needs access to the irq desc due to a massive design
    failure. Most arch implementations are easy to fix except for the
    x86 one which is an utter nightmare.

    affinity settings are easy to fix with the new chip functions

    show_interrupts() should be made generic code with an arch callback
    for the extra irq related statistics (NMI, direct vectors, etc.)

    The cpu hot unplug fixup functions which handle the move of
    interrupts from a hotplug CPU do not need access to irq_desc when
    the cpu unplug code calls into the genirq core code and let it
    migrate the interrupts before calling into the architecture
    specific cpu down function. That needs some more thought, but I
    think it's a solvable problem.

    Some private irq flow handlers in arch/ can be generalized and
    moved to the generic code.

    The remaining few cases where architecture or irq chip code
    fiddles with irq_desc->status are relatively easy to cleanup.

This is going to be a major surgery in some places so I need all the
help I can get, but parts of the cleanups can be done scripted. I hope
Julia can come up with a solution to go through the irq_chip functions
and convert most of them with spatch.

The transition phase is definitly going to be short and I'm not going
to keep the old chip functions around for years like we did with
__do_IRQ().

Comments ?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 01/19] genirq: Cleanup access to irq_data
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 02/19] genirq: Create irq_data Thomas Gleixner
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-cleanup-access-to-irq-data.patch --]
[-- Type: text/plain, Size: 23264 bytes --]

Fixup the open coded access to 
      irq_desc->[handler_data|chip_data|msi-desc]

Use the macros and inline functions for it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/arm/plat-samsung/irq-uart.c             |    5 -
 arch/arm/plat-samsung/irq-vic-timer.c        |    7 --
 arch/avr32/mach-at32ap/extint.c              |    2 
 arch/powerpc/include/asm/qe_ic.h             |   10 +--
 arch/powerpc/platforms/82xx/pq2ads-pci-pic.c |    2 
 arch/powerpc/platforms/cell/interrupt.c      |    4 +
 arch/powerpc/platforms/cell/setup.c          |    2 
 arch/powerpc/platforms/cell/spider-pic.c     |    2 
 arch/powerpc/platforms/powermac/pic.c        |    2 
 arch/powerpc/platforms/pseries/xics.c        |    2 
 arch/powerpc/sysdev/mpic.c                   |    6 +-
 arch/powerpc/sysdev/qe_lib/qe_ic.c           |    2 
 arch/x86/kernel/apic/io_apic.c               |   71 +++++++++++++--------------
 arch/x86/kernel/uv_irq.c                     |    2 
 drivers/parisc/dino.c                        |    6 --
 drivers/parisc/gsc.c                         |   12 +---
 drivers/parisc/iosapic.c                     |    4 -
 include/linux/irq.h                          |    5 +
 18 files changed, 71 insertions(+), 75 deletions(-)

Index: linux-2.6-tip/arch/arm/plat-samsung/irq-uart.c
===================================================================
--- linux-2.6-tip.orig/arch/arm/plat-samsung/irq-uart.c
+++ linux-2.6-tip/arch/arm/plat-samsung/irq-uart.c
@@ -83,7 +83,7 @@ static void s3c_irq_uart_ack(unsigned in
 
 static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc)
 {
-	struct s3c_uart_irq *uirq = desc->handler_data;
+	struct s3c_uart_irq *uirq = get_irq_desc_data(desc);
 	u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP);
 	int base = uirq->base_irq;
 
@@ -107,7 +107,6 @@ static struct irq_chip s3c_irq_uart = {
 
 static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq)
 {
-	struct irq_desc *desc = irq_to_desc(uirq->parent_irq);
 	void __iomem *reg_base = uirq->regs;
 	unsigned int irq;
 	int offs;
@@ -124,7 +123,7 @@ static void __init s3c_init_uart_irq(str
 		set_irq_flags(irq, IRQF_VALID);
 	}
 
-	desc->handler_data = uirq;
+	set_irq_data(uirq->parent_irq, uirq);
 	set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart);
 }
 
Index: linux-2.6-tip/arch/arm/plat-samsung/irq-vic-timer.c
===================================================================
--- linux-2.6-tip.orig/arch/arm/plat-samsung/irq-vic-timer.c
+++ linux-2.6-tip/arch/arm/plat-samsung/irq-vic-timer.c
@@ -24,7 +24,7 @@
 
 static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc)
 {
-	generic_handle_irq((int)desc->handler_data);
+	generic_handle_irq((int)get_irq_desc_data(desc));
 }
 
 /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
@@ -74,13 +74,10 @@ static struct irq_chip s3c_irq_timer = {
 void __init s3c_init_vic_timer_irq(unsigned int parent_irq,
 				   unsigned int timer_irq)
 {
-	struct irq_desc *desc = irq_to_desc(parent_irq);
-
 	set_irq_chained_handler(parent_irq, s3c_irq_demux_vic_timer);
 
 	set_irq_chip(timer_irq, &s3c_irq_timer);
 	set_irq_handler(timer_irq, handle_level_irq);
 	set_irq_flags(timer_irq, IRQF_VALID);
-
-	desc->handler_data = (void *)timer_irq;
+	set_irq_data(timer_irq, (void *)timer_irq;
 }
Index: linux-2.6-tip/arch/avr32/mach-at32ap/extint.c
===================================================================
--- linux-2.6-tip.orig/arch/avr32/mach-at32ap/extint.c
+++ linux-2.6-tip/arch/avr32/mach-at32ap/extint.c
@@ -154,7 +154,7 @@ static struct irq_chip eic_chip = {
 
 static void demux_eic_irq(unsigned int irq, struct irq_desc *desc)
 {
-	struct eic *eic = desc->handler_data;
+	struct eic *eic = get_irq_desc_data(desc);
 	unsigned long status, pending;
 	unsigned int i;
 
Index: linux-2.6-tip/arch/powerpc/include/asm/qe_ic.h
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/include/asm/qe_ic.h
+++ linux-2.6-tip/arch/powerpc/include/asm/qe_ic.h
@@ -81,7 +81,7 @@ int qe_ic_set_high_priority(unsigned int
 static inline void qe_ic_cascade_low_ipic(unsigned int irq,
 					  struct irq_desc *desc)
 {
-	struct qe_ic *qe_ic = desc->handler_data;
+	struct qe_ic *qe_ic = get_irq_desc_data(desc);
 	unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
 
 	if (cascade_irq != NO_IRQ)
@@ -91,7 +91,7 @@ static inline void qe_ic_cascade_low_ipi
 static inline void qe_ic_cascade_high_ipic(unsigned int irq,
 					   struct irq_desc *desc)
 {
-	struct qe_ic *qe_ic = desc->handler_data;
+	struct qe_ic *qe_ic = get_irq_desc_data(desc);
 	unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
 
 	if (cascade_irq != NO_IRQ)
@@ -101,7 +101,7 @@ static inline void qe_ic_cascade_high_ip
 static inline void qe_ic_cascade_low_mpic(unsigned int irq,
 					  struct irq_desc *desc)
 {
-	struct qe_ic *qe_ic = desc->handler_data;
+	struct qe_ic *qe_ic = get_irq_desc_data(desc);
 	unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
 
 	if (cascade_irq != NO_IRQ)
@@ -113,7 +113,7 @@ static inline void qe_ic_cascade_low_mpi
 static inline void qe_ic_cascade_high_mpic(unsigned int irq,
 					   struct irq_desc *desc)
 {
-	struct qe_ic *qe_ic = desc->handler_data;
+	struct qe_ic *qe_ic = get_irq_desc_data(desc);
 	unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
 
 	if (cascade_irq != NO_IRQ)
@@ -125,7 +125,7 @@ static inline void qe_ic_cascade_high_mp
 static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
 					    struct irq_desc *desc)
 {
-	struct qe_ic *qe_ic = desc->handler_data;
+	struct qe_ic *qe_ic = get_irq_desc_data(desc);
 	unsigned int cascade_irq;
 
 	cascade_irq = qe_ic_get_high_irq(qe_ic);
Index: linux-2.6-tip/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ linux-2.6-tip/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -82,7 +82,7 @@ static struct irq_chip pq2ads_pci_ic = {
 
 static void pq2ads_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
 {
-	struct pq2ads_pci_pic *priv = desc->handler_data;
+	struct pq2ads_pci_pic *priv = get_irq_desc_data(desc);
 	u32 stat, mask, pend;
 	int bit;
 
Index: linux-2.6-tip/arch/powerpc/platforms/cell/interrupt.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/cell/interrupt.c
+++ linux-2.6-tip/arch/powerpc/platforms/cell/interrupt.c
@@ -101,11 +101,13 @@ static void iic_ioexc_eoi(unsigned int i
 
 static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc)
 {
-	struct cbe_iic_regs __iomem *node_iic = (void __iomem *)desc->handler_data;
+	struct cbe_iic_regs __iomem *node_iic;
 	unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC;
 	unsigned long bits, ack;
 	int cascade;
 
+	node_iic = (void __iomem *)get_irq_desc_data(desc);
+
 	for (;;) {
 		bits = in_be64(&node_iic->iic_is);
 		if (bits == 0)
Index: linux-2.6-tip/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/cell/setup.c
+++ linux-2.6-tip/arch/powerpc/platforms/cell/setup.c
@@ -187,7 +187,7 @@ machine_subsys_initcall(cell, cell_publi
 
 static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
 {
-	struct mpic *mpic = desc->handler_data;
+	struct mpic *mpic = get_irq_desc_data(desc);
 	unsigned int virq;
 
 	virq = mpic_get_one_irq(mpic);
Index: linux-2.6-tip/arch/powerpc/platforms/cell/spider-pic.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/cell/spider-pic.c
+++ linux-2.6-tip/arch/powerpc/platforms/cell/spider-pic.c
@@ -207,7 +207,7 @@ static struct irq_host_ops spider_host_o
 
 static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc)
 {
-	struct spider_pic *pic = desc->handler_data;
+	struct spider_pic *pic = get_irq_desc_data(desc);
 	unsigned int cs, virq;
 
 	cs = in_be32(pic->regs + TIR_CS) >> 24;
Index: linux-2.6-tip/arch/powerpc/platforms/powermac/pic.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/powermac/pic.c
+++ linux-2.6-tip/arch/powerpc/platforms/powermac/pic.c
@@ -472,7 +472,7 @@ int of_irq_map_oldworld(struct device_no
 
 static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc)
 {
-	struct mpic *mpic = desc->handler_data;
+	struct mpic *mpic = get_irq_desc_data(desc);
 
 	unsigned int cascade_irq = mpic_get_one_irq(mpic);
 	if (cascade_irq != NO_IRQ)
Index: linux-2.6-tip/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/pseries/xics.c
+++ linux-2.6-tip/arch/powerpc/platforms/pseries/xics.c
@@ -242,7 +242,7 @@ static unsigned int xics_startup(unsigne
 	 * card, using the MSI mask bits. Firmware doesn't appear to unmask
 	 * at that level, so we do it here by hand.
 	 */
-	if (irq_to_desc(virq)->msi_desc)
+	if (get_irq_msi(virq))
 		unmask_msi_irq(virq);
 
 	/* unmask it */
Index: linux-2.6-tip/arch/powerpc/sysdev/mpic.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/sysdev/mpic.c
+++ linux-2.6-tip/arch/powerpc/sysdev/mpic.c
@@ -611,7 +611,7 @@ static struct mpic *mpic_find(unsigned i
 	if (irq < NUM_ISA_INTERRUPTS)
 		return NULL;
 
-	return irq_to_desc(irq)->chip_data;
+	return get_irq_chip_data(irq);
 }
 
 /* Determine if the linux irq is an IPI */
@@ -638,14 +638,14 @@ static inline u32 mpic_physmask(u32 cpum
 /* Get the mpic structure from the IPI number */
 static inline struct mpic * mpic_from_ipi(unsigned int ipi)
 {
-	return irq_to_desc(ipi)->chip_data;
+	return get_irq_chip_data(ipi);
 }
 #endif
 
 /* Get the mpic structure from the irq number */
 static inline struct mpic * mpic_from_irq(unsigned int irq)
 {
-	return irq_to_desc(irq)->chip_data;
+	return get_irq_chip_data(irq);
 }
 
 /* Send an EOI */
Index: linux-2.6-tip/arch/powerpc/sysdev/qe_lib/qe_ic.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ linux-2.6-tip/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -189,7 +189,7 @@ static inline void qe_ic_write(volatile 
 
 static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
 {
-	return irq_to_desc(virq)->chip_data;
+	return get_irq_chip_data(virq);
 }
 
 #define virq_to_hw(virq)	((unsigned int)irq_map[virq].hwirq)
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
@@ -166,7 +166,7 @@ int __init arch_early_irq_init(void)
 
 	for (i = 0; i < count; i++) {
 		desc = irq_to_desc(i);
-		desc->chip_data = &cfg[i];
+		set_irq_desc_chip_data(desc, &cfg[i]);
 		zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);
 		zalloc_cpumask_var_node(&cfg[i].old_domain, GFP_NOWAIT, node);
 		/*
@@ -190,7 +190,7 @@ struct irq_cfg *irq_cfg(unsigned int irq
 
 	desc = irq_to_desc(irq);
 	if (desc)
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 
 	return cfg;
 }
@@ -219,10 +219,11 @@ int arch_init_chip_data(struct irq_desc 
 {
 	struct irq_cfg *cfg;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 	if (!cfg) {
-		desc->chip_data = get_one_free_irq_cfg(node);
-		if (!desc->chip_data) {
+		cfg = get_one_free_irq_cfg(node);
+		set_irq_desc_chip_data(desc, cfg);
+		if (!cfg) {
 			printk(KERN_ERR "can not alloc irq_cfg\n");
 			BUG_ON(1);
 		}
@@ -302,9 +303,9 @@ void arch_init_copy_chip_data(struct irq
 	if (!cfg)
 		return;
 
-	desc->chip_data = cfg;
+	set_irq_desc_chip_data(desc, cfg);
 
-	old_cfg = old_desc->chip_data;
+	old_cfg = get_irq_desc_chip_data(old_desc);
 
 	memcpy(cfg, old_cfg, sizeof(struct irq_cfg));
 
@@ -320,8 +321,8 @@ void arch_free_chip_data(struct irq_desc
 {
 	struct irq_cfg *old_cfg, *cfg;
 
-	old_cfg = old_desc->chip_data;
-	cfg = desc->chip_data;
+	old_cfg = get_irq_desc_chip_data(old_desc);
+	cfg = get_irq_desc_chip_data(desc);
 
 	if (old_cfg == cfg)
 		return;
@@ -329,7 +330,7 @@ void arch_free_chip_data(struct irq_desc
 	if (old_cfg) {
 		free_irq_2_pin(old_cfg, cfg);
 		free_irq_cfg(old_cfg);
-		old_desc->chip_data = NULL;
+		set_irq_desc_chip_data(old_desc, NULL);
 	}
 }
 /* end for move_irq_desc */
@@ -589,7 +590,7 @@ static void __mask_IO_APIC_irq(struct ir
 
 static void mask_IO_APIC_irq_desc(struct irq_desc *desc)
 {
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 	unsigned long flags;
 
 	BUG_ON(!cfg);
@@ -601,7 +602,7 @@ static void mask_IO_APIC_irq_desc(struct
 
 static void unmask_IO_APIC_irq_desc(struct irq_desc *desc)
 {
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&ioapic_lock, flags);
@@ -1264,7 +1265,7 @@ void __setup_vector_irq(int cpu)
 	raw_spin_lock(&vector_lock);
 	/* Mark the inuse vectors */
 	for_each_irq_desc(irq, desc) {
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 
 		/*
 		 * If it is a legacy IRQ handled by the legacy PIC, this cpu
@@ -1436,7 +1437,7 @@ static void setup_IO_APIC_irq(int apic_i
 	if (!IO_APIC_IRQ(irq))
 		return;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	/*
 	 * For legacy irqs, cfg->domain starts with cpu 0 for legacy
@@ -1525,7 +1526,7 @@ static void __init setup_IO_APIC_irqs(vo
 			printk(KERN_INFO "can not get irq_desc for %d\n", irq);
 			continue;
 		}
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 		add_pin_to_irq_node(cfg, node, apic_id, pin);
 		/*
 		 * don't mark it in pin_programmed, so later acpi could
@@ -1576,7 +1577,7 @@ void setup_IO_APIC_irq_extra(u32 gsi)
 		return;
 	}
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 	add_pin_to_irq_node(cfg, node, apic_id, pin);
 
 	if (test_bit(pin, mp_ioapic_routing[apic_id].pin_programmed)) {
@@ -1727,7 +1728,7 @@ __apicdebuginit(void) print_IO_APIC(void
 	for_each_irq_desc(irq, desc) {
 		struct irq_pin_list *entry;
 
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 		if (!cfg)
 			continue;
 		entry = cfg->irq_2_pin;
@@ -2332,7 +2333,7 @@ set_desc_affinity(struct irq_desc *desc,
 		return -1;
 
 	irq = desc->irq;
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 	if (assign_irq_vector(irq, cfg, mask))
 		return -1;
 
@@ -2352,7 +2353,7 @@ set_ioapic_affinity_irq_desc(struct irq_
 	int ret = -1;
 
 	irq = desc->irq;
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	raw_spin_lock_irqsave(&ioapic_lock, flags);
 	ret = set_desc_affinity(desc, mask, &dest);
@@ -2405,7 +2406,7 @@ migrate_ioapic_irq_desc(struct irq_desc 
 	if (get_irte(irq, &irte))
 		return ret;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 	if (assign_irq_vector(irq, cfg, mask))
 		return ret;
 
@@ -2509,7 +2510,7 @@ unlock:
 static void __irq_complete_move(struct irq_desc **descp, unsigned vector)
 {
 	struct irq_desc *desc = *descp;
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 	unsigned me;
 
 	if (likely(!cfg->move_in_progress))
@@ -2529,7 +2530,7 @@ static void irq_complete_move(struct irq
 void irq_force_complete_move(int irq)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 
 	if (!cfg)
 		return;
@@ -2597,7 +2598,7 @@ static void eoi_ioapic_irq(struct irq_de
 	unsigned int irq;
 
 	irq = desc->irq;
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	raw_spin_lock_irqsave(&ioapic_lock, flags);
 	__eoi_ioapic_irq(irq, cfg);
@@ -2653,7 +2654,7 @@ static void ack_apic_level(unsigned int 
 	 * we use the above logic (mask+edge followed by unmask+level) from
 	 * Manfred Spraul to clear the remote IRR.
 	 */
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 	i = cfg->vector;
 	v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
 
@@ -2704,7 +2705,7 @@ static void ack_apic_level(unsigned int 
 		 * accurate and is causing problems then it is a hardware bug
 		 * and you can go talk to the chipset vendor about it.
 		 */
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 		if (!io_apic_level_ack_pending(cfg))
 			move_masked_irq(irq);
 		unmask_IO_APIC_irq_desc(desc);
@@ -2772,7 +2773,7 @@ static inline void init_IO_APIC_traps(vo
 	 * 0x80, because int 0x80 is hm, kind of importantish. ;)
 	 */
 	for_each_irq_desc(irq, desc) {
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 		if (IO_APIC_IRQ(irq) && cfg && !cfg->vector) {
 			/*
 			 * Hmm.. We don't have an entry for this,
@@ -2926,7 +2927,7 @@ int timer_through_8259 __initdata;
 static inline void __init check_timer(void)
 {
 	struct irq_desc *desc = irq_to_desc(0);
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 	int node = cpu_to_node(boot_cpu_id);
 	int apic1, pin1, apic2, pin2;
 	unsigned long flags;
@@ -3259,13 +3260,13 @@ unsigned int create_irq_nr(unsigned int 
 			printk(KERN_INFO "can not get irq_desc for %d\n", new);
 			continue;
 		}
-		cfg_new = desc_new->chip_data;
+		cfg_new = get_irq_desc_chip_data(desc_new);
 
 		if (cfg_new->vector != 0)
 			continue;
 
 		desc_new = move_irq_desc(desc_new, node);
-		cfg_new = desc_new->chip_data;
+		cfg_new = get_irq_desc_chip_data(desc_new);
 
 		if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
 			irq = new;
@@ -3397,7 +3398,7 @@ static int set_msi_irq_affinity(unsigned
 	if (set_desc_affinity(desc, mask, &dest))
 		return -1;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	get_cached_msi_msg_desc(desc, &msg);
 
@@ -3419,7 +3420,7 @@ static int
 ir_set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 	unsigned int dest;
 	struct irte irte;
 
@@ -3611,7 +3612,7 @@ static int dmar_msi_set_affinity(unsigne
 	if (set_desc_affinity(desc, mask, &dest))
 		return -1;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	dmar_msi_read(irq, &msg);
 
@@ -3666,7 +3667,7 @@ static int hpet_msi_set_affinity(unsigne
 	if (set_desc_affinity(desc, mask, &dest))
 		return -1;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	hpet_msi_read(irq, &msg);
 
@@ -3772,7 +3773,7 @@ static int set_ht_irq_affinity(unsigned 
 	if (set_desc_affinity(desc, mask, &dest))
 		return -1;
 
-	cfg = desc->chip_data;
+	cfg = get_irq_desc_chip_data(desc);
 
 	target_ht_irq(irq, dest, cfg->vector);
 
@@ -3919,7 +3920,7 @@ static int __io_apic_set_pci_routing(str
 	 * IRQs < 16 are already in the irq_2_pin[] map
 	 */
 	if (irq >= legacy_pic->nr_legacy_irqs) {
-		cfg = desc->chip_data;
+		cfg = get_irq_desc_chip_data(desc);
 		if (add_pin_to_irq_node_nopanic(cfg, node, ioapic, pin)) {
 			printk(KERN_INFO "can not add pin %d for irq %d\n",
 				pin, irq);
Index: linux-2.6-tip/arch/x86/kernel/uv_irq.c
===================================================================
--- linux-2.6-tip.orig/arch/x86/kernel/uv_irq.c
+++ linux-2.6-tip/arch/x86/kernel/uv_irq.c
@@ -209,7 +209,7 @@ static void arch_disable_uv_irq(int mmr_
 static int uv_set_irq_affinity(unsigned int irq, const struct cpumask *mask)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
-	struct irq_cfg *cfg = desc->chip_data;
+	struct irq_cfg *cfg = get_irq_desc_chip_data(desc);
 	unsigned int dest;
 	unsigned long mmr_value;
 	struct uv_IO_APIC_route_entry *entry;
Index: linux-2.6-tip/drivers/parisc/dino.c
===================================================================
--- linux-2.6-tip.orig/drivers/parisc/dino.c
+++ linux-2.6-tip/drivers/parisc/dino.c
@@ -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 in
 
 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;
 
Index: linux-2.6-tip/drivers/parisc/gsc.c
===================================================================
--- linux-2.6-tip.orig/drivers/parisc/gsc.c
+++ linux-2.6-tip/drivers/parisc/gsc.c
@@ -107,8 +107,7 @@ int gsc_find_local_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 = 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(unsigne
 
 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,12 @@ static struct irq_chip gsc_asic_interrup
 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(irq, type);
+	set_irq_chip_data(irq, data);
 	return irq++;
 }
 
Index: linux-2.6-tip/drivers/parisc/iosapic.c
===================================================================
--- linux-2.6-tip.orig/drivers/parisc/iosapic.c
+++ linux-2.6-tip/drivers/parisc/iosapic.c
@@ -617,9 +617,7 @@ iosapic_set_irt_data( struct vector_info
 
 static struct vector_info *iosapic_get_vector(unsigned int irq)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	return desc->chip_data;
+	return get_irq_chip_data(irq);
 }
 
 static void iosapic_disable_irq(unsigned int irq)
Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -406,6 +406,11 @@ extern int set_irq_chip_data(unsigned in
 extern int set_irq_type(unsigned int irq, unsigned int type);
 extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
 
+static inline void set_irq_desc_chip_data(struct irq_desc *desc, void *data)
+{
+	desc->chip_data = data;
+}
+
 #define get_irq_chip(irq)	(irq_to_desc(irq)->chip)
 #define get_irq_chip_data(irq)	(irq_to_desc(irq)->chip_data)
 #define get_irq_data(irq)	(irq_to_desc(irq)->handler_data)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 02/19] genirq: Create irq_data
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
  2010-09-27 12:44 ` [patch 01/19] genirq: Cleanup access to irq_data Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44   ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 03/19] genirq: Provide advanced irq chip functions Thomas Gleixner
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-create-irq-data.patch --]
[-- Type: text/plain, Size: 7537 bytes --]

Low level chip functions need access to irq_desc->handler_data,
irq_desc->chip_data and irq_desc->msi_desc. We hand down the irq
number to the low level functions, so they need to lookup irq_desc.
With sparse irq this means a radix tree lookup.

We could hand down irq_desc itself, but low level chip functions have
no need to fiddle with it directly and we want to restrict access to
irq_desc further.

Preparatory patch for new chip functions.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/irq.h |   48 ++++++++++++++++++++++++++++++++----------------
 kernel/irq/chip.c   |   22 +++++++++++++---------
 kernel/irq/handle.c |   11 +++++++++++
 3 files changed, 56 insertions(+), 25 deletions(-)

Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -84,6 +84,27 @@ struct proc_dir_entry;
 struct msi_desc;
 
 /**
+ * struct irq_data - per irq and irq chip data passed down to chip functions
+ * @irq:		interrupt number
+ * @chip:		low level interrupt hardware access
+ * @handler_data:	per-IRQ data for the irq_chip methods
+ * @chip_data:		platform-specific per-chip private data for the chip
+ *			methods, to allow shared chip implementations
+ * @msi_desc:		MSI descriptor
+ * @affinity:		pointer to irq affinity mask
+ */
+struct irq_data {
+	unsigned int		irq;
+	struct irq_chip		*chip;
+	void			*handler_data;
+	void			*chip_data;
+	struct msi_desc		*msi_desc;
+#ifdef CONFIG_SMP
+	cpumask_var_t		*affinity;
+#endif
+};
+
+/**
  * struct irq_chip - hardware interrupt chip descriptor
  *
  * @name:		name for /proc/interrupts
@@ -146,10 +167,7 @@ struct irq_2_iommu;
  * @irq_2_iommu:	iommu with this irq
  * @handle_irq:		highlevel irq-events handler [if NULL, __do_IRQ()]
  * @chip:		low level interrupt hardware access
- * @msi_desc:		MSI descriptor
- * @handler_data:	per-IRQ data for the irq_chip methods
- * @chip_data:		platform-specific per-chip private data for the chip
- *			methods, to allow shared chip implementations
+ * @irq_data:		per irq and chip data passed down to chip functions
  * @action:		the irq action chain
  * @status:		status information
  * @depth:		disable-depth, for nested irq_disable() calls
@@ -175,9 +193,7 @@ struct irq_desc {
 #endif
 	irq_flow_handler_t	handle_irq;
 	struct irq_chip		*chip;
-	struct msi_desc		*msi_desc;
-	void			*handler_data;
-	void			*chip_data;
+	struct irq_data		irq_data;
 	struct irqaction	*action;	/* IRQ action list */
 	unsigned int		status;		/* IRQ status */
 
@@ -408,18 +424,18 @@ extern int set_irq_msi(unsigned int irq,
 
 static inline void set_irq_desc_chip_data(struct irq_desc *desc, void *data)
 {
-	desc->chip_data = data;
+	desc->irq_data.chip_data = data;
 }
 
 #define get_irq_chip(irq)	(irq_to_desc(irq)->chip)
-#define get_irq_chip_data(irq)	(irq_to_desc(irq)->chip_data)
-#define get_irq_data(irq)	(irq_to_desc(irq)->handler_data)
-#define get_irq_msi(irq)	(irq_to_desc(irq)->msi_desc)
-
-#define get_irq_desc_chip(desc)		((desc)->chip)
-#define get_irq_desc_chip_data(desc)	((desc)->chip_data)
-#define get_irq_desc_data(desc)		((desc)->handler_data)
-#define get_irq_desc_msi(desc)		((desc)->msi_desc)
+#define get_irq_chip_data(irq)	(irq_to_desc(irq)->irq_data.chip_data)
+#define get_irq_data(irq)	(irq_to_desc(irq)->irq_data.handler_data)
+#define get_irq_msi(irq)	(irq_to_desc(irq)->irq_data.msi_desc)
+
+#define get_irq_desc_chip(desc)		((desc)->irq_data.chip)
+#define get_irq_desc_chip_data(desc)	((desc)->irq_data.chip_data)
+#define get_irq_desc_data(desc)		((desc)->irq_data.handler_data)
+#define get_irq_desc_msi(desc)		((desc)->irq_data.msi_desc)
 
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -33,12 +33,13 @@ static void dynamic_irq_init_x(unsigned 
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	desc->status = IRQ_DISABLED;
 	desc->chip = &no_irq_chip;
+	desc->irq_data.chip = &no_irq_chip;
 	desc->handle_irq = handle_bad_irq;
 	desc->depth = 1;
-	desc->msi_desc = NULL;
-	desc->handler_data = NULL;
+	desc->irq_data.msi_desc = NULL;
+	desc->irq_data.handler_data = NULL;
 	if (!keep_chip_data)
-		desc->chip_data = NULL;
+		desc->irq_data.chip_data = NULL;
 	desc->action = NULL;
 	desc->irq_count = 0;
 	desc->irqs_unhandled = 0;
@@ -88,12 +89,13 @@ static void dynamic_irq_cleanup_x(unsign
 			irq);
 		return;
 	}
-	desc->msi_desc = NULL;
-	desc->handler_data = NULL;
+	desc->irq_data.msi_desc = NULL;
+	desc->irq_data.handler_data = NULL;
 	if (!keep_chip_data)
-		desc->chip_data = NULL;
+		desc->irq_data.chip_data = NULL;
 	desc->handle_irq = handle_bad_irq;
 	desc->chip = &no_irq_chip;
+	desc->irq_data.chip = &no_irq_chip;
 	desc->name = NULL;
 	clear_kstat_irqs(desc);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -141,6 +143,7 @@ int set_irq_chip(unsigned int irq, struc
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	irq_chip_set_defaults(chip);
 	desc->chip = chip;
+	desc->irq_data.chip = chip;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	return 0;
@@ -193,7 +196,7 @@ int set_irq_data(unsigned int irq, void 
 	}
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->handler_data = data;
+	desc->irq_data.handler_data = data;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	return 0;
 }
@@ -218,7 +221,7 @@ int set_irq_msi(unsigned int irq, struct
 	}
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->msi_desc = entry;
+	desc->irq_data.msi_desc = entry;
 	if (entry)
 		entry->irq = irq;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -249,7 +252,7 @@ int set_irq_chip_data(unsigned int irq, 
 	}
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->chip_data = data;
+	desc->irq_data.chip_data = data;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	return 0;
@@ -685,6 +688,7 @@ __set_irq_handler(unsigned int irq, irq_
 		 * dummy_irq_chip for easy transition.
 		 */
 		desc->chip = &dummy_irq_chip;
+		desc->irq_data.chip = &dummy_irq_chip;
 	}
 
 	chip_bus_lock(irq, desc);
Index: linux-2.6-tip/kernel/irq/handle.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/handle.c
+++ linux-2.6-tip/kernel/irq/handle.c
@@ -106,8 +106,11 @@ static void init_one_irq_desc(int irq, s
 
 	raw_spin_lock_init(&desc->lock);
 	desc->irq = irq;
+	desc->irq_data.irq = irq;
+	desc->irq_data.chip = desc->chip;
 #ifdef CONFIG_SMP
 	desc->node = node;
+	desc->irq_data.affinity = &desc->affinity;
 #endif
 	lockdep_set_class(&desc->lock, &irq_desc_lock_class);
 	init_kstat_irqs(desc, node, nr_cpu_ids);
@@ -185,8 +188,11 @@ int __init early_irq_init(void)
 
 	for (i = 0; i < legacy_count; i++) {
 		desc[i].irq = i;
+		desc[i].irq_data.irq = i;
+		desc[i].irq_data.chip = desc[i].chip;
 #ifdef CONFIG_SMP
 		desc[i].node = node;
+		desc[i].irq_data.affinity = &desc[i].affinity;
 #endif
 		desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids;
 		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
@@ -265,6 +271,11 @@ int __init early_irq_init(void)
 
 	for (i = 0; i < count; i++) {
 		desc[i].irq = i;
+		desc[i].irq_data.irq = i;
+		desc[i].irq_data.chip = desc[i].chip;
+#ifdef CONFIG_SMP
+		desc[i].irq_data.affinity = &desc[i].affinity;
+#endif
 		alloc_desc_masks(&desc[i], 0, true);
 		init_desc_masks(&desc[i]);
 		desc[i].kstat_irqs = kstat_irqs_all[i];

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 02/19] genirq: Create irq_data
  2010-09-27 12:44 ` [patch 02/19] genirq: Create irq_data Thomas Gleixner
@ 2010-09-27 12:44   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-create-irq-data.patch --]
[-- Type: text/plain, Size: 7539 bytes --]

Low level chip functions need access to irq_desc->handler_data,
irq_desc->chip_data and irq_desc->msi_desc. We hand down the irq
number to the low level functions, so they need to lookup irq_desc.
With sparse irq this means a radix tree lookup.

We could hand down irq_desc itself, but low level chip functions have
no need to fiddle with it directly and we want to restrict access to
irq_desc further.

Preparatory patch for new chip functions.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/irq.h |   48 ++++++++++++++++++++++++++++++++----------------
 kernel/irq/chip.c   |   22 +++++++++++++---------
 kernel/irq/handle.c |   11 +++++++++++
 3 files changed, 56 insertions(+), 25 deletions(-)

Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -84,6 +84,27 @@ struct proc_dir_entry;
 struct msi_desc;
 
 /**
+ * struct irq_data - per irq and irq chip data passed down to chip functions
+ * @irq:		interrupt number
+ * @chip:		low level interrupt hardware access
+ * @handler_data:	per-IRQ data for the irq_chip methods
+ * @chip_data:		platform-specific per-chip private data for the chip
+ *			methods, to allow shared chip implementations
+ * @msi_desc:		MSI descriptor
+ * @affinity:		pointer to irq affinity mask
+ */
+struct irq_data {
+	unsigned int		irq;
+	struct irq_chip		*chip;
+	void			*handler_data;
+	void			*chip_data;
+	struct msi_desc		*msi_desc;
+#ifdef CONFIG_SMP
+	cpumask_var_t		*affinity;
+#endif
+};
+
+/**
  * struct irq_chip - hardware interrupt chip descriptor
  *
  * @name:		name for /proc/interrupts
@@ -146,10 +167,7 @@ struct irq_2_iommu;
  * @irq_2_iommu:	iommu with this irq
  * @handle_irq:		highlevel irq-events handler [if NULL, __do_IRQ()]
  * @chip:		low level interrupt hardware access
- * @msi_desc:		MSI descriptor
- * @handler_data:	per-IRQ data for the irq_chip methods
- * @chip_data:		platform-specific per-chip private data for the chip
- *			methods, to allow shared chip implementations
+ * @irq_data:		per irq and chip data passed down to chip functions
  * @action:		the irq action chain
  * @status:		status information
  * @depth:		disable-depth, for nested irq_disable() calls
@@ -175,9 +193,7 @@ struct irq_desc {
 #endif
 	irq_flow_handler_t	handle_irq;
 	struct irq_chip		*chip;
-	struct msi_desc		*msi_desc;
-	void			*handler_data;
-	void			*chip_data;
+	struct irq_data		irq_data;
 	struct irqaction	*action;	/* IRQ action list */
 	unsigned int		status;		/* IRQ status */
 
@@ -408,18 +424,18 @@ extern int set_irq_msi(unsigned int irq,
 
 static inline void set_irq_desc_chip_data(struct irq_desc *desc, void *data)
 {
-	desc->chip_data = data;
+	desc->irq_data.chip_data = data;
 }
 
 #define get_irq_chip(irq)	(irq_to_desc(irq)->chip)
-#define get_irq_chip_data(irq)	(irq_to_desc(irq)->chip_data)
-#define get_irq_data(irq)	(irq_to_desc(irq)->handler_data)
-#define get_irq_msi(irq)	(irq_to_desc(irq)->msi_desc)
-
-#define get_irq_desc_chip(desc)		((desc)->chip)
-#define get_irq_desc_chip_data(desc)	((desc)->chip_data)
-#define get_irq_desc_data(desc)		((desc)->handler_data)
-#define get_irq_desc_msi(desc)		((desc)->msi_desc)
+#define get_irq_chip_data(irq)	(irq_to_desc(irq)->irq_data.chip_data)
+#define get_irq_data(irq)	(irq_to_desc(irq)->irq_data.handler_data)
+#define get_irq_msi(irq)	(irq_to_desc(irq)->irq_data.msi_desc)
+
+#define get_irq_desc_chip(desc)		((desc)->irq_data.chip)
+#define get_irq_desc_chip_data(desc)	((desc)->irq_data.chip_data)
+#define get_irq_desc_data(desc)		((desc)->irq_data.handler_data)
+#define get_irq_desc_msi(desc)		((desc)->irq_data.msi_desc)
 
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -33,12 +33,13 @@ static void dynamic_irq_init_x(unsigned 
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	desc->status = IRQ_DISABLED;
 	desc->chip = &no_irq_chip;
+	desc->irq_data.chip = &no_irq_chip;
 	desc->handle_irq = handle_bad_irq;
 	desc->depth = 1;
-	desc->msi_desc = NULL;
-	desc->handler_data = NULL;
+	desc->irq_data.msi_desc = NULL;
+	desc->irq_data.handler_data = NULL;
 	if (!keep_chip_data)
-		desc->chip_data = NULL;
+		desc->irq_data.chip_data = NULL;
 	desc->action = NULL;
 	desc->irq_count = 0;
 	desc->irqs_unhandled = 0;
@@ -88,12 +89,13 @@ static void dynamic_irq_cleanup_x(unsign
 			irq);
 		return;
 	}
-	desc->msi_desc = NULL;
-	desc->handler_data = NULL;
+	desc->irq_data.msi_desc = NULL;
+	desc->irq_data.handler_data = NULL;
 	if (!keep_chip_data)
-		desc->chip_data = NULL;
+		desc->irq_data.chip_data = NULL;
 	desc->handle_irq = handle_bad_irq;
 	desc->chip = &no_irq_chip;
+	desc->irq_data.chip = &no_irq_chip;
 	desc->name = NULL;
 	clear_kstat_irqs(desc);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -141,6 +143,7 @@ int set_irq_chip(unsigned int irq, struc
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	irq_chip_set_defaults(chip);
 	desc->chip = chip;
+	desc->irq_data.chip = chip;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	return 0;
@@ -193,7 +196,7 @@ int set_irq_data(unsigned int irq, void 
 	}
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->handler_data = data;
+	desc->irq_data.handler_data = data;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	return 0;
 }
@@ -218,7 +221,7 @@ int set_irq_msi(unsigned int irq, struct
 	}
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->msi_desc = entry;
+	desc->irq_data.msi_desc = entry;
 	if (entry)
 		entry->irq = irq;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -249,7 +252,7 @@ int set_irq_chip_data(unsigned int irq, 
 	}
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
-	desc->chip_data = data;
+	desc->irq_data.chip_data = data;
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 
 	return 0;
@@ -685,6 +688,7 @@ __set_irq_handler(unsigned int irq, irq_
 		 * dummy_irq_chip for easy transition.
 		 */
 		desc->chip = &dummy_irq_chip;
+		desc->irq_data.chip = &dummy_irq_chip;
 	}
 
 	chip_bus_lock(irq, desc);
Index: linux-2.6-tip/kernel/irq/handle.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/handle.c
+++ linux-2.6-tip/kernel/irq/handle.c
@@ -106,8 +106,11 @@ static void init_one_irq_desc(int irq, s
 
 	raw_spin_lock_init(&desc->lock);
 	desc->irq = irq;
+	desc->irq_data.irq = irq;
+	desc->irq_data.chip = desc->chip;
 #ifdef CONFIG_SMP
 	desc->node = node;
+	desc->irq_data.affinity = &desc->affinity;
 #endif
 	lockdep_set_class(&desc->lock, &irq_desc_lock_class);
 	init_kstat_irqs(desc, node, nr_cpu_ids);
@@ -185,8 +188,11 @@ int __init early_irq_init(void)
 
 	for (i = 0; i < legacy_count; i++) {
 		desc[i].irq = i;
+		desc[i].irq_data.irq = i;
+		desc[i].irq_data.chip = desc[i].chip;
 #ifdef CONFIG_SMP
 		desc[i].node = node;
+		desc[i].irq_data.affinity = &desc[i].affinity;
 #endif
 		desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids;
 		lockdep_set_class(&desc[i].lock, &irq_desc_lock_class);
@@ -265,6 +271,11 @@ int __init early_irq_init(void)
 
 	for (i = 0; i < count; i++) {
 		desc[i].irq = i;
+		desc[i].irq_data.irq = i;
+		desc[i].irq_data.chip = desc[i].chip;
+#ifdef CONFIG_SMP
+		desc[i].irq_data.affinity = &desc[i].affinity;
+#endif
 		alloc_desc_masks(&desc[i], 0, true);
 		init_desc_masks(&desc[i]);
 		desc[i].kstat_irqs = kstat_irqs_all[i];



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 03/19] genirq: Provide advanced irq chip functions
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
  2010-09-27 12:44 ` [patch 01/19] genirq: Cleanup access to irq_data Thomas Gleixner
  2010-09-27 12:44 ` [patch 02/19] genirq: Create irq_data Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44   ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 04/19] genirq; Provide compat handling for bus_lock/bus_sync_unlock Thomas Gleixner
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-migration-path-for-irq-chip-functions.patch --]
[-- Type: text/plain, Size: 2123 bytes --]

The low level irq chip functions want access to irq_desc->irq_data.
Provide new functions which hand down irq_data instead of the irq
number so these functions avoid to call irq_to_desc() which is a radix
tree lookup in case of sparse irq.

This provides all the old functions except one: end(). end() is a
relict of __do_IRQ() and will just go away with the __do_IRQ() code.

The replacement for set_affinity() has an extra argument "bool
force". The reason for this is to notify the low level code, that the
move has to be done right away and cannot be delayed until the next
interrupt happens. That's necessary to handle the irq fixup on cpu
unplug in the generic code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/irq.h |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -151,6 +151,26 @@ struct irq_chip {
 	void		(*bus_lock)(unsigned int irq);
 	void		(*bus_sync_unlock)(unsigned int irq);
 
+	unsigned int	(*irq_startup)(struct irq_data *data);
+	void		(*irq_shutdown)(struct irq_data *data);
+	void		(*irq_enable)(struct irq_data *data);
+	void		(*irq_disable)(struct irq_data *data);
+
+	void		(*irq_ack)(struct irq_data *data);
+	void		(*irq_mask)(struct irq_data *data);
+	void		(*irq_mask_ack)(struct irq_data *data);
+	void		(*irq_unmask)(struct irq_data *data);
+	void		(*irq_eoi)(struct irq_data *data);
+	void		(*irq_end)(struct irq_data *data);
+
+	int		(*irq_set_affinity)(struct irq_data *data, const struct cpumask *dest, bool force);
+	int		(*irq_retrigger)(struct irq_data *data);
+	int		(*irq_set_type)(struct irq_data *data, unsigned int flow_type);
+	int		(*irq_set_wake)(struct irq_data *data, unsigned int on);
+
+	void		(*irq_bus_lock)(struct irq_data *data);
+	void		(*irq_bus_sync_unlock)(struct irq_data *data);
+
 	/* Currently used only by UML, might disappear one day.*/
 #ifdef CONFIG_IRQ_RELEASE_METHOD
 	void		(*release)(unsigned int irq, void *dev_id);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 03/19] genirq: Provide advanced irq chip functions
  2010-09-27 12:44 ` [patch 03/19] genirq: Provide advanced irq chip functions Thomas Gleixner
@ 2010-09-27 12:44   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-migration-path-for-irq-chip-functions.patch --]
[-- Type: text/plain, Size: 2125 bytes --]

The low level irq chip functions want access to irq_desc->irq_data.
Provide new functions which hand down irq_data instead of the irq
number so these functions avoid to call irq_to_desc() which is a radix
tree lookup in case of sparse irq.

This provides all the old functions except one: end(). end() is a
relict of __do_IRQ() and will just go away with the __do_IRQ() code.

The replacement for set_affinity() has an extra argument "bool
force". The reason for this is to notify the low level code, that the
move has to be done right away and cannot be delayed until the next
interrupt happens. That's necessary to handle the irq fixup on cpu
unplug in the generic code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/irq.h |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Index: linux-2.6-tip/include/linux/irq.h
===================================================================
--- linux-2.6-tip.orig/include/linux/irq.h
+++ linux-2.6-tip/include/linux/irq.h
@@ -151,6 +151,26 @@ struct irq_chip {
 	void		(*bus_lock)(unsigned int irq);
 	void		(*bus_sync_unlock)(unsigned int irq);
 
+	unsigned int	(*irq_startup)(struct irq_data *data);
+	void		(*irq_shutdown)(struct irq_data *data);
+	void		(*irq_enable)(struct irq_data *data);
+	void		(*irq_disable)(struct irq_data *data);
+
+	void		(*irq_ack)(struct irq_data *data);
+	void		(*irq_mask)(struct irq_data *data);
+	void		(*irq_mask_ack)(struct irq_data *data);
+	void		(*irq_unmask)(struct irq_data *data);
+	void		(*irq_eoi)(struct irq_data *data);
+	void		(*irq_end)(struct irq_data *data);
+
+	int		(*irq_set_affinity)(struct irq_data *data, const struct cpumask *dest, bool force);
+	int		(*irq_retrigger)(struct irq_data *data);
+	int		(*irq_set_type)(struct irq_data *data, unsigned int flow_type);
+	int		(*irq_set_wake)(struct irq_data *data, unsigned int on);
+
+	void		(*irq_bus_lock)(struct irq_data *data);
+	void		(*irq_bus_sync_unlock)(struct irq_data *data);
+
 	/* Currently used only by UML, might disappear one day.*/
 #ifdef CONFIG_IRQ_RELEASE_METHOD
 	void		(*release)(unsigned int irq, void *dev_id);



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 04/19] genirq; Provide compat handling for bus_lock/bus_sync_unlock
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (2 preceding siblings ...)
  2010-09-27 12:44 ` [patch 03/19] genirq: Provide advanced irq chip functions Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 05/19] genirq; Provide compat handling for chip->mask() Thomas Gleixner
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-compat-handling-for-buslock-unlock.patch --]
[-- Type: text/plain, Size: 5163 bytes --]

Wrap the old chip functions for bus_lock/bus_sync_unlock until the
migration is complete and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |   20 ++++++++++++++++++--
 kernel/irq/internals.h |   17 +++++++++++------
 kernel/irq/manage.c    |   22 +++++++++++-----------
 3 files changed, 40 insertions(+), 19 deletions(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -327,6 +327,17 @@ static void default_shutdown(unsigned in
 	desc->status |= IRQ_MASKED;
 }
 
+/* Temporary migration helpers */
+static void compat_bus_lock(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->bus_lock(data->irq);
+}
+
+static void compat_bus_sync_unlock(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->bus_sync_unlock(data->irq);
+}
+
 /*
  * Fixup enable/disable function pointers
  */
@@ -349,6 +360,11 @@ void irq_chip_set_defaults(struct irq_ch
 			chip->disable : default_shutdown;
 	if (!chip->end)
 		chip->end = dummy_irq_chip.end;
+
+	if (chip->bus_lock)
+		chip->irq_bus_lock = compat_bus_lock;
+	if (chip->bus_sync_unlock)
+		chip->irq_bus_sync_unlock = compat_bus_sync_unlock;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc, int irq)
@@ -691,7 +707,7 @@ __set_irq_handler(unsigned int irq, irq_
 		desc->irq_data.chip = &dummy_irq_chip;
 	}
 
-	chip_bus_lock(irq, desc);
+	chip_bus_lock(desc);
 	raw_spin_lock_irqsave(&desc->lock, flags);
 
 	/* Uninstall? */
@@ -711,7 +727,7 @@ __set_irq_handler(unsigned int irq, irq_
 		desc->chip->startup(irq);
 	}
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
-	chip_bus_sync_unlock(irq, desc);
+	chip_bus_sync_unlock(desc);
 }
 EXPORT_SYMBOL_GPL(__set_irq_handler);
 
Index: linux-2.6-tip/kernel/irq/internals.h
===================================================================
--- linux-2.6-tip.orig/kernel/irq/internals.h
+++ linux-2.6-tip/kernel/irq/internals.h
@@ -41,16 +41,21 @@ extern int irq_select_affinity_usr(unsig
 extern void irq_set_thread_affinity(struct irq_desc *desc);
 
 /* Inline functions for support of irq chips on slow busses */
-static inline void chip_bus_lock(unsigned int irq, struct irq_desc *desc)
+static inline void chip_bus_lock(struct irq_desc *desc)
 {
-	if (unlikely(desc->chip->bus_lock))
-		desc->chip->bus_lock(irq);
+	if (unlikely(desc->chip->irq_bus_lock))
+		desc->chip->irq_bus_lock(&desc->irq_data);
 }
 
-static inline void chip_bus_sync_unlock(unsigned int irq, struct irq_desc *desc)
+static inline void chip_bus_sync_unlock(struct irq_desc *desc)
 {
-	if (unlikely(desc->chip->bus_sync_unlock))
-		desc->chip->bus_sync_unlock(irq);
+	if (unlikely(desc->chip->irq_bus_sync_unlock))
+		desc->chip->irq_bus_sync_unlock(&desc->irq_data);
+}
+
+static inline struct irq_desc *irq_data_to_desc(struct irq_data *data)
+{
+	return container_of(data, struct irq_desc, irq_data);
 }
 
 /*
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -246,11 +246,11 @@ void disable_irq_nosync(unsigned int irq
 	if (!desc)
 		return;
 
-	chip_bus_lock(irq, desc);
+	chip_bus_lock(desc);
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	__disable_irq(desc, irq, false);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
-	chip_bus_sync_unlock(irq, desc);
+	chip_bus_sync_unlock(desc);
 }
 EXPORT_SYMBOL(disable_irq_nosync);
 
@@ -323,11 +323,11 @@ void enable_irq(unsigned int irq)
 	if (!desc)
 		return;
 
-	chip_bus_lock(irq, desc);
+	chip_bus_lock(desc);
 	raw_spin_lock_irqsave(&desc->lock, flags);
 	__enable_irq(desc, irq, false);
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
-	chip_bus_sync_unlock(irq, desc);
+	chip_bus_sync_unlock(desc);
 }
 EXPORT_SYMBOL(enable_irq);
 
@@ -507,7 +507,7 @@ static int irq_wait_for_interrupt(struct
 static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)
 {
 again:
-	chip_bus_lock(irq, desc);
+	chip_bus_lock(desc);
 	raw_spin_lock_irq(&desc->lock);
 
 	/*
@@ -521,7 +521,7 @@ again:
 	 */
 	if (unlikely(desc->status & IRQ_INPROGRESS)) {
 		raw_spin_unlock_irq(&desc->lock);
-		chip_bus_sync_unlock(irq, desc);
+		chip_bus_sync_unlock(desc);
 		cpu_relax();
 		goto again;
 	}
@@ -531,7 +531,7 @@ again:
 		desc->chip->unmask(irq);
 	}
 	raw_spin_unlock_irq(&desc->lock);
-	chip_bus_sync_unlock(irq, desc);
+	chip_bus_sync_unlock(desc);
 }
 
 #ifdef CONFIG_SMP
@@ -997,9 +997,9 @@ void free_irq(unsigned int irq, void *de
 	if (!desc)
 		return;
 
-	chip_bus_lock(irq, desc);
+	chip_bus_lock(desc);
 	kfree(__free_irq(irq, dev_id));
-	chip_bus_sync_unlock(irq, desc);
+	chip_bus_sync_unlock(desc);
 }
 EXPORT_SYMBOL(free_irq);
 
@@ -1086,9 +1086,9 @@ int request_threaded_irq(unsigned int ir
 	action->name = devname;
 	action->dev_id = dev_id;
 
-	chip_bus_lock(irq, desc);
+	chip_bus_lock(desc);
 	retval = __setup_irq(irq, desc, action);
-	chip_bus_sync_unlock(irq, desc);
+	chip_bus_sync_unlock(desc);
 
 	if (retval)
 		kfree(action);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 05/19] genirq; Provide compat handling for chip->mask()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (3 preceding siblings ...)
  2010-09-27 12:44 ` [patch 04/19] genirq; Provide compat handling for bus_lock/bus_sync_unlock Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 06/19] genirq; Provide compat handling for chip->unmask() Thomas Gleixner
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-mask.patch --]
[-- Type: text/plain, Size: 2685 bytes --]

Wrap the old chip function mask() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |   22 +++++++++++++++-------
 kernel/irq/migration.c |    2 +-
 2 files changed, 16 insertions(+), 8 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -323,11 +323,16 @@ static void default_shutdown(unsigned in
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 
-	desc->chip->mask(irq);
+	desc->chip->irq_mask(&desc->irq_data);
 	desc->status |= IRQ_MASKED;
 }
 
 /* Temporary migration helpers */
+static void compat_irq_mask(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->mask(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -365,6 +370,9 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_bus_lock = compat_bus_lock;
 	if (chip->bus_sync_unlock)
 		chip->irq_bus_sync_unlock = compat_bus_sync_unlock;
+
+	if (chip->mask)
+		chip->irq_mask = compat_irq_mask;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc, int irq)
@@ -372,17 +380,17 @@ static inline void mask_ack_irq(struct i
 	if (desc->chip->mask_ack)
 		desc->chip->mask_ack(irq);
 	else {
-		desc->chip->mask(irq);
+		desc->chip->irq_mask(&desc->irq_data);
 		if (desc->chip->ack)
 			desc->chip->ack(irq);
 	}
 	desc->status |= IRQ_MASKED;
 }
 
-static inline void mask_irq(struct irq_desc *desc, int irq)
+static inline void mask_irq(struct irq_desc *desc)
 {
-	if (desc->chip->mask) {
-		desc->chip->mask(irq);
+	if (desc->chip->irq_mask) {
+		desc->chip->irq_mask(&desc->irq_data);
 		desc->status |= IRQ_MASKED;
 	}
 }
@@ -556,7 +564,7 @@ handle_fasteoi_irq(unsigned int irq, str
 	action = desc->action;
 	if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
 		desc->status |= IRQ_PENDING;
-		mask_irq(desc, irq);
+		mask_irq(desc);
 		goto out;
 	}
 
@@ -624,7 +632,7 @@ handle_edge_irq(unsigned int irq, struct
 		irqreturn_t action_ret;
 
 		if (unlikely(!action)) {
-			mask_irq(desc, irq);
+			mask_irq(desc);
 			goto out_unlock;
 		}
 
Index: linux-2.6-tip/kernel/irq/migration.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/migration.c
+++ linux-2.6-tip/kernel/irq/migration.c
@@ -61,7 +61,7 @@ void move_native_irq(int irq)
 	if (unlikely(desc->status & IRQ_DISABLED))
 		return;
 
-	desc->chip->mask(irq);
+	desc->chip->irq_mask(&desc->irq_data);
 	move_masked_irq(irq);
 	desc->chip->unmask(irq);
 }

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 06/19] genirq; Provide compat handling for chip->unmask()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (4 preceding siblings ...)
  2010-09-27 12:44 ` [patch 05/19] genirq; Provide compat handling for chip->mask() Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 07/19] genirq; Provide compat handling for chip->ack() Thomas Gleixner
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-unmask.patch --]
[-- Type: text/plain, Size: 3067 bytes --]

Wrap the old chip function unmask() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |   20 ++++++++++++++------
 kernel/irq/manage.c    |    2 +-
 kernel/irq/migration.c |    2 +-
 3 files changed, 16 insertions(+), 8 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -294,7 +294,7 @@ static void default_enable(unsigned int 
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 
-	desc->chip->unmask(irq);
+	desc->chip->irq_unmask(&desc->irq_data);
 	desc->status &= ~IRQ_MASKED;
 }
 
@@ -333,6 +333,11 @@ static void compat_irq_mask(struct irq_d
 	irq_data_to_desc(data)->chip->mask(data->irq);
 }
 
+static void compat_irq_unmask(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->unmask(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -373,6 +378,9 @@ void irq_chip_set_defaults(struct irq_ch
 
 	if (chip->mask)
 		chip->irq_mask = compat_irq_mask;
+
+	if (chip->unmask)
+		chip->irq_unmask = compat_irq_unmask;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc, int irq)
@@ -395,10 +403,10 @@ static inline void mask_irq(struct irq_d
 	}
 }
 
-static inline void unmask_irq(struct irq_desc *desc, int irq)
+static inline void unmask_irq(struct irq_desc *desc)
 {
-	if (desc->chip->unmask) {
-		desc->chip->unmask(irq);
+	if (desc->chip->irq_unmask) {
+		desc->chip->irq_unmask(&desc->irq_data);
 		desc->status &= ~IRQ_MASKED;
 	}
 }
@@ -527,7 +535,7 @@ handle_level_irq(unsigned int irq, struc
 	desc->status &= ~IRQ_INPROGRESS;
 
 	if (!(desc->status & (IRQ_DISABLED | IRQ_ONESHOT)))
-		unmask_irq(desc, irq);
+		unmask_irq(desc);
 out_unlock:
 	raw_spin_unlock(&desc->lock);
 }
@@ -644,7 +652,7 @@ handle_edge_irq(unsigned int irq, struct
 		if (unlikely((desc->status &
 			       (IRQ_PENDING | IRQ_MASKED | IRQ_DISABLED)) ==
 			      (IRQ_PENDING | IRQ_MASKED))) {
-			unmask_irq(desc, irq);
+			unmask_irq(desc);
 		}
 
 		desc->status &= ~IRQ_PENDING;
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -528,7 +528,7 @@ again:
 
 	if (!(desc->status & IRQ_DISABLED) && (desc->status & IRQ_MASKED)) {
 		desc->status &= ~IRQ_MASKED;
-		desc->chip->unmask(irq);
+		desc->chip->irq_unmask(&desc->irq_data);
 	}
 	raw_spin_unlock_irq(&desc->lock);
 	chip_bus_sync_unlock(desc);
Index: linux-2.6-tip/kernel/irq/migration.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/migration.c
+++ linux-2.6-tip/kernel/irq/migration.c
@@ -63,6 +63,6 @@ void move_native_irq(int irq)
 
 	desc->chip->irq_mask(&desc->irq_data);
 	move_masked_irq(irq);
-	desc->chip->unmask(irq);
+	desc->chip->irq_unmask(&desc->irq_data);
 }
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 07/19] genirq; Provide compat handling for chip->ack()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (5 preceding siblings ...)
  2010-09-27 12:44 ` [patch 06/19] genirq; Provide compat handling for chip->unmask() Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44   ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 08/19] genirq; Provide compat handling for chip->mask_ack() Thomas Gleixner
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-ack.patch --]
[-- Type: text/plain, Size: 2098 bytes --]

Wrap the old chip function ack() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -338,6 +338,11 @@ static void compat_irq_unmask(struct irq
 	irq_data_to_desc(data)->chip->unmask(data->irq);
 }
 
+static void compat_irq_ack(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->ack(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -375,12 +380,12 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_bus_lock = compat_bus_lock;
 	if (chip->bus_sync_unlock)
 		chip->irq_bus_sync_unlock = compat_bus_sync_unlock;
-
 	if (chip->mask)
 		chip->irq_mask = compat_irq_mask;
-
 	if (chip->unmask)
 		chip->irq_unmask = compat_irq_unmask;
+	if (chip->ack)
+		chip->irq_ack = compat_irq_ack;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc, int irq)
@@ -389,8 +394,8 @@ static inline void mask_ack_irq(struct i
 		desc->chip->mask_ack(irq);
 	else {
 		desc->chip->irq_mask(&desc->irq_data);
-		if (desc->chip->ack)
-			desc->chip->ack(irq);
+		if (desc->chip->irq_ack)
+			desc->chip->irq_ack(&desc->irq_data);
 	}
 	desc->status |= IRQ_MASKED;
 }
@@ -629,8 +634,7 @@ handle_edge_irq(unsigned int irq, struct
 	kstat_incr_irqs_this_cpu(irq, desc);
 
 	/* Start handling the irq */
-	if (desc->chip->ack)
-		desc->chip->ack(irq);
+	desc->chip->irq_ack(&desc->irq_data);
 
 	/* Mark the IRQ currently in progress.*/
 	desc->status |= IRQ_INPROGRESS;
@@ -683,8 +687,8 @@ handle_percpu_irq(unsigned int irq, stru
 
 	kstat_incr_irqs_this_cpu(irq, desc);
 
-	if (desc->chip->ack)
-		desc->chip->ack(irq);
+	if (desc->chip->irq_ack)
+		desc->chip->irq_ack(&desc->irq_data);
 
 	action_ret = handle_IRQ_event(irq, desc->action);
 	if (!noirqdebug)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 07/19] genirq; Provide compat handling for chip->ack()
  2010-09-27 12:44 ` [patch 07/19] genirq; Provide compat handling for chip->ack() Thomas Gleixner
@ 2010-09-27 12:44   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-ack.patch --]
[-- Type: text/plain, Size: 2100 bytes --]

Wrap the old chip function ack() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -338,6 +338,11 @@ static void compat_irq_unmask(struct irq
 	irq_data_to_desc(data)->chip->unmask(data->irq);
 }
 
+static void compat_irq_ack(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->ack(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -375,12 +380,12 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_bus_lock = compat_bus_lock;
 	if (chip->bus_sync_unlock)
 		chip->irq_bus_sync_unlock = compat_bus_sync_unlock;
-
 	if (chip->mask)
 		chip->irq_mask = compat_irq_mask;
-
 	if (chip->unmask)
 		chip->irq_unmask = compat_irq_unmask;
+	if (chip->ack)
+		chip->irq_ack = compat_irq_ack;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc, int irq)
@@ -389,8 +394,8 @@ static inline void mask_ack_irq(struct i
 		desc->chip->mask_ack(irq);
 	else {
 		desc->chip->irq_mask(&desc->irq_data);
-		if (desc->chip->ack)
-			desc->chip->ack(irq);
+		if (desc->chip->irq_ack)
+			desc->chip->irq_ack(&desc->irq_data);
 	}
 	desc->status |= IRQ_MASKED;
 }
@@ -629,8 +634,7 @@ handle_edge_irq(unsigned int irq, struct
 	kstat_incr_irqs_this_cpu(irq, desc);
 
 	/* Start handling the irq */
-	if (desc->chip->ack)
-		desc->chip->ack(irq);
+	desc->chip->irq_ack(&desc->irq_data);
 
 	/* Mark the IRQ currently in progress.*/
 	desc->status |= IRQ_INPROGRESS;
@@ -683,8 +687,8 @@ handle_percpu_irq(unsigned int irq, stru
 
 	kstat_incr_irqs_this_cpu(irq, desc);
 
-	if (desc->chip->ack)
-		desc->chip->ack(irq);
+	if (desc->chip->irq_ack)
+		desc->chip->irq_ack(&desc->irq_data);
 
 	action_ret = handle_IRQ_event(irq, desc->action);
 	if (!noirqdebug)



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 08/19] genirq; Provide compat handling for chip->mask_ack()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (6 preceding siblings ...)
  2010-09-27 12:44 ` [patch 07/19] genirq; Provide compat handling for chip->ack() Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44   ` Thomas Gleixner
  2010-09-27 15:10   ` Geert Uytterhoeven
  2010-09-27 12:44 ` [patch 09/19] genirq; Provide compat handling for chip->eoi() Thomas Gleixner
                   ` (10 subsequent siblings)
  18 siblings, 2 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-mask-ack.patch --]
[-- Type: text/plain, Size: 2275 bytes --]

Wrap the old chip function mask_ack() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |   20 ++++++++++++++++++--
 kernel/irq/internals.h |   17 +++++++++++------
 kernel/irq/manage.c    |   22 +++++++++++-----------
 3 files changed, 40 insertions(+), 19 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -343,6 +343,11 @@ static void compat_irq_ack(struct irq_da
 	irq_data_to_desc(data)->chip->ack(data->irq);
 }
 
+static void compat_irq_mask_ack(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->mask_ack(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -386,12 +391,14 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_unmask = compat_irq_unmask;
 	if (chip->ack)
 		chip->irq_ack = compat_irq_ack;
+	if (chip->mask_ack)
+		chip->irq_mask_ack = compat_irq_mask_ack;
 }
 
-static inline void mask_ack_irq(struct irq_desc *desc, int irq)
+static inline void mask_ack_irq(struct irq_desc *desc)
 {
-	if (desc->chip->mask_ack)
-		desc->chip->mask_ack(irq);
+	if (desc->chip->irq_mask_ack)
+		desc->chip->irq_mask_ack(&desc->irq_data);
 	else {
 		desc->chip->irq_mask(&desc->irq_data);
 		if (desc->chip->irq_ack)
@@ -514,7 +521,7 @@ handle_level_irq(unsigned int irq, struc
 	irqreturn_t action_ret;
 
 	raw_spin_lock(&desc->lock);
-	mask_ack_irq(desc, irq);
+	mask_ack_irq(desc);
 
 	if (unlikely(desc->status & IRQ_INPROGRESS))
 		goto out_unlock;
@@ -628,7 +635,7 @@ handle_edge_irq(unsigned int irq, struct
 	if (unlikely((desc->status & (IRQ_INPROGRESS | IRQ_DISABLED)) ||
 		    !desc->action)) {
 		desc->status |= (IRQ_PENDING | IRQ_MASKED);
-		mask_ack_irq(desc, irq);
+		mask_ack_irq(desc);
 		goto out_unlock;
 	}
 	kstat_incr_irqs_this_cpu(irq, desc);
@@ -733,7 +740,7 @@ __set_irq_handler(unsigned int irq, irq_
 	/* Uninstall? */
 	if (handle == handle_bad_irq) {
 		if (desc->chip != &no_irq_chip)
-			mask_ack_irq(desc, irq);
+			mask_ack_irq(desc);
 		desc->status |= IRQ_DISABLED;
 		desc->depth = 1;
 	}

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 08/19] genirq; Provide compat handling for chip->mask_ack()
  2010-09-27 12:44 ` [patch 08/19] genirq; Provide compat handling for chip->mask_ack() Thomas Gleixner
@ 2010-09-27 12:44   ` Thomas Gleixner
  2010-09-27 15:10   ` Geert Uytterhoeven
  1 sibling, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-mask-ack.patch --]
[-- Type: text/plain, Size: 2277 bytes --]

Wrap the old chip function mask_ack() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |   20 ++++++++++++++++++--
 kernel/irq/internals.h |   17 +++++++++++------
 kernel/irq/manage.c    |   22 +++++++++++-----------
 3 files changed, 40 insertions(+), 19 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -343,6 +343,11 @@ static void compat_irq_ack(struct irq_da
 	irq_data_to_desc(data)->chip->ack(data->irq);
 }
 
+static void compat_irq_mask_ack(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->mask_ack(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -386,12 +391,14 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_unmask = compat_irq_unmask;
 	if (chip->ack)
 		chip->irq_ack = compat_irq_ack;
+	if (chip->mask_ack)
+		chip->irq_mask_ack = compat_irq_mask_ack;
 }
 
-static inline void mask_ack_irq(struct irq_desc *desc, int irq)
+static inline void mask_ack_irq(struct irq_desc *desc)
 {
-	if (desc->chip->mask_ack)
-		desc->chip->mask_ack(irq);
+	if (desc->chip->irq_mask_ack)
+		desc->chip->irq_mask_ack(&desc->irq_data);
 	else {
 		desc->chip->irq_mask(&desc->irq_data);
 		if (desc->chip->irq_ack)
@@ -514,7 +521,7 @@ handle_level_irq(unsigned int irq, struc
 	irqreturn_t action_ret;
 
 	raw_spin_lock(&desc->lock);
-	mask_ack_irq(desc, irq);
+	mask_ack_irq(desc);
 
 	if (unlikely(desc->status & IRQ_INPROGRESS))
 		goto out_unlock;
@@ -628,7 +635,7 @@ handle_edge_irq(unsigned int irq, struct
 	if (unlikely((desc->status & (IRQ_INPROGRESS | IRQ_DISABLED)) ||
 		    !desc->action)) {
 		desc->status |= (IRQ_PENDING | IRQ_MASKED);
-		mask_ack_irq(desc, irq);
+		mask_ack_irq(desc);
 		goto out_unlock;
 	}
 	kstat_incr_irqs_this_cpu(irq, desc);
@@ -733,7 +740,7 @@ __set_irq_handler(unsigned int irq, irq_
 	/* Uninstall? */
 	if (handle == handle_bad_irq) {
 		if (desc->chip != &no_irq_chip)
-			mask_ack_irq(desc, irq);
+			mask_ack_irq(desc);
 		desc->status |= IRQ_DISABLED;
 		desc->depth = 1;
 	}



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 09/19] genirq; Provide compat handling for chip->eoi()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (7 preceding siblings ...)
  2010-09-27 12:44 ` [patch 08/19] genirq; Provide compat handling for chip->mask_ack() Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:44   ` Thomas Gleixner
  2010-09-27 12:44 ` [patch 10/19] genirq; Provide compat handling for chip->enable() Thomas Gleixner
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-eoi.patch --]
[-- Type: text/plain, Size: 1531 bytes --]

Wrap the old chip function eoi() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -348,6 +348,11 @@ static void compat_irq_mask_ack(struct i
 	irq_data_to_desc(data)->chip->mask_ack(data->irq);
 }
 
+static void compat_irq_eoi(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->eoi(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -393,6 +398,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_ack = compat_irq_ack;
 	if (chip->mask_ack)
 		chip->irq_mask_ack = compat_irq_mask_ack;
+	if (chip->eoi)
+		chip->irq_eoi = compat_irq_eoi;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
@@ -599,7 +606,7 @@ handle_fasteoi_irq(unsigned int irq, str
 	raw_spin_lock(&desc->lock);
 	desc->status &= ~IRQ_INPROGRESS;
 out:
-	desc->chip->eoi(irq);
+	desc->chip->irq_eoi(&desc->irq_data);
 
 	raw_spin_unlock(&desc->lock);
 }
@@ -701,8 +708,8 @@ handle_percpu_irq(unsigned int irq, stru
 	if (!noirqdebug)
 		note_interrupt(irq, desc, action_ret);
 
-	if (desc->chip->eoi)
-		desc->chip->eoi(irq);
+	if (desc->chip->irq_eoi)
+		desc->chip->irq_eoi(&desc->irq_data);
 }
 
 void

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 09/19] genirq; Provide compat handling for chip->eoi()
  2010-09-27 12:44 ` [patch 09/19] genirq; Provide compat handling for chip->eoi() Thomas Gleixner
@ 2010-09-27 12:44   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-eoi.patch --]
[-- Type: text/plain, Size: 1533 bytes --]

Wrap the old chip function eoi() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -348,6 +348,11 @@ static void compat_irq_mask_ack(struct i
 	irq_data_to_desc(data)->chip->mask_ack(data->irq);
 }
 
+static void compat_irq_eoi(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->eoi(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -393,6 +398,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_ack = compat_irq_ack;
 	if (chip->mask_ack)
 		chip->irq_mask_ack = compat_irq_mask_ack;
+	if (chip->eoi)
+		chip->irq_eoi = compat_irq_eoi;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
@@ -599,7 +606,7 @@ handle_fasteoi_irq(unsigned int irq, str
 	raw_spin_lock(&desc->lock);
 	desc->status &= ~IRQ_INPROGRESS;
 out:
-	desc->chip->eoi(irq);
+	desc->chip->irq_eoi(&desc->irq_data);
 
 	raw_spin_unlock(&desc->lock);
 }
@@ -701,8 +708,8 @@ handle_percpu_irq(unsigned int irq, stru
 	if (!noirqdebug)
 		note_interrupt(irq, desc, action_ret);
 
-	if (desc->chip->eoi)
-		desc->chip->eoi(irq);
+	if (desc->chip->irq_eoi)
+		desc->chip->irq_eoi(&desc->irq_data);
 }
 
 void



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 10/19] genirq; Provide compat handling for chip->enable()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (8 preceding siblings ...)
  2010-09-27 12:44 ` [patch 09/19] genirq; Provide compat handling for chip->eoi() Thomas Gleixner
@ 2010-09-27 12:44 ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown() Thomas Gleixner
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-enable.patch --]
[-- Type: text/plain, Size: 2375 bytes --]

Wrap the old chip function enable() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c   |   25 ++++++++++++++++++++-----
 kernel/irq/resend.c |    2 +-
 2 files changed, 21 insertions(+), 6 deletions(-)
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -290,9 +290,9 @@ EXPORT_SYMBOL_GPL(set_irq_nested_thread)
 /*
  * default enable function
  */
-static void default_enable(unsigned int irq)
+static void default_enable(struct irq_data *data)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_desc *desc = irq_data_to_desc(data);
 
 	desc->chip->irq_unmask(&desc->irq_data);
 	desc->status &= ~IRQ_MASKED;
@@ -312,7 +312,7 @@ static unsigned int default_startup(unsi
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 
-	desc->chip->enable(irq);
+	desc->chip->irq_enable(&desc->irq_data);
 	return 0;
 }
 
@@ -353,6 +353,11 @@ static void compat_irq_eoi(struct irq_da
 	irq_data_to_desc(data)->chip->eoi(data->irq);
 }
 
+static void compat_irq_enable(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->enable(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -368,8 +373,18 @@ static void compat_bus_sync_unlock(struc
  */
 void irq_chip_set_defaults(struct irq_chip *chip)
 {
-	if (!chip->enable)
-		chip->enable = default_enable;
+	/*
+	 * Compat fixup functions need to be before we set the
+	 * defaults for enable/disable/startup/shutdown
+	 */
+	if (chip->enable)
+		chip->irq_enable = compat_irq_enable;
+
+	/*
+	 * The real defaults
+	 */
+	if (!chip->irq_enable)
+		chip->irq_enable = default_enable;
 	if (!chip->disable)
 		chip->disable = default_disable;
 	if (!chip->startup)
Index: linux-2.6-tip/kernel/irq/resend.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/resend.c
+++ linux-2.6-tip/kernel/irq/resend.c
@@ -60,7 +60,7 @@ void check_irq_resend(struct irq_desc *d
 	/*
 	 * Make sure the interrupt is enabled, before resending it:
 	 */
-	desc->chip->enable(irq);
+	desc->chip->irq_enable(&desc->irq_data);
 
 	/*
 	 * We do not resend level type interrupts. Level type

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (9 preceding siblings ...)
  2010-09-27 12:44 ` [patch 10/19] genirq; Provide compat handling for chip->enable() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45   ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 12/19] genirq; Provide compat handling for chip->startup() Thomas Gleixner
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-disable.patch --]
[-- Type: text/plain, Size: 5374 bytes --]

Wrap the old chip functions disable() and shutdown() until the
migration is complete and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/autoprobe.c |    6 +++---
 kernel/irq/chip.c      |   37 +++++++++++++++++++++++++++----------
 kernel/irq/manage.c    |    8 ++++----
 kernel/irq/spurious.c  |    2 +-
 4 files changed, 35 insertions(+), 18 deletions(-)

Index: linux-2.6-tip/kernel/irq/autoprobe.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/autoprobe.c
+++ linux-2.6-tip/kernel/irq/autoprobe.c
@@ -98,7 +98,7 @@ unsigned long probe_irq_on(void)
 			/* It triggered already - consider it spurious. */
 			if (!(status & IRQ_WAITING)) {
 				desc->status = status & ~IRQ_AUTODETECT;
-				desc->chip->shutdown(i);
+				desc->chip->irq_shutdown(&desc->irq_data);
 			} else
 				if (i < 32)
 					mask |= 1 << i;
@@ -137,7 +137,7 @@ unsigned int probe_irq_mask(unsigned lon
 				mask |= 1 << i;
 
 			desc->status = status & ~IRQ_AUTODETECT;
-			desc->chip->shutdown(i);
+			desc->chip->irq_shutdown(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
@@ -181,7 +181,7 @@ int probe_irq_off(unsigned long val)
 				nr_of_irqs++;
 			}
 			desc->status = status & ~IRQ_AUTODETECT;
-			desc->chip->shutdown(i);
+			desc->chip->irq_shutdown(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -301,7 +301,7 @@ static void default_enable(struct irq_da
 /*
  * default disable function
  */
-static void default_disable(unsigned int irq)
+static void default_disable(struct irq_data *data)
 {
 }
 
@@ -319,9 +319,9 @@ static unsigned int default_startup(unsi
 /*
  * default shutdown function
  */
-static void default_shutdown(unsigned int irq)
+static void default_shutdown(struct irq_data *data)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_desc *desc = irq_data_to_desc(data);
 
 	desc->chip->irq_mask(&desc->irq_data);
 	desc->status |= IRQ_MASKED;
@@ -358,6 +358,16 @@ static void compat_irq_enable(struct irq
 	irq_data_to_desc(data)->chip->enable(data->irq);
 }
 
+static void compat_irq_disable(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->disable(data->irq);
+}
+
+static void compat_irq_shutdown(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->shutdown(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -379,28 +389,35 @@ void irq_chip_set_defaults(struct irq_ch
 	 */
 	if (chip->enable)
 		chip->irq_enable = compat_irq_enable;
+	if (chip->disable)
+		chip->irq_disable = compat_irq_disable;
+	if (chip->shutdown)
+		chip->irq_shutdown = compat_irq_shutdown;
 
 	/*
 	 * The real defaults
 	 */
 	if (!chip->irq_enable)
 		chip->irq_enable = default_enable;
-	if (!chip->disable)
-		chip->disable = default_disable;
+	if (!chip->irq_disable)
+		chip->irq_disable = default_disable;
 	if (!chip->startup)
 		chip->startup = default_startup;
 	/*
-	 * We use chip->disable, when the user provided its own. When
-	 * we have default_disable set for chip->disable, then we need
+	 * We use chip->irq_disable, when the user provided its own. When
+	 * we have default_disable set for chip->irq_disable, then we need
 	 * to use default_shutdown, otherwise the irq line is not
 	 * disabled on free_irq():
 	 */
-	if (!chip->shutdown)
-		chip->shutdown = chip->disable != default_disable ?
-			chip->disable : default_shutdown;
+	if (!chip->irq_shutdown)
+		chip->irq_shutdown = chip->irq_disable != default_disable ?
+			chip->irq_disable : default_shutdown;
 	if (!chip->end)
 		chip->end = dummy_irq_chip.end;
 
+	/*
+	 * Now fix up the remaining compat handlers
+	 */
 	if (chip->bus_lock)
 		chip->irq_bus_lock = compat_bus_lock;
 	if (chip->bus_sync_unlock)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -223,7 +223,7 @@ void __disable_irq(struct irq_desc *desc
 
 	if (!desc->depth++) {
 		desc->status |= IRQ_DISABLED;
-		desc->chip->disable(irq);
+		desc->chip->irq_disable(&desc->irq_data);
 	}
 }
 
@@ -919,10 +919,10 @@ static struct irqaction *__free_irq(unsi
 	/* If this was the last handler, shut down the IRQ line: */
 	if (!desc->action) {
 		desc->status |= IRQ_DISABLED;
-		if (desc->chip->shutdown)
-			desc->chip->shutdown(irq);
+		if (desc->chip->irq_shutdown)
+			desc->chip->irq_shutdown(&desc->irq_data);
 		else
-			desc->chip->disable(irq);
+			desc->chip->irq_disable(&desc->irq_data);
 	}
 
 #ifdef CONFIG_SMP
Index: linux-2.6-tip/kernel/irq/spurious.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/spurious.c
+++ linux-2.6-tip/kernel/irq/spurious.c
@@ -254,7 +254,7 @@ void note_interrupt(unsigned int irq, st
 		printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
 		desc->status |= IRQ_DISABLED | IRQ_SPURIOUS_DISABLED;
 		desc->depth++;
-		desc->chip->disable(irq);
+		desc->chip->irq_disable(&desc->irq_data);
 
 		mod_timer(&poll_spurious_irq_timer,
 			  jiffies + POLL_SPURIOUS_IRQ_INTERVAL);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown()
  2010-09-27 12:45 ` [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown() Thomas Gleixner
@ 2010-09-27 12:45   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-disable.patch --]
[-- Type: text/plain, Size: 5376 bytes --]

Wrap the old chip functions disable() and shutdown() until the
migration is complete and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/autoprobe.c |    6 +++---
 kernel/irq/chip.c      |   37 +++++++++++++++++++++++++++----------
 kernel/irq/manage.c    |    8 ++++----
 kernel/irq/spurious.c  |    2 +-
 4 files changed, 35 insertions(+), 18 deletions(-)

Index: linux-2.6-tip/kernel/irq/autoprobe.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/autoprobe.c
+++ linux-2.6-tip/kernel/irq/autoprobe.c
@@ -98,7 +98,7 @@ unsigned long probe_irq_on(void)
 			/* It triggered already - consider it spurious. */
 			if (!(status & IRQ_WAITING)) {
 				desc->status = status & ~IRQ_AUTODETECT;
-				desc->chip->shutdown(i);
+				desc->chip->irq_shutdown(&desc->irq_data);
 			} else
 				if (i < 32)
 					mask |= 1 << i;
@@ -137,7 +137,7 @@ unsigned int probe_irq_mask(unsigned lon
 				mask |= 1 << i;
 
 			desc->status = status & ~IRQ_AUTODETECT;
-			desc->chip->shutdown(i);
+			desc->chip->irq_shutdown(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
@@ -181,7 +181,7 @@ int probe_irq_off(unsigned long val)
 				nr_of_irqs++;
 			}
 			desc->status = status & ~IRQ_AUTODETECT;
-			desc->chip->shutdown(i);
+			desc->chip->irq_shutdown(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -301,7 +301,7 @@ static void default_enable(struct irq_da
 /*
  * default disable function
  */
-static void default_disable(unsigned int irq)
+static void default_disable(struct irq_data *data)
 {
 }
 
@@ -319,9 +319,9 @@ static unsigned int default_startup(unsi
 /*
  * default shutdown function
  */
-static void default_shutdown(unsigned int irq)
+static void default_shutdown(struct irq_data *data)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_desc *desc = irq_data_to_desc(data);
 
 	desc->chip->irq_mask(&desc->irq_data);
 	desc->status |= IRQ_MASKED;
@@ -358,6 +358,16 @@ static void compat_irq_enable(struct irq
 	irq_data_to_desc(data)->chip->enable(data->irq);
 }
 
+static void compat_irq_disable(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->disable(data->irq);
+}
+
+static void compat_irq_shutdown(struct irq_data *data)
+{
+	irq_data_to_desc(data)->chip->shutdown(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -379,28 +389,35 @@ void irq_chip_set_defaults(struct irq_ch
 	 */
 	if (chip->enable)
 		chip->irq_enable = compat_irq_enable;
+	if (chip->disable)
+		chip->irq_disable = compat_irq_disable;
+	if (chip->shutdown)
+		chip->irq_shutdown = compat_irq_shutdown;
 
 	/*
 	 * The real defaults
 	 */
 	if (!chip->irq_enable)
 		chip->irq_enable = default_enable;
-	if (!chip->disable)
-		chip->disable = default_disable;
+	if (!chip->irq_disable)
+		chip->irq_disable = default_disable;
 	if (!chip->startup)
 		chip->startup = default_startup;
 	/*
-	 * We use chip->disable, when the user provided its own. When
-	 * we have default_disable set for chip->disable, then we need
+	 * We use chip->irq_disable, when the user provided its own. When
+	 * we have default_disable set for chip->irq_disable, then we need
 	 * to use default_shutdown, otherwise the irq line is not
 	 * disabled on free_irq():
 	 */
-	if (!chip->shutdown)
-		chip->shutdown = chip->disable != default_disable ?
-			chip->disable : default_shutdown;
+	if (!chip->irq_shutdown)
+		chip->irq_shutdown = chip->irq_disable != default_disable ?
+			chip->irq_disable : default_shutdown;
 	if (!chip->end)
 		chip->end = dummy_irq_chip.end;
 
+	/*
+	 * Now fix up the remaining compat handlers
+	 */
 	if (chip->bus_lock)
 		chip->irq_bus_lock = compat_bus_lock;
 	if (chip->bus_sync_unlock)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -223,7 +223,7 @@ void __disable_irq(struct irq_desc *desc
 
 	if (!desc->depth++) {
 		desc->status |= IRQ_DISABLED;
-		desc->chip->disable(irq);
+		desc->chip->irq_disable(&desc->irq_data);
 	}
 }
 
@@ -919,10 +919,10 @@ static struct irqaction *__free_irq(unsi
 	/* If this was the last handler, shut down the IRQ line: */
 	if (!desc->action) {
 		desc->status |= IRQ_DISABLED;
-		if (desc->chip->shutdown)
-			desc->chip->shutdown(irq);
+		if (desc->chip->irq_shutdown)
+			desc->chip->irq_shutdown(&desc->irq_data);
 		else
-			desc->chip->disable(irq);
+			desc->chip->irq_disable(&desc->irq_data);
 	}
 
 #ifdef CONFIG_SMP
Index: linux-2.6-tip/kernel/irq/spurious.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/spurious.c
+++ linux-2.6-tip/kernel/irq/spurious.c
@@ -254,7 +254,7 @@ void note_interrupt(unsigned int irq, st
 		printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
 		desc->status |= IRQ_DISABLED | IRQ_SPURIOUS_DISABLED;
 		desc->depth++;
-		desc->chip->disable(irq);
+		desc->chip->irq_disable(&desc->irq_data);
 
 		mod_timer(&poll_spurious_irq_timer,
 			  jiffies + POLL_SPURIOUS_IRQ_INTERVAL);



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 12/19] genirq; Provide compat handling for chip->startup()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (10 preceding siblings ...)
  2010-09-27 12:45 ` [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 13/19] genirq; Provide compat handling for chip->set_affinity() Thomas Gleixner
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-startup.patch --]
[-- Type: text/plain, Size: 3597 bytes --]

Wrap the old chip function startup() until the migration is complete and
the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/autoprobe.c |    4 ++--
 kernel/irq/chip.c      |   19 +++++++++++++------
 kernel/irq/manage.c    |    2 +-
 3 files changed, 16 insertions(+), 9 deletions(-)

Index: linux-2.6-tip/kernel/irq/autoprobe.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/autoprobe.c
+++ linux-2.6-tip/kernel/irq/autoprobe.c
@@ -59,7 +59,7 @@ unsigned long probe_irq_on(void)
 			 */
 			if (desc->chip->set_type)
 				desc->chip->set_type(i, IRQ_TYPE_PROBE);
-			desc->chip->startup(i);
+			desc->chip->irq_startup(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
 	}
@@ -76,7 +76,7 @@ unsigned long probe_irq_on(void)
 		raw_spin_lock_irq(&desc->lock);
 		if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
 			desc->status |= IRQ_AUTODETECT | IRQ_WAITING;
-			if (desc->chip->startup(i))
+			if (desc->chip->irq_startup(&desc->irq_data))
 				desc->status |= IRQ_PENDING;
 		}
 		raw_spin_unlock_irq(&desc->lock);
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -308,11 +308,11 @@ static void default_disable(struct irq_d
 /*
  * default startup function
  */
-static unsigned int default_startup(unsigned int irq)
+static unsigned int default_startup(struct irq_data *data)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_desc *desc = irq_data_to_desc(data);
 
-	desc->chip->irq_enable(&desc->irq_data);
+	desc->chip->irq_enable(data);
 	return 0;
 }
 
@@ -368,6 +368,11 @@ static void compat_irq_shutdown(struct i
 	irq_data_to_desc(data)->chip->shutdown(data->irq);
 }
 
+static unsigned int compat_irq_startup(struct irq_data *data)
+{
+	return irq_data_to_desc(data)->chip->startup(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -393,6 +398,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_disable = compat_irq_disable;
 	if (chip->shutdown)
 		chip->irq_shutdown = compat_irq_shutdown;
+	if (chip->startup)
+		chip->irq_startup = compat_irq_startup;
 
 	/*
 	 * The real defaults
@@ -401,8 +408,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_enable = default_enable;
 	if (!chip->irq_disable)
 		chip->irq_disable = default_disable;
-	if (!chip->startup)
-		chip->startup = default_startup;
+	if (!chip->irq_startup)
+		chip->irq_startup = default_startup;
 	/*
 	 * We use chip->irq_disable, when the user provided its own. When
 	 * we have default_disable set for chip->irq_disable, then we need
@@ -790,7 +797,7 @@ __set_irq_handler(unsigned int irq, irq_
 		desc->status &= ~IRQ_DISABLED;
 		desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE;
 		desc->depth = 0;
-		desc->chip->startup(irq);
+		desc->chip->irq_startup(&desc->irq_data);
 	}
 	raw_spin_unlock_irqrestore(&desc->lock, flags);
 	chip_bus_sync_unlock(desc);
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -779,7 +779,7 @@ __setup_irq(unsigned int irq, struct irq
 		if (!(desc->status & IRQ_NOAUTOEN)) {
 			desc->depth = 0;
 			desc->status &= ~IRQ_DISABLED;
-			desc->chip->startup(irq);
+			desc->chip->irq_startup(&desc->irq_data);
 		} else
 			/* Undo nested disables: */
 			desc->depth = 1;

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 13/19] genirq; Provide compat handling for chip->set_affinity()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (11 preceding siblings ...)
  2010-09-27 12:45 ` [patch 12/19] genirq; Provide compat handling for chip->startup() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45   ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 14/19] genirq; Provide compat handling for chip->set_type() Thomas Gleixner
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-set-affinity.patch --]
[-- Type: text/plain, Size: 4455 bytes --]

Wrap the old chip function set_affinity() until the migration is
complete and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |    8 ++++++++
 kernel/irq/manage.c    |   11 ++++++-----
 kernel/irq/migration.c |    6 ++++--
 kernel/irq/proc.c      |    2 +-
 4 files changed, 19 insertions(+), 8 deletions(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -373,6 +373,12 @@ static unsigned int compat_irq_startup(s
 	return irq_data_to_desc(data)->chip->startup(data->irq);
 }
 
+static int compat_irq_set_affinity(struct irq_data *data,
+				   const struct cpumask *dest, bool force)
+{
+	return irq_data_to_desc(data)->chip->set_affinity(data->irq, dest);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -439,6 +445,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_mask_ack = compat_irq_mask_ack;
 	if (chip->eoi)
 		chip->irq_eoi = compat_irq_eoi;
+	if (chip->set_affinity)
+		chip->irq_set_affinity = compat_irq_set_affinity;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -74,7 +74,7 @@ int irq_can_set_affinity(unsigned int ir
 	struct irq_desc *desc = irq_to_desc(irq);
 
 	if (CHECK_IRQ_PER_CPU(desc->status) || !desc->chip ||
-	    !desc->chip->set_affinity)
+	    !desc->chip->irq_set_affinity)
 		return 0;
 
 	return 1;
@@ -109,16 +109,17 @@ void irq_set_thread_affinity(struct irq_
 int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_chip *chip = desc->chip;
 	unsigned long flags;
 
-	if (!desc->chip->set_affinity)
+	if (!chip->irq_set_affinity)
 		return -EINVAL;
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
 	if (desc->status & IRQ_MOVE_PCNTXT) {
-		if (!desc->chip->set_affinity(irq, cpumask)) {
+		if (!chip->irq_set_affinity(&desc->irq_data, cpumask, false)) {
 			cpumask_copy(desc->affinity, cpumask);
 			irq_set_thread_affinity(desc);
 		}
@@ -128,7 +129,7 @@ int irq_set_affinity(unsigned int irq, c
 		cpumask_copy(desc->pending_mask, cpumask);
 	}
 #else
-	if (!desc->chip->set_affinity(irq, cpumask)) {
+	if (!chip->irq_set_affinity(&dest->irq_data, cpumask, false)) {
 		cpumask_copy(desc->affinity, cpumask);
 		irq_set_thread_affinity(desc);
 	}
@@ -177,7 +178,7 @@ static int setup_affinity(unsigned int i
 
 	cpumask_and(desc->affinity, cpu_online_mask, irq_default_affinity);
 set_affinity:
-	desc->chip->set_affinity(irq, desc->affinity);
+	desc->chip->irq_set_affinity(&desc->irq_data, desc->affinity, false);
 
 	return 0;
 }
Index: linux-2.6-tip/kernel/irq/migration.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/migration.c
+++ linux-2.6-tip/kernel/irq/migration.c
@@ -7,6 +7,7 @@
 void move_masked_irq(int irq)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_chip *chip = desc->chip;
 
 	if (likely(!(desc->status & IRQ_MOVE_PENDING)))
 		return;
@@ -24,7 +25,7 @@ void move_masked_irq(int irq)
 	if (unlikely(cpumask_empty(desc->pending_mask)))
 		return;
 
-	if (!desc->chip->set_affinity)
+	if (!chip->irq_set_affinity)
 		return;
 
 	assert_raw_spin_locked(&desc->lock);
@@ -43,7 +44,8 @@ void move_masked_irq(int irq)
 	 */
 	if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
 		   < nr_cpu_ids))
-		if (!desc->chip->set_affinity(irq, desc->pending_mask)) {
+		if (!chip->irq_set_affinity(&desc->irq_data,
+					    desc->pending_mask, false)) {
 			cpumask_copy(desc->affinity, desc->pending_mask);
 			irq_set_thread_affinity(desc);
 		}
Index: linux-2.6-tip/kernel/irq/proc.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/proc.c
+++ linux-2.6-tip/kernel/irq/proc.c
@@ -65,7 +65,7 @@ static ssize_t irq_affinity_proc_write(s
 	cpumask_var_t new_value;
 	int err;
 
-	if (!irq_to_desc(irq)->chip->set_affinity || no_irq_affinity ||
+	if (!irq_to_desc(irq)->chip->irq_set_affinity || no_irq_affinity ||
 	    irq_balancing_disabled(irq))
 		return -EIO;
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 13/19] genirq; Provide compat handling for chip->set_affinity()
  2010-09-27 12:45 ` [patch 13/19] genirq; Provide compat handling for chip->set_affinity() Thomas Gleixner
@ 2010-09-27 12:45   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-set-affinity.patch --]
[-- Type: text/plain, Size: 4457 bytes --]

Wrap the old chip function set_affinity() until the migration is
complete and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c      |    8 ++++++++
 kernel/irq/manage.c    |   11 ++++++-----
 kernel/irq/migration.c |    6 ++++--
 kernel/irq/proc.c      |    2 +-
 4 files changed, 19 insertions(+), 8 deletions(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -373,6 +373,12 @@ static unsigned int compat_irq_startup(s
 	return irq_data_to_desc(data)->chip->startup(data->irq);
 }
 
+static int compat_irq_set_affinity(struct irq_data *data,
+				   const struct cpumask *dest, bool force)
+{
+	return irq_data_to_desc(data)->chip->set_affinity(data->irq, dest);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -439,6 +445,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_mask_ack = compat_irq_mask_ack;
 	if (chip->eoi)
 		chip->irq_eoi = compat_irq_eoi;
+	if (chip->set_affinity)
+		chip->irq_set_affinity = compat_irq_set_affinity;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -74,7 +74,7 @@ int irq_can_set_affinity(unsigned int ir
 	struct irq_desc *desc = irq_to_desc(irq);
 
 	if (CHECK_IRQ_PER_CPU(desc->status) || !desc->chip ||
-	    !desc->chip->set_affinity)
+	    !desc->chip->irq_set_affinity)
 		return 0;
 
 	return 1;
@@ -109,16 +109,17 @@ void irq_set_thread_affinity(struct irq_
 int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_chip *chip = desc->chip;
 	unsigned long flags;
 
-	if (!desc->chip->set_affinity)
+	if (!chip->irq_set_affinity)
 		return -EINVAL;
 
 	raw_spin_lock_irqsave(&desc->lock, flags);
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
 	if (desc->status & IRQ_MOVE_PCNTXT) {
-		if (!desc->chip->set_affinity(irq, cpumask)) {
+		if (!chip->irq_set_affinity(&desc->irq_data, cpumask, false)) {
 			cpumask_copy(desc->affinity, cpumask);
 			irq_set_thread_affinity(desc);
 		}
@@ -128,7 +129,7 @@ int irq_set_affinity(unsigned int irq, c
 		cpumask_copy(desc->pending_mask, cpumask);
 	}
 #else
-	if (!desc->chip->set_affinity(irq, cpumask)) {
+	if (!chip->irq_set_affinity(&dest->irq_data, cpumask, false)) {
 		cpumask_copy(desc->affinity, cpumask);
 		irq_set_thread_affinity(desc);
 	}
@@ -177,7 +178,7 @@ static int setup_affinity(unsigned int i
 
 	cpumask_and(desc->affinity, cpu_online_mask, irq_default_affinity);
 set_affinity:
-	desc->chip->set_affinity(irq, desc->affinity);
+	desc->chip->irq_set_affinity(&desc->irq_data, desc->affinity, false);
 
 	return 0;
 }
Index: linux-2.6-tip/kernel/irq/migration.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/migration.c
+++ linux-2.6-tip/kernel/irq/migration.c
@@ -7,6 +7,7 @@
 void move_masked_irq(int irq)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_chip *chip = desc->chip;
 
 	if (likely(!(desc->status & IRQ_MOVE_PENDING)))
 		return;
@@ -24,7 +25,7 @@ void move_masked_irq(int irq)
 	if (unlikely(cpumask_empty(desc->pending_mask)))
 		return;
 
-	if (!desc->chip->set_affinity)
+	if (!chip->irq_set_affinity)
 		return;
 
 	assert_raw_spin_locked(&desc->lock);
@@ -43,7 +44,8 @@ void move_masked_irq(int irq)
 	 */
 	if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask)
 		   < nr_cpu_ids))
-		if (!desc->chip->set_affinity(irq, desc->pending_mask)) {
+		if (!chip->irq_set_affinity(&desc->irq_data,
+					    desc->pending_mask, false)) {
 			cpumask_copy(desc->affinity, desc->pending_mask);
 			irq_set_thread_affinity(desc);
 		}
Index: linux-2.6-tip/kernel/irq/proc.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/proc.c
+++ linux-2.6-tip/kernel/irq/proc.c
@@ -65,7 +65,7 @@ static ssize_t irq_affinity_proc_write(s
 	cpumask_var_t new_value;
 	int err;
 
-	if (!irq_to_desc(irq)->chip->set_affinity || no_irq_affinity ||
+	if (!irq_to_desc(irq)->chip->irq_set_affinity || no_irq_affinity ||
 	    irq_balancing_disabled(irq))
 		return -EIO;
 



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 14/19] genirq; Provide compat handling for chip->set_type()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (12 preceding siblings ...)
  2010-09-27 12:45 ` [patch 13/19] genirq; Provide compat handling for chip->set_affinity() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45   ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 15/19] genirq; Provide compat handling for chip->set_wake() Thomas Gleixner
                   ` (4 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-set-type.patch --]
[-- Type: text/plain, Size: 2923 bytes --]

Wrap the old chip function set_type() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/autoprobe.c |    5 +++--
 kernel/irq/chip.c      |    7 +++++++
 kernel/irq/manage.c    |   10 +++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)

Index: linux-2.6-tip/kernel/irq/autoprobe.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/autoprobe.c
+++ linux-2.6-tip/kernel/irq/autoprobe.c
@@ -57,8 +57,9 @@ unsigned long probe_irq_on(void)
 			 * Some chips need to know about probing in
 			 * progress:
 			 */
-			if (desc->chip->set_type)
-				desc->chip->set_type(i, IRQ_TYPE_PROBE);
+			if (desc->chip->irq_set_type)
+				desc->chip->irq_set_type(&desc->irq_data,
+							 IRQ_TYPE_PROBE);
 			desc->chip->irq_startup(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -379,6 +379,11 @@ static int compat_irq_set_affinity(struc
 	return irq_data_to_desc(data)->chip->set_affinity(data->irq, dest);
 }
 
+static int compat_irq_set_type(struct irq_data *data, unsigned int type)
+{
+	return irq_data_to_desc(data)->chip->set_type(data->irq, type);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -447,6 +452,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_eoi = compat_irq_eoi;
 	if (chip->set_affinity)
 		chip->irq_set_affinity = compat_irq_set_affinity;
+	if (chip->set_type)
+		chip->irq_set_type = compat_irq_set_type;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -429,12 +429,12 @@ void compat_irq_chip_set_default_handler
 }
 
 int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
-		unsigned long flags)
+		      unsigned long flags)
 {
 	int ret;
 	struct irq_chip *chip = desc->chip;
 
-	if (!chip || !chip->set_type) {
+	if (!chip || !chip->irq_set_type) {
 		/*
 		 * IRQF_TRIGGER_* but the PIC does not support multiple
 		 * flow-types?
@@ -445,11 +445,11 @@ int __irq_set_trigger(struct irq_desc *d
 	}
 
 	/* caller masked out all except trigger mode flags */
-	ret = chip->set_type(irq, flags);
+	ret = chip->irq_set_type(&desc->irq_data, flags);
 
 	if (ret)
-		pr_err("setting trigger mode %d for irq %u failed (%pF)\n",
-				(int)flags, irq, chip->set_type);
+		pr_err("setting trigger mode %lu for irq %u failed (%pF)\n",
+		       flags, irq, chip->irq_set_type);
 	else {
 		if (flags & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
 			flags |= IRQ_LEVEL;

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 14/19] genirq; Provide compat handling for chip->set_type()
  2010-09-27 12:45 ` [patch 14/19] genirq; Provide compat handling for chip->set_type() Thomas Gleixner
@ 2010-09-27 12:45   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-set-type.patch --]
[-- Type: text/plain, Size: 2925 bytes --]

Wrap the old chip function set_type() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/autoprobe.c |    5 +++--
 kernel/irq/chip.c      |    7 +++++++
 kernel/irq/manage.c    |   10 +++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)

Index: linux-2.6-tip/kernel/irq/autoprobe.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/autoprobe.c
+++ linux-2.6-tip/kernel/irq/autoprobe.c
@@ -57,8 +57,9 @@ unsigned long probe_irq_on(void)
 			 * Some chips need to know about probing in
 			 * progress:
 			 */
-			if (desc->chip->set_type)
-				desc->chip->set_type(i, IRQ_TYPE_PROBE);
+			if (desc->chip->irq_set_type)
+				desc->chip->irq_set_type(&desc->irq_data,
+							 IRQ_TYPE_PROBE);
 			desc->chip->irq_startup(&desc->irq_data);
 		}
 		raw_spin_unlock_irq(&desc->lock);
Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -379,6 +379,11 @@ static int compat_irq_set_affinity(struc
 	return irq_data_to_desc(data)->chip->set_affinity(data->irq, dest);
 }
 
+static int compat_irq_set_type(struct irq_data *data, unsigned int type)
+{
+	return irq_data_to_desc(data)->chip->set_type(data->irq, type);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -447,6 +452,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_eoi = compat_irq_eoi;
 	if (chip->set_affinity)
 		chip->irq_set_affinity = compat_irq_set_affinity;
+	if (chip->set_type)
+		chip->irq_set_type = compat_irq_set_type;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -429,12 +429,12 @@ void compat_irq_chip_set_default_handler
 }
 
 int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
-		unsigned long flags)
+		      unsigned long flags)
 {
 	int ret;
 	struct irq_chip *chip = desc->chip;
 
-	if (!chip || !chip->set_type) {
+	if (!chip || !chip->irq_set_type) {
 		/*
 		 * IRQF_TRIGGER_* but the PIC does not support multiple
 		 * flow-types?
@@ -445,11 +445,11 @@ int __irq_set_trigger(struct irq_desc *d
 	}
 
 	/* caller masked out all except trigger mode flags */
-	ret = chip->set_type(irq, flags);
+	ret = chip->irq_set_type(&desc->irq_data, flags);
 
 	if (ret)
-		pr_err("setting trigger mode %d for irq %u failed (%pF)\n",
-				(int)flags, irq, chip->set_type);
+		pr_err("setting trigger mode %lu for irq %u failed (%pF)\n",
+		       flags, irq, chip->irq_set_type);
 	else {
 		if (flags & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
 			flags |= IRQ_LEVEL;



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 15/19] genirq; Provide compat handling for chip->set_wake()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (13 preceding siblings ...)
  2010-09-27 12:45 ` [patch 14/19] genirq; Provide compat handling for chip->set_type() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45   ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 16/19] genirq; Provide compat handling for chip->retrigger() Thomas Gleixner
                   ` (3 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-set-wake.patch --]
[-- Type: text/plain, Size: 1657 bytes --]

Wrap the old chip function set_wake() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c   |    7 +++++++
 kernel/irq/manage.c |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -384,6 +384,11 @@ static int compat_irq_set_type(struct ir
 	return irq_data_to_desc(data)->chip->set_type(data->irq, type);
 }
 
+static int compat_irq_set_wake(struct irq_data *data, unsigned int on)
+{
+	return irq_data_to_desc(data)->chip->set_wake(data->irq, on);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -454,6 +459,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_set_affinity = compat_irq_set_affinity;
 	if (chip->set_type)
 		chip->irq_set_type = compat_irq_set_type;
+	if (chip->set_wake)
+		chip->irq_set_wake = compat_irq_set_wake;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -336,8 +336,8 @@ static int set_irq_wake_real(unsigned in
 	struct irq_desc *desc = irq_to_desc(irq);
 	int ret = -ENXIO;
 
-	if (desc->chip->set_wake)
-		ret = desc->chip->set_wake(irq, on);
+	if (desc->chip->irq_set_wake)
+		ret = desc->chip->irq_set_wake(&desc->irq_data, on);
 
 	return ret;
 }

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 15/19] genirq; Provide compat handling for chip->set_wake()
  2010-09-27 12:45 ` [patch 15/19] genirq; Provide compat handling for chip->set_wake() Thomas Gleixner
@ 2010-09-27 12:45   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-set-wake.patch --]
[-- Type: text/plain, Size: 1659 bytes --]

Wrap the old chip function set_wake() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c   |    7 +++++++
 kernel/irq/manage.c |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -384,6 +384,11 @@ static int compat_irq_set_type(struct ir
 	return irq_data_to_desc(data)->chip->set_type(data->irq, type);
 }
 
+static int compat_irq_set_wake(struct irq_data *data, unsigned int on)
+{
+	return irq_data_to_desc(data)->chip->set_wake(data->irq, on);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -454,6 +459,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_set_affinity = compat_irq_set_affinity;
 	if (chip->set_type)
 		chip->irq_set_type = compat_irq_set_type;
+	if (chip->set_wake)
+		chip->irq_set_wake = compat_irq_set_wake;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/manage.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/manage.c
+++ linux-2.6-tip/kernel/irq/manage.c
@@ -336,8 +336,8 @@ static int set_irq_wake_real(unsigned in
 	struct irq_desc *desc = irq_to_desc(irq);
 	int ret = -ENXIO;
 
-	if (desc->chip->set_wake)
-		ret = desc->chip->set_wake(irq, on);
+	if (desc->chip->irq_set_wake)
+		ret = desc->chip->irq_set_wake(&desc->irq_data, on);
 
 	return ret;
 }



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 16/19] genirq; Provide compat handling for chip->retrigger()
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (14 preceding siblings ...)
  2010-09-27 12:45 ` [patch 15/19] genirq; Provide compat handling for chip->set_wake() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45   ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 17/19] genirq: Switch dummy_chip and no_irq_chip to new functions Thomas Gleixner
                   ` (2 subsequent siblings)
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-retrigger.patch --]
[-- Type: text/plain, Size: 1790 bytes --]

Wrap the old chip function retrigger() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c   |    7 +++++++
 kernel/irq/resend.c |    3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -389,6 +389,11 @@ static int compat_irq_set_wake(struct ir
 	return irq_data_to_desc(data)->chip->set_wake(data->irq, on);
 }
 
+static int compat_irq_retrigger(struct irq_data *data)
+{
+	return irq_data_to_desc(data)->chip->retrigger(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -461,6 +466,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_set_type = compat_irq_set_type;
 	if (chip->set_wake)
 		chip->irq_set_wake = compat_irq_set_wake;
+	if (chip->retrigger)
+		chip->irq_retrigger = compat_irq_retrigger;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/resend.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/resend.c
+++ linux-2.6-tip/kernel/irq/resend.c
@@ -70,7 +70,8 @@ void check_irq_resend(struct irq_desc *d
 	if ((status & (IRQ_LEVEL | IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
 		desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY;
 
-		if (!desc->chip->retrigger || !desc->chip->retrigger(irq)) {
+		if (!desc->chip->irq_retrigger ||
+		    !desc->chip->irq_retrigger(&desc->irq_data)) {
 #ifdef CONFIG_HARDIRQS_SW_RESEND
 			/* Set it pending and activate the softirq: */
 			set_bit(irq, irqs_resend);

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 16/19] genirq; Provide compat handling for chip->retrigger()
  2010-09-27 12:45 ` [patch 16/19] genirq; Provide compat handling for chip->retrigger() Thomas Gleixner
@ 2010-09-27 12:45   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-wrap-chip-retrigger.patch --]
[-- Type: text/plain, Size: 1792 bytes --]

Wrap the old chip function retrigger() until the migration is complete
and the old chip functions are removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/chip.c   |    7 +++++++
 kernel/irq/resend.c |    3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

Index: linux-2.6-tip/kernel/irq/chip.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/chip.c
+++ linux-2.6-tip/kernel/irq/chip.c
@@ -389,6 +389,11 @@ static int compat_irq_set_wake(struct ir
 	return irq_data_to_desc(data)->chip->set_wake(data->irq, on);
 }
 
+static int compat_irq_retrigger(struct irq_data *data)
+{
+	return irq_data_to_desc(data)->chip->retrigger(data->irq);
+}
+
 static void compat_bus_lock(struct irq_data *data)
 {
 	irq_data_to_desc(data)->chip->bus_lock(data->irq);
@@ -461,6 +466,8 @@ void irq_chip_set_defaults(struct irq_ch
 		chip->irq_set_type = compat_irq_set_type;
 	if (chip->set_wake)
 		chip->irq_set_wake = compat_irq_set_wake;
+	if (chip->retrigger)
+		chip->irq_retrigger = compat_irq_retrigger;
 }
 
 static inline void mask_ack_irq(struct irq_desc *desc)
Index: linux-2.6-tip/kernel/irq/resend.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/resend.c
+++ linux-2.6-tip/kernel/irq/resend.c
@@ -70,7 +70,8 @@ void check_irq_resend(struct irq_desc *d
 	if ((status & (IRQ_LEVEL | IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
 		desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY;
 
-		if (!desc->chip->retrigger || !desc->chip->retrigger(irq)) {
+		if (!desc->chip->irq_retrigger ||
+		    !desc->chip->irq_retrigger(&desc->irq_data)) {
 #ifdef CONFIG_HARDIRQS_SW_RESEND
 			/* Set it pending and activate the softirq: */
 			set_bit(irq, irqs_resend);



^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 17/19] genirq: Switch dummy_chip and no_irq_chip to new functions
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (15 preceding siblings ...)
  2010-09-27 12:45 ` [patch 16/19] genirq; Provide compat handling for chip->retrigger() Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 12:45 ` [patch 18/19] genirq: Provide Kconfig Thomas Gleixner
  2010-09-27 12:46 ` [patch 19/19] x86: Use genirq Kconfig Thomas Gleixner
  18 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-fixup-dummy-chip.patch --]
[-- Type: text/plain, Size: 1964 bytes --]


Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/handle.c |   44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

Index: linux-2.6-tip/kernel/irq/handle.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/handle.c
+++ linux-2.6-tip/kernel/irq/handle.c
@@ -303,37 +303,41 @@ void clear_kstat_irqs(struct irq_desc *d
  * What should we do if we get a hw irq event on an illegal vector?
  * Each architecture has to answer this themself.
  */
-static void ack_bad(unsigned int irq)
+static void ack_bad(struct irq_data *data)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
+	struct irq_desc *desc = irq_data_to_desc(data);
 
-	print_irq_desc(irq, desc);
-	ack_bad_irq(irq);
+	print_irq_desc(data->irq, desc);
+	ack_bad_irq(data->irq);
 }
 
 /*
  * NOP functions
  */
-static void noop(unsigned int irq)
+static void noop(struct irq_data *data)
 {
 }
 
-static unsigned int noop_ret(unsigned int irq)
+static unsigned int noop_ret(struct irq_data *data)
 {
 	return 0;
 }
 
+static void compat_noop(unsigned int irq)
+{
+}
+
 /*
  * Generic no controller implementation
  */
 struct irq_chip no_irq_chip = {
 	.name		= "none",
-	.startup	= noop_ret,
-	.shutdown	= noop,
-	.enable		= noop,
-	.disable	= noop,
-	.ack		= ack_bad,
-	.end		= noop,
+	.irq_startup	= noop_ret,
+	.irq_shutdown	= noop,
+	.irq_enable	= noop,
+	.irq_disable	= noop,
+	.irq_ack	= ack_bad,
+	.end		= compat_noop,
 };
 
 /*
@@ -342,14 +346,14 @@ struct irq_chip no_irq_chip = {
  */
 struct irq_chip dummy_irq_chip = {
 	.name		= "dummy",
-	.startup	= noop_ret,
-	.shutdown	= noop,
-	.enable		= noop,
-	.disable	= noop,
-	.ack		= noop,
-	.mask		= noop,
-	.unmask		= noop,
-	.end		= noop,
+	.irq_startup	= noop_ret,
+	.irq_shutdown	= noop,
+	.irq_enable	= noop,
+	.irq_disable	= noop,
+	.irq_ack	= noop,
+	.irq_mask	= noop,
+	.irq_unmask	= noop,
+	.end		= compat_noop,
 };
 
 /*

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 18/19] genirq: Provide Kconfig
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (16 preceding siblings ...)
  2010-09-27 12:45 ` [patch 17/19] genirq: Switch dummy_chip and no_irq_chip to new functions Thomas Gleixner
@ 2010-09-27 12:45 ` Thomas Gleixner
  2010-09-27 16:43   ` Randy Dunlap
  2010-09-27 12:46 ` [patch 19/19] x86: Use genirq Kconfig Thomas Gleixner
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: genirq-provide-kconfig.patch --]
[-- Type: text/plain, Size: 1524 bytes --]

The generic irq Kconfig options are copied around all archs. Provide a
generic Kconfig file which can be included.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/irq/Kconfig |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

Index: linux-2.6-tip/kernel/irq/Kconfig
===================================================================
--- /dev/null
+++ linux-2.6-tip/kernel/irq/Kconfig
@@ -0,0 +1,49 @@
+#
+# Interrupt subsystem related configuration options
+#
+
+menu "Interrupt handling subsystem"
+
+config GENERIC_HARDIRQS
+	def_bool y
+
+config GENERIC_HARDIRQS_NO__DO_IRQ
+       def_bool y
+
+# Options selectable by the architecture code
+config HAVE_SPARSE_IRQ
+       def_bool n
+
+config GENERIC_IRQ_PROBE
+	def_bool n
+
+config GENERIC_PENDING_IRQ
+	def_bool n
+
+if SPARSE_IRQ && NUMA
+config NUMA_IRQ_DESC
+	def_bool n
+endif
+
+config AUTO_IRQ_AFFINITY
+       def_bool n
+
+config IRQ_PER_CPU
+       def_bool n
+
+config HARDIRQS_SW_RESEND
+       def_bool n
+
+config SPARSE_IRQ
+	bool "Support sparse irq numbering"
+	depends on HAVE_SPARSE_IRQ
+	---help---
+	  This enables support for sparse irqs. This is useful for distro
+	  kernels that want to define a high CONFIG_NR_CPUS value but still
+	  want to have low kernel memory footprint on smaller machines.
+
+	  ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
+	    out the irq_desc[] array in a more NUMA-friendly way. )
+
+	  If you don't know what to do here, say N.
+

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 19/19] x86: Use genirq Kconfig
  2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
                   ` (17 preceding siblings ...)
  2010-09-27 12:45 ` [patch 18/19] genirq: Provide Kconfig Thomas Gleixner
@ 2010-09-27 12:46 ` Thomas Gleixner
  2010-09-27 12:46   ` Thomas Gleixner
  18 siblings, 1 reply; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:46 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: x86-use-genirq-kconfig.patch --]
[-- Type: text/plain, Size: 1835 bytes --]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/Kconfig |   35 +++++------------------------------
 1 file changed, 5 insertions(+), 30 deletions(-)

Index: linux-2.6-tip/arch/x86/Kconfig
===================================================================
--- linux-2.6-tip.orig/arch/x86/Kconfig
+++ linux-2.6-tip/arch/x86/Kconfig
@@ -59,6 +59,10 @@ config X86
 	select ANON_INODES
 	select HAVE_ARCH_KMEMCHECK
 	select HAVE_USER_RETURN_NOTIFIER
+	select HAVE_SPARSE_IRQ
+	select NUMA_IRQ_DESC if (SPARSE_IRQ && NUMA)
+	select GENERIC_IRQ_PROBE
+	select GENERIC_PENDING_IRQ if SMP
 
 config INSTRUCTION_DECODER
 	def_bool (KPROBES || PERF_EVENTS)
@@ -200,20 +204,6 @@ config HAVE_INTEL_TXT
 	def_bool y
 	depends on EXPERIMENTAL && DMAR && ACPI
 
-# Use the generic interrupt handling code in kernel/irq/:
-config GENERIC_HARDIRQS
-	def_bool y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
-config GENERIC_IRQ_PROBE
-	def_bool y
-
-config GENERIC_PENDING_IRQ
-	def_bool y
-	depends on GENERIC_HARDIRQS && SMP
-
 config USE_GENERIC_SMP_HELPERS
 	def_bool y
 	depends on SMP
@@ -296,22 +286,7 @@ config X86_X2APIC
 
 	  If you don't know what to do here, say N.
 
-config SPARSE_IRQ
-	bool "Support sparse irq numbering"
-	depends on PCI_MSI || HT_IRQ
-	---help---
-	  This enables support for sparse irqs. This is useful for distro
-	  kernels that want to define a high CONFIG_NR_CPUS value but still
-	  want to have low kernel memory footprint on smaller machines.
-
-	  ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
-	    out the irq_desc[] array in a more NUMA-friendly way. )
-
-	  If you don't know what to do here, say N.
-
-config NUMA_IRQ_DESC
-	def_bool y
-	depends on SPARSE_IRQ && NUMA
+source "kernel/irq/Kconfig"
 
 config X86_MPPARSE
 	bool "Enable MPS table" if ACPI

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [patch 19/19] x86: Use genirq Kconfig
  2010-09-27 12:46 ` [patch 19/19] x86: Use genirq Kconfig Thomas Gleixner
@ 2010-09-27 12:46   ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:46 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: x86-use-genirq-kconfig.patch --]
[-- Type: text/plain, Size: 1837 bytes --]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/Kconfig |   35 +++++------------------------------
 1 file changed, 5 insertions(+), 30 deletions(-)

Index: linux-2.6-tip/arch/x86/Kconfig
===================================================================
--- linux-2.6-tip.orig/arch/x86/Kconfig
+++ linux-2.6-tip/arch/x86/Kconfig
@@ -59,6 +59,10 @@ config X86
 	select ANON_INODES
 	select HAVE_ARCH_KMEMCHECK
 	select HAVE_USER_RETURN_NOTIFIER
+	select HAVE_SPARSE_IRQ
+	select NUMA_IRQ_DESC if (SPARSE_IRQ && NUMA)
+	select GENERIC_IRQ_PROBE
+	select GENERIC_PENDING_IRQ if SMP
 
 config INSTRUCTION_DECODER
 	def_bool (KPROBES || PERF_EVENTS)
@@ -200,20 +204,6 @@ config HAVE_INTEL_TXT
 	def_bool y
 	depends on EXPERIMENTAL && DMAR && ACPI
 
-# Use the generic interrupt handling code in kernel/irq/:
-config GENERIC_HARDIRQS
-	def_bool y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
-config GENERIC_IRQ_PROBE
-	def_bool y
-
-config GENERIC_PENDING_IRQ
-	def_bool y
-	depends on GENERIC_HARDIRQS && SMP
-
 config USE_GENERIC_SMP_HELPERS
 	def_bool y
 	depends on SMP
@@ -296,22 +286,7 @@ config X86_X2APIC
 
 	  If you don't know what to do here, say N.
 
-config SPARSE_IRQ
-	bool "Support sparse irq numbering"
-	depends on PCI_MSI || HT_IRQ
-	---help---
-	  This enables support for sparse irqs. This is useful for distro
-	  kernels that want to define a high CONFIG_NR_CPUS value but still
-	  want to have low kernel memory footprint on smaller machines.
-
-	  ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
-	    out the irq_desc[] array in a more NUMA-friendly way. )
-
-	  If you don't know what to do here, say N.
-
-config NUMA_IRQ_DESC
-	def_bool y
-	depends on SPARSE_IRQ && NUMA
+source "kernel/irq/Kconfig"
 
 config X86_MPPARSE
 	bool "Enable MPS table" if ACPI



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [patch 08/19] genirq; Provide compat handling for chip->mask_ack()
  2010-09-27 12:44 ` [patch 08/19] genirq; Provide compat handling for chip->mask_ack() Thomas Gleixner
  2010-09-27 12:44   ` Thomas Gleixner
@ 2010-09-27 15:10   ` Geert Uytterhoeven
  2010-09-27 15:16     ` Thomas Gleixner
  1 sibling, 1 reply; 34+ messages in thread
From: Geert Uytterhoeven @ 2010-09-27 15:10 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

On Mon, Sep 27, 2010 at 14:44, Thomas Gleixner <tglx@linutronix.de> wrote:
> Wrap the old chip function mask_ack() until the migration is complete
> and the old chip functions are removed.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  kernel/irq/chip.c      |   20 ++++++++++++++++++--
>  kernel/irq/internals.h |   17 +++++++++++------
>  kernel/irq/manage.c    |   22 +++++++++++-----------
>  3 files changed, 40 insertions(+), 19 deletions(-)

3 files

> Index: linux-2.6-tip/kernel/irq/chip.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/irq/chip.c
> +++ linux-2.6-tip/kernel/irq/chip.c

Only 1 file?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [patch 08/19] genirq; Provide compat handling for chip->mask_ack()
  2010-09-27 15:10   ` Geert Uytterhoeven
@ 2010-09-27 15:16     ` Thomas Gleixner
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas Gleixner @ 2010-09-27 15:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: LKML, Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

[-- Attachment #1: Type: TEXT/PLAIN, Size: 846 bytes --]

On Mon, 27 Sep 2010, Geert Uytterhoeven wrote:

> On Mon, Sep 27, 2010 at 14:44, Thomas Gleixner <tglx@linutronix.de> wrote:
> > Wrap the old chip function mask_ack() until the migration is complete
> > and the old chip functions are removed.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > ---
> >  kernel/irq/chip.c      |   20 ++++++++++++++++++--
> >  kernel/irq/internals.h |   17 +++++++++++------
> >  kernel/irq/manage.c    |   22 +++++++++++-----------
> >  3 files changed, 40 insertions(+), 19 deletions(-)
> 
> 3 files
> 
> > Index: linux-2.6-tip/kernel/irq/chip.c
> > ===================================================================
> > --- linux-2.6-tip.orig/kernel/irq/chip.c
> > +++ linux-2.6-tip/kernel/irq/chip.c
> 
> Only 1 file?

Yes, seems I forgot to refresh the patch stats, grmbl.

     tglx

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [patch 18/19] genirq: Provide Kconfig
  2010-09-27 12:45 ` [patch 18/19] genirq: Provide Kconfig Thomas Gleixner
@ 2010-09-27 16:43   ` Randy Dunlap
  0 siblings, 0 replies; 34+ messages in thread
From: Randy Dunlap @ 2010-09-27 16:43 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra

On Mon, 27 Sep 2010 12:45:59 -0000 Thomas Gleixner wrote:

> The generic irq Kconfig options are copied around all archs. Provide a
> generic Kconfig file which can be included.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  kernel/irq/Kconfig |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
> 
> Index: linux-2.6-tip/kernel/irq/Kconfig
> ===================================================================
> --- /dev/null
> +++ linux-2.6-tip/kernel/irq/Kconfig
> @@ -0,0 +1,49 @@
> +#
> +# Interrupt subsystem related configuration options
> +#
> +
> +menu "Interrupt handling subsystem"
> +
> +config GENERIC_HARDIRQS
> +	def_bool y
> +
> +config GENERIC_HARDIRQS_NO__DO_IRQ
> +       def_bool y
> +
> +# Options selectable by the architecture code
> +config HAVE_SPARSE_IRQ
> +       def_bool n
> +
> +config GENERIC_IRQ_PROBE
> +	def_bool n
> +
> +config GENERIC_PENDING_IRQ
> +	def_bool n
> +
> +if SPARSE_IRQ && NUMA
> +config NUMA_IRQ_DESC
> +	def_bool n
> +endif
> +
> +config AUTO_IRQ_AFFINITY
> +       def_bool n
> +
> +config IRQ_PER_CPU
> +       def_bool n
> +
> +config HARDIRQS_SW_RESEND
> +       def_bool n
> +
> +config SPARSE_IRQ
> +	bool "Support sparse irq numbering"
> +	depends on HAVE_SPARSE_IRQ
> +	---help---
> +	  This enables support for sparse irqs. This is useful for distro
> +	  kernels that want to define a high CONFIG_NR_CPUS value but still
> +	  want to have low kernel memory footprint on smaller machines.
> +

I see that this is just moved from another location, but it would be good if
the "irq"s above could be like the one below (IRQ or IRQs).

> +	  ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
> +	    out the irq_desc[] array in a more NUMA-friendly way. )
> +
> +	  If you don't know what to do here, say N.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2010-09-27 16:44 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
2010-09-27 12:44 ` [patch 01/19] genirq: Cleanup access to irq_data Thomas Gleixner
2010-09-27 12:44 ` [patch 02/19] genirq: Create irq_data Thomas Gleixner
2010-09-27 12:44   ` Thomas Gleixner
2010-09-27 12:44 ` [patch 03/19] genirq: Provide advanced irq chip functions Thomas Gleixner
2010-09-27 12:44   ` Thomas Gleixner
2010-09-27 12:44 ` [patch 04/19] genirq; Provide compat handling for bus_lock/bus_sync_unlock Thomas Gleixner
2010-09-27 12:44 ` [patch 05/19] genirq; Provide compat handling for chip->mask() Thomas Gleixner
2010-09-27 12:44 ` [patch 06/19] genirq; Provide compat handling for chip->unmask() Thomas Gleixner
2010-09-27 12:44 ` [patch 07/19] genirq; Provide compat handling for chip->ack() Thomas Gleixner
2010-09-27 12:44   ` Thomas Gleixner
2010-09-27 12:44 ` [patch 08/19] genirq; Provide compat handling for chip->mask_ack() Thomas Gleixner
2010-09-27 12:44   ` Thomas Gleixner
2010-09-27 15:10   ` Geert Uytterhoeven
2010-09-27 15:16     ` Thomas Gleixner
2010-09-27 12:44 ` [patch 09/19] genirq; Provide compat handling for chip->eoi() Thomas Gleixner
2010-09-27 12:44   ` Thomas Gleixner
2010-09-27 12:44 ` [patch 10/19] genirq; Provide compat handling for chip->enable() Thomas Gleixner
2010-09-27 12:45 ` [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown() Thomas Gleixner
2010-09-27 12:45   ` Thomas Gleixner
2010-09-27 12:45 ` [patch 12/19] genirq; Provide compat handling for chip->startup() Thomas Gleixner
2010-09-27 12:45 ` [patch 13/19] genirq; Provide compat handling for chip->set_affinity() Thomas Gleixner
2010-09-27 12:45   ` Thomas Gleixner
2010-09-27 12:45 ` [patch 14/19] genirq; Provide compat handling for chip->set_type() Thomas Gleixner
2010-09-27 12:45   ` Thomas Gleixner
2010-09-27 12:45 ` [patch 15/19] genirq; Provide compat handling for chip->set_wake() Thomas Gleixner
2010-09-27 12:45   ` Thomas Gleixner
2010-09-27 12:45 ` [patch 16/19] genirq; Provide compat handling for chip->retrigger() Thomas Gleixner
2010-09-27 12:45   ` Thomas Gleixner
2010-09-27 12:45 ` [patch 17/19] genirq: Switch dummy_chip and no_irq_chip to new functions Thomas Gleixner
2010-09-27 12:45 ` [patch 18/19] genirq: Provide Kconfig Thomas Gleixner
2010-09-27 16:43   ` Randy Dunlap
2010-09-27 12:46 ` [patch 19/19] x86: Use genirq Kconfig Thomas Gleixner
2010-09-27 12:46   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox