lkml.org 
[lkml]   [2008]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: tick-common.c hack for s390 needed
On Sun, Mar 23, 2008 at 10:34:55PM +0000, Russell King wrote:
> On Sat, Mar 22, 2008 at 09:32:23PM +0100, Heiko Carstens wrote:
> > Generic code is not supposed to include irq.h. Replace this include
> > by linux/hardirq.h instead and add/replace an include of linux/irq.h
> > in asm header files where necessary.
> > This change should only matter for architectures that make use of
> > GENERIC_CLOCKEVENTS.
> > Architectures in question are mips, x86, arm, sh, powerpc, uml and sparc64.
> >
> > I did some cross compile tests for mips, x86_64, arm, powerpc and sparc64.
> > This patch fixes also build breakages caused by the include replacement in
> > tick-common.h.
>
> I generally dislike adding optional linux/* includes in asm/* includes -
> I'm nervous about this causing include loops.
>
> However, there's a separate point to be discussed here.
>
> That is, what interfaces are expected of every architecture in the kernel.
> If generic code wants to be able to set the affinity of interrupts, then
> that needs to become part of the interfaces listed in linux/interrupt.h
> rather than linux/irq.h.

Every architecture besides one... as usual :/

> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index f8ab4ce..355e3b0 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -102,6 +102,25 @@ extern void disable_irq_nosync(unsigned int irq);
> extern void disable_irq(unsigned int irq);
> extern void enable_irq(unsigned int irq);
>
> +#ifdef CONFIG_SMP
> +
> +extern int irq_set_affinity(unsigned int irq, cpumask_t cpumask);
> +extern int irq_can_set_affinity(unsigned int irq);
> +
> +#else /* CONFIG_SMP */
> +
> +static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
> +{
> + return -EINVAL;
> +}
> +
> +static inline int irq_can_set_affinity(unsigned int irq)
> +{
> + return 0;
> +}
> +
> +#endif /* CONFIG_SMP */
> +

Could you add something like

#ifdef CONFIG_GENERIC_HARDIRQS

/* added stuff from above */

#else /* CONFIG_GENERIC_HARDIRQS */

static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
{
WARN_ON(1);
return -EINVAL;
}

static inline int irq_can_set_affinity(unsigned int irq)
{
return 0;
}
#endif /* CONFIG_GENERIC_HARDIRQS */
Then it should do the right thing on s390 as well.


\
 
 \ /
  Last update: 2008-03-24 11:17    [W:0.246 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site