Sparse irq cleanup - Resend
cover Sparse irq cleanup - Resend
The following series cleans up the left overs of the old sparse irq code.
Thanks,
tglx
PATCH 1/2 powerpc: Use ARCH_IRQ_INIT_FLAGS
Define the ARCH_IRQ_INIT_FLAGS instead of fixing it up in a loop.
Signed-off-by Thomas Gleixner <[email protected]>
--- 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
@@ -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
@@ -1074,21 +1074,6 @@ void irq_free_virt(unsigned int virq, unint 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 ; }
PATCH 2/2 powerpc: Use new irq allocator
In reply to Thomas GleixnerUse the new functions and free the descriptor when the virq is destroyed.
Signed-off-by Thomas Gleixner <[email protected]>
--- arch/powerpc/kernel/irq.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
arch/powerpc/kernel/irq.c +9 -8
@@ -678,16 +678,15 @@ void irq_set_virq_count(unsigned int coustatic 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_hosif (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 vismp_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 ); }
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.