All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 4/4] Inline u3msi_compose_msi_msg()
Date: Tue, 02 Oct 2007 15:24:43 +1000	[thread overview]
Message-ID: <1191302683.6310.90.camel@pasglop> (raw)
In-Reply-To: <19ac8b97e98274582fe5bde914883c3585f20082.1190270165.git.michael@ellerman.id.au>


On Thu, 2007-09-20 at 16:36 +1000, Michael Ellerman wrote:
> In the MPIC U3 MSI code, we call u3msi_compose_msi_msg() once for each MSI.
> This is overkill, as the address is per pci device, not per MSI. So setup
> the address once, and just set the data per MSI.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

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

> ---
>  arch/powerpc/sysdev/mpic_u3msi.c |   24 +++++++++---------------
>  1 files changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
> index 4e50d1c..027fe01 100644
> --- a/arch/powerpc/sysdev/mpic_u3msi.c
> +++ b/arch/powerpc/sysdev/mpic_u3msi.c
> @@ -107,26 +107,17 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
>  	return;
>  }
>  
> -static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq,
> -				  struct msi_msg *msg)
> -{
> -	u64 addr;
> -
> -	addr = find_ht_magic_addr(pdev);
> -	msg->address_lo = addr & 0xFFFFFFFF;
> -	msg->address_hi = addr >> 32;
> -	msg->data = virq_to_hw(virq);
> -
> -	pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) at address 0x%lx\n",
> -		 virq, virq_to_hw(virq), addr);
> -}
> -
>  static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>  {
>  	irq_hw_number_t hwirq;
>  	unsigned int virq;
>  	struct msi_desc *entry;
>  	struct msi_msg msg;
> +	u64 addr;
> +
> +	addr = find_ht_magic_addr(pdev);
> +	msg.address_lo = addr & 0xFFFFFFFF;
> +	msg.address_hi = addr >> 32;
>  
>  	list_for_each_entry(entry, &pdev->msi_list, list) {
>  		hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
> @@ -146,7 +137,10 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>  		set_irq_chip(virq, &mpic_u3msi_chip);
>  		set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
>  
> -		u3msi_compose_msi_msg(pdev, virq, &msg);
> +		pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
> +			  virq, hwirq, addr);
> +
> +		msg.data = hwirq;
>  		write_msi_msg(virq, &msg);
>  
>  		hwirq++;

  reply	other threads:[~2007-10-02  5:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20  6:36 [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs() Michael Ellerman
2007-09-20  6:36 ` [PATCH 2/4] Simplify error logic in rtas_setup_msi_irqs() Michael Ellerman
2007-10-02  5:21   ` Benjamin Herrenschmidt
2007-09-20  6:36 ` [PATCH 3/4] Simplify rtas_change_msi() error semantics Michael Ellerman
2007-10-02  5:23   ` Benjamin Herrenschmidt
2007-10-02  5:58     ` Michael Ellerman
2007-10-02  6:24       ` Benjamin Herrenschmidt
2007-10-02  7:40         ` Michael Ellerman
2007-10-02  8:37           ` Benjamin Herrenschmidt
2007-09-20  6:36 ` [PATCH 4/4] Inline u3msi_compose_msi_msg() Michael Ellerman
2007-10-02  5:24   ` Benjamin Herrenschmidt [this message]
2007-10-02  5:21 ` [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs() Benjamin Herrenschmidt

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=1191302683.6310.90.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael@ellerman.id.au \
    /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.