The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch, -rc5-mm1] genirq MSI fixes
Date: Wed, 31 May 2006 16:40:37 +1000	[thread overview]
Message-ID: <1149057637.766.42.camel@localhost.localdomain> (raw)
In-Reply-To: <20060531061500.GA20609@elte.hu>

On Wed, 2006-05-31 at 08:15 +0200, Ingo Molnar wrote:
> this is a fixed up and cleaned up replacement for 
> genirq-msi-fixes.patch, which should solve the i386 4KSTACKS problem. I 
> also added Ben's idea of pushing the __do_IRQ() check into 
> generic_handle_irq().
> 
> i booted this with MSI enabled, but i only have MSI devices, not MSI-X 
> devices. I'd still expect MSI-X to work now.

Looks good except the likely statement in generic_handle_irq() :) I'd
let the CPU speculate here and not try to influence the choice... but
heh... I understand why you want to "favor" the new scheme :)

Ben.

> --------------
> Subject: genirq-msi-fixes
> From: Ingo Molnar <mingo@elte.hu>
> 
> irqchip migration helper: call __do_IRQ() if a descriptor is attached
> to an irqtype-style controller. This also fixes MSI-X IRQ handling on
> i386 and x86_64.
> 
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> 
>  arch/i386/kernel/irq.c |    5 +++++
>  include/linux/irq.h    |   27 ++++++++++++++++-----------
>  2 files changed, 21 insertions(+), 11 deletions(-)
> 
> Index: linux/arch/i386/kernel/irq.c
> ===================================================================
> --- linux.orig/arch/i386/kernel/irq.c
> +++ linux/arch/i386/kernel/irq.c
> @@ -77,6 +77,10 @@ fastcall unsigned int do_IRQ(struct pt_r
>  	}
>  #endif
>  
> +	if (!irq_desc[irq].handle_irq) {
> +		__do_IRQ(irq, regs);
> +		goto out_exit;
> +	}
>  #ifdef CONFIG_4KSTACKS
>  
>  	curctx = (union irq_ctx *) current_thread_info();
> @@ -109,6 +113,7 @@ fastcall unsigned int do_IRQ(struct pt_r
>  #endif
>  		desc->handle_irq(irq, desc, regs);
>  
> +out_exit:
>  	irq_exit();
>  
>  	return 1;
> Index: linux/include/linux/irq.h
> ===================================================================
> --- linux.orig/include/linux/irq.h
> +++ linux/include/linux/irq.h
> @@ -176,17 +176,6 @@ typedef struct irq_desc		irq_desc_t;
>   */
>  #include <asm/hw_irq.h>
>  
> -/*
> - * Architectures call this to let the generic IRQ layer
> - * handle an interrupt:
> - */
> -static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
> -{
> -	struct irq_desc *desc = irq_desc + irq;
> -
> -	desc->handle_irq(irq, desc, regs);
> -}
> -
>  extern int setup_irq(unsigned int irq, struct irqaction *new);
>  
>  #ifdef CONFIG_GENERIC_HARDIRQS
> @@ -324,6 +313,22 @@ handle_irq_name(void fastcall (*handle)(
>   */
>  extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
>  
> +/*
> + * Architectures call this to let the generic IRQ layer
> + * handle an interrupt. If the descriptor is attached to an
> + * irqchip-style controller then we call the ->handle_irq() handler,
> + * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
> + */
> +static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
> +{
> +	struct irq_desc *desc = irq_desc + irq;
> +
> +	if (likely(desc->handle_irq))
> +		desc->handle_irq(irq, desc, regs);
> +	else
> +		__do_IRQ(irq, regs);
> +}
> +
>  /* Handling of unhandled and spurious interrupts: */
>  extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
>  			   int action_ret, struct pt_regs *regs);


      reply	other threads:[~2006-05-31  6:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-31  6:15 [patch, -rc5-mm1] genirq MSI fixes Ingo Molnar
2006-05-31  6:40 ` Benjamin Herrenschmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1149057637.766.42.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox