From: Michael Ellerman <michael@ellerman.id.au>
To: Gavin Shan <shangw@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/3] powerpc/powernv: Patch MSI EOI handler on P8
Date: Mon, 22 Apr 2013 09:34:36 +1000 [thread overview]
Message-ID: <20130421233436.GB22246@concordia> (raw)
In-Reply-To: <1366363965-23281-3-git-send-email-shangw@linux.vnet.ibm.com>
On Fri, Apr 19, 2013 at 05:32:45PM +0800, Gavin Shan wrote:
> The EOI handler of MSI/MSI-X interrupts for P8 (PHB3) need additional
> steps to handle the P/Q bits in IVE before EOIing the corresponding
> interrupt. The patch changes the EOI handler to cover that.
> diff --git a/arch/powerpc/sysdev/xics/icp-native.c b/arch/powerpc/sysdev/xics/icp-native.c
> index 48861d3..289355e 100644
> --- a/arch/powerpc/sysdev/xics/icp-native.c
> +++ b/arch/powerpc/sysdev/xics/icp-native.c
> @@ -27,6 +27,10 @@
> #include <asm/xics.h>
> #include <asm/kvm_ppc.h>
>
> +#if defined(CONFIG_PPC_POWERNV) && defined(CONFIG_PCI_MSI)
> +extern int pnv_pci_msi_eoi(unsigned int hw_irq);
> +#endif
You don't need to #ifdef the extern. But it should be in a header, not
here.
> @@ -89,6 +93,24 @@ static void icp_native_eoi(struct irq_data *d)
> icp_native_set_xirr((xics_pop_cppr() << 24) | hw_irq);
> }
>
> +static void icp_p8_native_eoi(struct irq_data *d)
> +{
> + unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d);
> + int ret;
> +
> + /* Let firmware handle P/Q bits */
> +#if defined(CONFIG_PPC_POWERNV) && defined(CONFIG_PCI_MSI)
> + if (hw_irq != XICS_IPI) {
> + ret = pnv_pci_msi_eoi(hw_irq);
> + WARN_ON_ONCE(ret);
> + }
> +#endif
Why the ifdef in here? You only ever hook this function up if those are
true, so why do you need to check them again?
> @@ -296,6 +318,15 @@ int __init icp_native_init(void)
> if (found == 0)
> return -ENODEV;
>
> + /* Change the EOI handler for P8 */
> +#if defined(CONFIG_PPC_POWERNV) && defined(CONFIG_PCI_MSI)
This would be neater if you created CONFIG_POWERNV_MSI, like we have
CONFIG_PSERIES_MSI.
cheers
next prev parent reply other threads:[~2013-04-21 23:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-19 9:32 [PATCH 1/3] powerpc/powernv: Supports PHB3 Gavin Shan
2013-04-19 9:32 ` [PATCH 2/3] powerpc/powernv: Configure IODA2 tables explicitly Gavin Shan
2013-04-19 9:32 ` [PATCH 3/3] powerpc/powernv: Patch MSI EOI handler on P8 Gavin Shan
2013-04-21 23:34 ` Michael Ellerman [this message]
2013-04-22 1:45 ` Gavin Shan
2013-04-22 2:56 ` Michael Ellerman
2013-04-22 11:06 ` Gavin Shan
2013-04-22 23:34 ` Michael Ellerman
2013-04-23 4:14 ` Gavin Shan
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=20130421233436.GB22246@concordia \
--to=michael@ellerman.id.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=shangw@linux.vnet.ibm.com \
/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