All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org, jgarzik@pobox.com
Subject: Re: [PATCH] powerpc: mpic: minor optimization of ipi handler
Date: Sat, 20 Oct 2007 11:23:51 +1000	[thread overview]
Message-ID: <1192843431.17235.14.camel@pasglop> (raw)
In-Reply-To: <20071019234950.GA18112@lixom.net>


On Fri, 2007-10-19 at 18:49 -0500, Olof Johansson wrote:
> Optimize MPIC IPIs, by passing in the IPI number as the argument to the
> handler, since all we did was translate it back based on which mpic
> the interrupt came though on (and that was always the primary mpic).
> 
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>

> Oh, I see what you mean. You didn't make it easy to parse. :)
> 
> This should actually do the work.
> 
> -Olof

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> 
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index e479388..a8d7c68 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -614,10 +614,9 @@ static inline void mpic_eoi(struct mpic *mpic)
>  #ifdef CONFIG_SMP
>  static irqreturn_t mpic_ipi_action(int irq, void *data)
>  {
> -	struct mpic *mpic;
> +	long ipi = (long)data;
>  
> -	mpic = mpic_find(irq, NULL);
> -	smp_message_recv(mpic_irq_to_hw(irq) - mpic->ipi_vecs[0]);
> +	smp_message_recv(ipi);
>  
>  	return IRQ_HANDLED;
>  }
> @@ -1457,7 +1456,7 @@ unsigned int mpic_get_irq(void)
>  void mpic_request_ipis(void)
>  {
>  	struct mpic *mpic = mpic_primary;
> -	int i, err;
> +	long i, err;
>  	static char *ipi_names[] = {
>  		"IPI0 (call function)",
>  		"IPI1 (reschedule)",
> @@ -1472,14 +1471,14 @@ void mpic_request_ipis(void)
>  		unsigned int vipi = irq_create_mapping(mpic->irqhost,
>  						       mpic->ipi_vecs[0] + i);
>  		if (vipi == NO_IRQ) {
> -			printk(KERN_ERR "Failed to map IPI %d\n", i);
> +			printk(KERN_ERR "Failed to map IPI %ld\n", i);
>  			break;
>  		}
>  		err = request_irq(vipi, mpic_ipi_action,
>  				  IRQF_DISABLED|IRQF_PERCPU,
> -				  ipi_names[i], mpic);
> +				  ipi_names[i], (void *)i);
>  		if (err) {
> -			printk(KERN_ERR "Request of irq %d for IPI %d failed\n",
> +			printk(KERN_ERR "Request of irq %d for IPI %ld failed\n",
>  			       vipi, i);
>  			break;
>  		}

      reply	other threads:[~2007-10-20  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 18:51 [PATCH] powerpc: mpic: minor optimization of ipi handler Olof Johansson
2007-10-19 23:17 ` Benjamin Herrenschmidt
2007-10-19 23:31   ` Olof Johansson
2007-10-19 23:49     ` Olof Johansson
2007-10-20  1:23       ` 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=1192843431.17235.14.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=jgarzik@pobox.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.