Re: [PATCH] genirq: ARM dyntick cleanup

From: Andrew Morton
Date: Sun Jul 02 2006 - 20:34:17 EST


On Mon, 03 Jul 2006 02:18:48 +0200
Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> Linus: "The hacks in kernel/irq/handle.c are really horrid. REALLY
> horrid."
>
> They are indeed. Move the dyntick quirks to ARM where they belong.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> Index: linux-2.6.git/include/asm-arm/hw_irq.h
> ===================================================================
> --- linux-2.6.git.orig/include/asm-arm/hw_irq.h 2006-07-03 00:13:24.000000000 +0200
> +++ linux-2.6.git/include/asm-arm/hw_irq.h 2006-07-03 00:52:04.000000000 +0200
> @@ -6,4 +6,15 @@
>
> #include <asm/mach/irq.h>
>
> +#if defined(CONFIG_NO_IDLE_HZ)
> +# include <asm/dyntick.h>
> +# define handle_dynamic_tick(action) \
> + if (!(action->flags & SA_TIMER) && system_timer->dyn_tick) { \
> + write_seqlock(&xtime_lock); \
> + if (system_timer->dyn_tick->state & DYN_TICK_ENABLED) \
> + system_timer->dyn_tick->handler(irq, 0, regs); \
> + write_sequnlock(&xtime_lock); \
> + }
> +#endif
> +
> #endif
> Index: linux-2.6.git/include/linux/irq.h
> ===================================================================
> --- linux-2.6.git.orig/include/linux/irq.h 2006-07-03 00:13:24.000000000 +0200
> +++ linux-2.6.git/include/linux/irq.h 2006-07-03 00:49:01.000000000 +0200
> @@ -182,6 +182,10 @@ extern int setup_irq(unsigned int irq, s
>
> #ifdef CONFIG_GENERIC_HARDIRQS
>
> +#ifndef handle_dynamic_tick
> +# define handle_dynamic_tick(a) do { } while (0)
> +#endif
> +
> #ifdef CONFIG_SMP
> static inline void set_native_irq_info(int irq, cpumask_t mask)
> {

This is not exactly a thing of beauty either. It's much cleaner to use
__attribute__((weak)), but that will add an empty call-return to everyone's
interrupts.

The requirement "if you implement this then you must do so as a macro" is a
bit regrettable. The ARCH_HAS_HANDLE_DYNAMIC_TICK approach would eliminate
that requirement.



btw, is this, from include/linux/irq.h:

/*
* Please do not include this file in generic code. There is currently
* no requirement for any architecture to implement anything held
* within this file.
*
* Thanks. --rmk
*/

still true?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/