From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org, miltonm@bga.com
Subject: [PATCH] powerpc: disable MSI using new interface if possible
Date: Thu, 3 Mar 2011 17:41:02 -0800 [thread overview]
Message-ID: <1299202862-10682-1-git-send-email-nacc@us.ibm.com> (raw)
In-Reply-To: <1299200729.3630.52.camel@concordia>
On 04.03.2011 [12:05:29 +1100], Michael Ellerman wrote:
> On Thu, 2011-03-03 at 11:39 -0800, Nishanth Aravamudan wrote:
> > On upcoming hardware, we have a PCI adapter with two functions, one of
> > which uses MSI and the other uses MSI-X. This adapter, when MSI is
> > disabled using the "old" firmware interface (RTAS_CHANGE_FN), still
> > signals an MSI-X interrupt and triggers an EEH. We are working with the
> > vendor to ensure that the hardware is not at fault, but if we use the
> > "new" interface (RTAS_CHANGE_MSI_FN) to disable MSI, we also
> > automatically disable MSI-X and the adapter does not appear to signal
> > any stray MSI-X interrupt.
>
> It seems this could also be a firmware bug, have we heard anything from
> them? PAPR explicitly says that RTAS_CHANGE_FN (function=1) should
> disable MSI _and_ MSI-X (R1???7.3.10.5.1???1).
We're tracking that down too. I think the fact that the interrupt is
coming in is a hardware bug in this particular adapter.
I'm looking at PAPR again and I see what might be a contradiction:
7.3.10.5.1: "To removing all MSIs, set the Requested Number of
Interrupts to zero."
Table 71: "Function ... 1: Request to set to a new number of MSI or
MSI-X (platform choice) interrupts (including set to 0)"
It seems like the Table claims that using RTAS_CHANGE_FN with 0, could
change only MSI or MSI-X and still be not a bug?
It does seem like it should disable both, but from what we've seen with
this adapter, it doesn't appear to.
> > Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> > Cc: Milton Miller <miltonm@bga.com>
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: Paul Mackerras <paulus@samba.org>
>
> Cc: Me :)
Sorry! I was in a hurry to get this out the door, my fault. Note, you
don't show up per scripts/get_maintainer.pl :)
> > diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
> > index 1164c34..9434576 100644
> > --- a/arch/powerpc/platforms/pseries/msi.c
> > +++ b/arch/powerpc/platforms/pseries/msi.c
> > @@ -93,8 +93,18 @@ static void rtas_disable_msi(struct pci_dev *pdev)
> > if (!pdn)
> > return;
> >
> > - if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0)
> > - pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
> > + /*
> > + * disabling MSI with the explicit interface also disables MSI-X
> > + */
> > + if (rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, 0) != 0) {
> > + /*
> > + * may have failed due to lacking
> > + * "ibm,change-msix-capable" property
> > + */
> > + if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0) {
> > + pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
> > + }
> > + }
> > }
>
> This is probably a pretty safe change anyway, ie. use the newer API if
> it is present. The comment is backward though, the call fails because
> the new interface is not implemented, and that fact is signalled by the
> absence of the property.
Updated the comment, thanks:
On upcoming hardware, we have a PCI adapter with two functions, one of
which uses MSI and the other uses MSI-X. This adapter, when MSI is
disabled using the "old" firmware interface (RTAS_CHANGE_FN), still
signals an MSI-X interrupt and triggers an EEH. We are working with the
vendor to ensure that the hardware is not at fault, but if we use the
"new" interface (RTAS_CHANGE_MSI_FN) to disable MSI, we also
automatically disable MSI-X and the adapter does not appear to signal
any stray MSI-X interrupt.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
---
arch/powerpc/platforms/pseries/msi.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 1164c34..18ac801 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -93,8 +93,18 @@ static void rtas_disable_msi(struct pci_dev *pdev)
if (!pdn)
return;
- if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0)
- pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
+ /*
+ * disabling MSI with the explicit interface also disables MSI-X
+ */
+ if (rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, 0) != 0) {
+ /*
+ * may have failed because explicit interface is not
+ * present
+ */
+ if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0) {
+ pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
+ }
+ }
}
static int rtas_query_irq_number(struct pci_dn *pdn, int offset)
--
1.7.1
next prev parent reply other threads:[~2011-03-04 1:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 19:39 [PATCH 1/2] powerpc: disable MSI using new interface if possible Nishanth Aravamudan
2011-03-03 19:39 ` [PATCH 2/2] powerpc/msi: clarify call to check_req_msi{,x} Nishanth Aravamudan
2011-03-03 19:44 ` [PATCH 1/2] powerpc: disable MSI using new interface if possible Nishanth Aravamudan
2011-03-04 1:05 ` Michael Ellerman
2011-03-04 1:41 ` Nishanth Aravamudan [this message]
2011-03-04 3:01 ` [PATCH] " Michael Ellerman
2011-03-04 7:24 ` Nishanth Aravamudan
2011-03-08 5:34 ` Nishanth Aravamudan
2011-03-09 22:54 ` Michael Ellerman
2011-03-04 3:06 ` Michael Ellerman
2011-03-04 3:29 ` Joe Perches
2011-03-04 11:13 ` Florian Mickler
2011-03-09 23:12 ` Michael Ellerman
2011-03-10 0:28 ` Joe Perches
2011-03-10 0:46 ` Nishanth Aravamudan
2011-03-10 3:35 ` Michael Ellerman
2011-03-10 3:45 ` Joe Perches
2011-03-10 7:04 ` Florian Mickler
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=1299202862-10682-1-git-send-email-nacc@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=miltonm@bga.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).