cris: kill __do_IRQ
cover cris: kill __do_IRQ
Hi,
The following patches remove the cris architectures calls to __do_IRQ. They've been build tested on -v10 and -v32, but not boot tested. It should be possible to bisect across the changes for both platforms.
arch/cris/Kconfig | 3 ++ arch/cris/arch-v10/kernel/irq.c | 26 +++------------- arch/cris/arch-v32/kernel/irq.c | 53 +++++++++------------------------ arch/cris/include/arch-v32/arch/irq.h | 4 +- arch/cris/kernel/irq.c | 2 +- 5 files changed, 25 insertions(+), 63 deletions(-)
regards, Kyle M.
PATCH 1/4 cris: use set_irq_chip helpers
But just call __do_IRQ for ->handle_irq for now.
--- arch/cris/arch-v10/kernel/irq.c | 2 +- arch/cris/arch-v32/kernel/irq.c | 2 +- arch/cris/include/asm/irq.h | 3 +++ arch/cris/kernel/irq.c | 6 +++++- 4 files changed, 10 insertions(+), 3 deletions(-)
arch/cris/arch-v10/kernel/irq.c +1 -1
@@ -221,7 +221,7 @@ init_IRQ(void)/* Initialize IRQ handler descriptors. */ for (i =2 ; i <NR_IRQS ; i++) { - irq_desc[i].chip = &crisv10_irq_type; +set_irq_chip_and_handler (i, &crisv10_irq_type, cris_do_IRQ);set_int_vector (i, interrupt[i]); }
arch/cris/arch-v32/kernel/irq.c +1 -1
@@ -472,7 +472,7 @@ init_IRQ(void)/* Point all IRQ's to bad handlers. */ for (i =FIRST_IRQ , j =0 ; j <NR_IRQS ; i++, j++) { - irq_desc[j].chip = &crisv32_irq_type; +set_irq_chip_and_handler (j, &crisv32_irq_type, cris_do_IRQ);set_exception_vector (i, interrupt[j]); }
arch/cris/include/asm/irq.h +3 -0
@@ -8,6 +8,9 @@ static inline int irq_canonicalize(int irq) return irq; } +struct irq_desc ; +extern void cris_do_IRQ (unsigned int irq,struct irq_desc *desc); +#endif /* _ASM_IRQ_H */
arch/cris/kernel/irq.c +5 -1
@@ -93,7 +93,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)printk ("do_IRQ: stack overflow: %lX\n" , sp);show_stack (NULL , (unsigned long *)sp); } -__do_IRQ (irq); +generic_handle_irq (irq);irq_exit ();set_irq_regs (old_regs); }
@@ -105,3 +105,7 @@ void weird_irq(void)while (1 ); } +void cris_do_IRQ (unsigned int irq,struct irq_desc *desc) +{ +__do_IRQ (irq); +}
Signature · 1 line
1.7.3.1
PATCH 2/4 cris: convert arch-v10 away from __do_IRQ
In reply to Kyle McMartinLooks like handle_simple_irq will be fine here, since the do_IRQ code is masking the interrupts for us.
Also remove a pile of unneeded handlers where the defaults filled in by the genirq layer will do.
--- arch/cris/arch-v10/kernel/irq.c | 26 +++++--------------------- 1 files changed, 5 insertions(+), 21 deletions(-)
arch/cris/arch-v10/kernel/irq.c +5 -21
@@ -104,16 +104,6 @@ static void (*interrupt[NR_IRQS])(void) = { IRQ31_interrupt }; -static void enable_crisv10_irq (unsigned int irq); - -static unsigned int startup_crisv10_irq (unsigned int irq) -{ -enable_crisv10_irq (irq); -return 0 ; -} - -#define shutdown_crisv10_irq disable_crisv10_irq -static void enable_crisv10_irq (unsigned int irq) {crisv10_unmask_irq (irq);
@@ -124,22 +114,16 @@ static void disable_crisv10_irq(unsigned int irq)crisv10_mask_irq (irq); } -static void ack_crisv10_irq (unsigned int irq) -{ -} - -static void end_crisv10_irq (unsigned int irq) +static void crisv10_noop (unsigned int irq) { }static struct irq_chip crisv10_irq_type = { .name ="CRISv10" , - .startup = startup_crisv10_irq, - .shutdown = shutdown_crisv10_irq, - .enable = enable_crisv10_irq, + .unmask = enable_crisv10_irq, + .mask = disable_crisv10_irq, .disable = disable_crisv10_irq, - .ack = ack_crisv10_irq, - .end = end_crisv10_irq, + .ack = crisv10_noop, .set_affinity =NULL };
@@ -221,7 +205,7 @@ init_IRQ(void)/* Initialize IRQ handler descriptors. */ for (i =2 ; i <NR_IRQS ; i++) { -set_irq_chip_and_handler (i, &crisv10_irq_type, cris_do_IRQ); +set_irq_chip_and_handler (i, &crisv10_irq_type, handle_simple_irq);set_int_vector (i, interrupt[i]); }
Signature · 1 line
1.7.3.1
PATCH 3/4 cris: convert arch-v32 away from __do_IRQ
In reply to Kyle McMartinAgain, since the caller of do_IRQ and crisv32_do_multiple are masking and unmasking the relevant interrupts for us, it looks like handle_simple_irq is appropriate here as well.
Also, remove a pile of unneeded handlers since the defaults will be fine (or because they're tested for NULL already.)
--- arch/cris/arch-v32/kernel/irq.c | 53 +++++++++------------------------ arch/cris/include/arch-v32/arch/irq.h | 4 +- 2 files changed, 16 insertions(+), 41 deletions(-)
arch/cris/arch-v32/kernel/irq.c +14 -39
@@ -277,7 +277,7 @@ out:return cpu; } -void crisv32_mask_irq (int irq) +void crisv32_mask_irq (unsigned int irq) {int cpu;
@@ -285,41 +285,11 @@ void crisv32_mask_irq(int irq)block_irq (irq, cpu); } -void crisv32_unmask_irq (int irq) +void crisv32_unmask_irq (unsigned int irq) {unblock_irq (irq,irq_cpu (irq)); } - -static unsigned int startup_crisv32_irq (unsigned int irq) -{ -crisv32_unmask_irq (irq); -return 0 ; -} - -static void shutdown_crisv32_irq (unsigned int irq) -{ -crisv32_mask_irq (irq); -} - -static void enable_crisv32_irq (unsigned int irq) -{ -crisv32_unmask_irq (irq); -} - -static void disable_crisv32_irq (unsigned int irq) -{ -crisv32_mask_irq (irq); -} - -static void ack_crisv32_irq (unsigned int irq) -{ -} - -static void end_crisv32_irq (unsigned int irq) -{ -} -int set_affinity_crisv32_irq (unsigned int irq,const struct cpumask *dest) {unsigned long flags;
@@ -330,14 +300,16 @@ int set_affinity_crisv32_irq(unsigned int irq, const struct cpumask *dest)return 0 ; } +static void crisv32_noop (unsigned int irq) +{ +} +static struct irq_chip crisv32_irq_type = { .name ="CRISv32" , - .startup = startup_crisv32_irq, - .shutdown = shutdown_crisv32_irq, - .enable = enable_crisv32_irq, - .disable = disable_crisv32_irq, - .ack = ack_crisv32_irq, - .end = end_crisv32_irq, + .mask = crisv32_mask_irq, + .disable = crisv32_mask_irq, + .unmask = crisv32_unmask_irq, + .ack = crisv32_noop, .set_affinity = set_affinity_crisv32_irq };
@@ -472,15 +444,18 @@ init_IRQ(void)/* Point all IRQ's to bad handlers. */ for (i =FIRST_IRQ , j =0 ; j <NR_IRQS ; i++, j++) { -set_irq_chip_and_handler (j, &crisv32_irq_type, cris_do_IRQ); +set_irq_chip_and_handler (j, &crisv32_irq_type, + handle_simple_irq);set_exception_vector (i, interrupt[j]); }/* Mark Timer and IPI IRQs as CPU local */ irq_allocations[TIMER0_INTR_VECT -FIRST_IRQ ].cpu =CPU_FIXED ; irq_desc[TIMER0_INTR_VECT ].status |=IRQ_PER_CPU ; +set_irq_handler (TIMER0_INTR_VECT , handle_percpu_irq); irq_allocations[IPI_INTR_VECT -FIRST_IRQ ].cpu =CPU_FIXED ; irq_desc[IPI_INTR_VECT ].status |=IRQ_PER_CPU ; +set_irq_handler (IPI_INTR_VECT , handle_percpu_irq);set_exception_vector (0x00 , nmi_interrupt);set_exception_vector (0x30 , multiple_interrupt);
arch/cris/include/arch-v32/arch/irq.h +2 -2
@@ -23,8 +23,8 @@ struct etrax_interrupt_vector {extern struct etrax_interrupt_vector *etrax_irv;/* head.S */ -void crisv32_mask_irq (int irq); -void crisv32_unmask_irq (int irq); +void crisv32_mask_irq (unsigned int irq); +void crisv32_unmask_irq (unsigned int irq);void set_exception_vector (int n,irqvectptr addr);
Signature · 1 line
1.7.3.1
PATCH 4/4 cris: turn on GENERIC_HARDIRQS_NO__DO_IRQ
In reply to Kyle McMartinSince we no longer require __do_IRQ.
--- arch/cris/Kconfig | 3 +++ arch/cris/include/asm/irq.h | 3 --- arch/cris/kernel/irq.c | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-)
arch/cris/Kconfig +3 -0
@@ -78,6 +78,9 @@ config GENERIC_HARDIRQS bool default y +config GENERIC_HARDIRQS_NO__DO_IRQ + def_bool y + config ETRAX_CMDLINE string "Kernel command line" default "root=/dev/mtdblock3"
arch/cris/include/asm/irq.h +0 -3
@@ -8,9 +8,6 @@ static inline int irq_canonicalize(int irq) return irq; } -struct irq_desc ; -extern void cris_do_IRQ (unsigned int irq,struct irq_desc *desc); -#endif /* _ASM_IRQ_H */
arch/cris/kernel/irq.c +0 -4
@@ -105,7 +105,3 @@ void weird_irq(void)while (1 ); } -void cris_do_IRQ (unsigned int irq,struct irq_desc *desc) -{ -__do_IRQ (irq); -}
Signature · 1 line
1.7.3.1
Great! These patches were expected and we would have done it ourselves someday soon but it is always great to get help from others, Thanks for caring about CRIS!
We will test these patches as soon as possible
Regards
/Mikael
-----Original Message-----
From: Kyle McMartin [mailto:[email protected]] On Behalf Of Kyle McMartin
Sent: den 15 oktober 2010 06:01
To: [email protected]
Cc: Mikael Starvik; Jesper Nilsson; linux-cris-kernel; [email protected]
Subject: [PATCH 0/4] cris: kill __do_IRQ
Hi,
The following patches remove the cris architectures calls to __do_IRQ. They've been build tested on -v10 and -v32, but not boot tested. It should be possible to bisect across the changes for both platforms.
arch/cris/Kconfig | 3 ++ arch/cris/arch-v10/kernel/irq.c | 26 +++------------- arch/cris/arch-v32/kernel/irq.c | 53 +++++++++------------------------ arch/cris/include/arch-v32/arch/irq.h | 4 +- arch/cris/kernel/irq.c | 2 +- 5 files changed, 25 insertions(+), 63 deletions(-)
regards, Kyle M.
Quoted 5 lines · Mikael Starvik
Great! These patches were expected and we would have done it ourselves someday soon but it is always great to get help from others, Thanks for caring about CRIS!
We will test these patches as soon as possible
Any chance you were able to test these?
regards, Kyle