Skip to contentSkip to conversation

Sparse irq cleanup - Resend

PATCH In review Thomas Gleixner 2 participants 4 messages Jan 21, 2011 – Jan 22, 2011 PowerPC

lore
Share & tools
lore
#0 lore raw

cover Sparse irq cleanup - Resend

The following series cleans up the left overs of the old sparse irq code.

Thanks,

tglx

#1 lore raw

PATCH 1/2 powerpc: Use ARCH_IRQ_INIT_FLAGS

Define the ARCH_IRQ_INIT_FLAGS instead of fixing it up in a loop.

---
 arch/powerpc/include/asm/hw_irq.h |    2 ++
 arch/powerpc/kernel/irq.c         |   15 ---------------
 2 files changed, 2 insertions(+), 15 deletions(-)
arch/powerpc/include/asm/hw_irq.h +2 -0
Index: linux-2.6-tip/arch/powerpc/include/asm/hw_irq.h
===================================================================
@@ -141,6 +141,8 @@ static inline bool arch_irqs_disabled(vo
 
 #endif /* CONFIG_PPC64 */
 
+#define ARCH_IRQ_INIT_FLAGS	IRQ_NOREQUEST
+
 /*
  * interrupt-retrigger: should we handle this via lost interrupts and IPIs
  * or should we not care like we do now ? --BenH.
arch/powerpc/kernel/irq.c +0 -15
Index: linux-2.6-tip/arch/powerpc/kernel/irq.c
===================================================================
@@ -1074,21 +1074,6 @@ void irq_free_virt(unsigned int virq, un
 
 int arch_early_irq_init(void)
 {
-	struct irq_desc *desc;
-	int i;
-
-	for (i = 0; i < NR_IRQS; i++) {
-		desc = irq_to_desc(i);
-		if (desc)
-			desc->status |= IRQ_NOREQUEST;
-	}
-
-	return 0;
-}
-
-int arch_init_chip_data(struct irq_desc *desc, int node)
-{
-	desc->status |= IRQ_NOREQUEST;
 	return 0;
 }
 
#2 lore raw

PATCH 2/2 powerpc: Use new irq allocator

In reply to Thomas Gleixner

Use the new functions and free the descriptor when the virq is destroyed.

---
 arch/powerpc/kernel/irq.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
arch/powerpc/kernel/irq.c +9 -8
Index: linux-2.6-tip/arch/powerpc/kernel/irq.c
===================================================================
@@ -678,16 +678,15 @@ void irq_set_virq_count(unsigned int cou
 static int irq_setup_virq(struct irq_host *host, unsigned int virq,
 			    irq_hw_number_t hwirq)
 {
-	struct irq_desc *desc;
+	int res;
 
-	desc = irq_to_desc_alloc_node(virq, 0);
-	if (!desc) {
+	res = irq_alloc_desc_at(virq, 0);
+	if (res != virq) {
 		pr_debug("irq: -> allocating desc failed\n");
 		goto error;
 	}
 
-	/* Clear IRQ_NOREQUEST flag */
-	desc->status &= ~IRQ_NOREQUEST;
+	irq_clear_status_flags(virq, IRQ_NOREQUEST);
 
 	/* map it */
 	smp_wmb();
@@ -696,11 +695,13 @@ static int irq_setup_virq(struct irq_hos
 
 	if (host->ops->map(host, virq, hwirq)) {
 		pr_debug("irq: -> mapping failed, freeing\n");
-		goto error;
+		goto errdesc;
 	}
 
 	return 0;
 
+errdesc:
+	irq_free_descs(virq, 1);
 error:
 	irq_free_virt(virq, 1);
 	return -1;
@@ -879,9 +880,9 @@ void irq_dispose_mapping(unsigned int vi
 	smp_mb();
 	irq_map[virq].hwirq = host->inval_irq;
 
-	/* Set some flags */
-	irq_to_desc(virq)->status |= IRQ_NOREQUEST;
+	irq_set_status_flags(virq, IRQ_NOREQUEST);
 
+	irq_free_descs(virq, 1);
 	/* Free it */
 	irq_free_virt(virq, 1);
 }
#3 lore raw
In reply to Thomas Gleixner
Quoted 2 lines · Thomas Gleixner

The following series cleans up the left overs of the old sparse irq code.

For some odd reason I forgot to put that in the last time around. I'll try to remember to do so on monday before I go to LCA.

Cheers,
Ben.