* [PATCH 1/4] cris: use set_irq_chip helpers
2010-10-15 4:01 [PATCH 0/4] cris: kill __do_IRQ Kyle McMartin
@ 2010-10-15 4:05 ` Kyle McMartin
2010-10-15 4:05 ` [PATCH 2/4] cris: convert arch-v10 away from __do_IRQ Kyle McMartin
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2010-10-15 4:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikael Starvik, Jesper Nilsson, linux-cris-kernel, kyle
But just call __do_IRQ for ->handle_irq for now.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
---
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(-)
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c
index a0c0df8..25d6252 100644
--- a/arch/cris/arch-v10/kernel/irq.c
+++ b/arch/cris/arch-v10/kernel/irq.c
@@ -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]);
}
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
index 2ed48ae..4c78afd 100644
--- a/arch/cris/arch-v32/kernel/irq.c
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -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]);
}
diff --git a/arch/cris/include/asm/irq.h b/arch/cris/include/asm/irq.h
index ce0fcf5..3406c68 100644
--- a/arch/cris/include/asm/irq.h
+++ b/arch/cris/include/asm/irq.h
@@ -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 */
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index 469f7f9..b6d54eb 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -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);
+}
--
1.7.3.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 2/4] cris: convert arch-v10 away from __do_IRQ
2010-10-15 4:01 [PATCH 0/4] cris: kill __do_IRQ Kyle McMartin
2010-10-15 4:05 ` [PATCH 1/4] cris: use set_irq_chip helpers Kyle McMartin
@ 2010-10-15 4:05 ` Kyle McMartin
2010-10-15 4:05 ` [PATCH 3/4] cris: convert arch-v32 " Kyle McMartin
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2010-10-15 4:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikael Starvik, Jesper Nilsson, linux-cris-kernel, kyle
Looks 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.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
---
arch/cris/arch-v10/kernel/irq.c | 26 +++++---------------------
1 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c
index 25d6252..07f17ce 100644
--- a/arch/cris/arch-v10/kernel/irq.c
+++ b/arch/cris/arch-v10/kernel/irq.c
@@ -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]);
}
--
1.7.3.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 3/4] cris: convert arch-v32 away from __do_IRQ
2010-10-15 4:01 [PATCH 0/4] cris: kill __do_IRQ Kyle McMartin
2010-10-15 4:05 ` [PATCH 1/4] cris: use set_irq_chip helpers Kyle McMartin
2010-10-15 4:05 ` [PATCH 2/4] cris: convert arch-v10 away from __do_IRQ Kyle McMartin
@ 2010-10-15 4:05 ` Kyle McMartin
2010-10-15 4:05 ` [PATCH 4/4] cris: turn on GENERIC_HARDIRQS_NO__DO_IRQ Kyle McMartin
2010-10-15 6:13 ` [PATCH 0/4] cris: kill __do_IRQ Mikael Starvik
4 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2010-10-15 4:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikael Starvik, Jesper Nilsson, linux-cris-kernel, kyle
Again, 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.)
Signed-off-by: Kyle McMartin <kyle@redhat.com>
---
arch/cris/arch-v32/kernel/irq.c | 53 +++++++++------------------------
arch/cris/include/arch-v32/arch/irq.h | 4 +-
2 files changed, 16 insertions(+), 41 deletions(-)
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
index 4c78afd..6fab3f5 100644
--- a/arch/cris/arch-v32/kernel/irq.c
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -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);
diff --git a/arch/cris/include/arch-v32/arch/irq.h b/arch/cris/include/arch-v32/arch/irq.h
index b31e998..fbe5d43 100644
--- a/arch/cris/include/arch-v32/arch/irq.h
+++ b/arch/cris/include/arch-v32/arch/irq.h
@@ -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);
--
1.7.3.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 4/4] cris: turn on GENERIC_HARDIRQS_NO__DO_IRQ
2010-10-15 4:01 [PATCH 0/4] cris: kill __do_IRQ Kyle McMartin
` (2 preceding siblings ...)
2010-10-15 4:05 ` [PATCH 3/4] cris: convert arch-v32 " Kyle McMartin
@ 2010-10-15 4:05 ` Kyle McMartin
2010-10-15 6:13 ` [PATCH 0/4] cris: kill __do_IRQ Mikael Starvik
4 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2010-10-15 4:05 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikael Starvik, Jesper Nilsson, linux-cris-kernel, kyle
Since we no longer require __do_IRQ.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
---
arch/cris/Kconfig | 3 +++
arch/cris/include/asm/irq.h | 3 ---
arch/cris/kernel/irq.c | 4 ----
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index aefe3b1..459d4f7 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -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"
diff --git a/arch/cris/include/asm/irq.h b/arch/cris/include/asm/irq.h
index 3406c68..ce0fcf5 100644
--- a/arch/cris/include/asm/irq.h
+++ b/arch/cris/include/asm/irq.h
@@ -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 */
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index b6d54eb..14d9ce9 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -105,7 +105,3 @@ void weird_irq(void)
while(1);
}
-void cris_do_IRQ(unsigned int irq, struct irq_desc *desc)
-{
- __do_IRQ(irq);
-}
--
1.7.3.1
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [PATCH 0/4] cris: kill __do_IRQ
2010-10-15 4:01 [PATCH 0/4] cris: kill __do_IRQ Kyle McMartin
` (3 preceding siblings ...)
2010-10-15 4:05 ` [PATCH 4/4] cris: turn on GENERIC_HARDIRQS_NO__DO_IRQ Kyle McMartin
@ 2010-10-15 6:13 ` Mikael Starvik
2010-11-10 15:31 ` Kyle McMartin
4 siblings, 1 reply; 7+ messages in thread
From: Mikael Starvik @ 2010-10-15 6:13 UTC (permalink / raw)
To: Kyle McMartin, linux-kernel; +Cc: Jesper Nilsson, linux-cris-kernel
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:kyle@infradead.org] On Behalf Of Kyle McMartin
Sent: den 15 oktober 2010 06:01
To: linux-kernel@vger.kernel.org
Cc: Mikael Starvik; Jesper Nilsson; linux-cris-kernel; kyle@mcmartin.ca
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.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 0/4] cris: kill __do_IRQ
2010-10-15 6:13 ` [PATCH 0/4] cris: kill __do_IRQ Mikael Starvik
@ 2010-11-10 15:31 ` Kyle McMartin
0 siblings, 0 replies; 7+ messages in thread
From: Kyle McMartin @ 2010-11-10 15:31 UTC (permalink / raw)
To: Mikael Starvik
Cc: Kyle McMartin, linux-kernel, Jesper Nilsson, linux-cris-kernel
On Fri, Oct 15, 2010 at 08:13:36AM +0200, Mikael Starvik wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread