From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH] powerpc/pseries: Fix kernel crash caused by NULL PE
Date: Fri, 23 Nov 2012 13:50:04 +1100 [thread overview]
Message-ID: <50AEE45C.80603@ozlabs.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]
While hooking MSI interrupts, the corresponding device tree node
of the PE that the PCI device has been put into should be checked.
However, those PCI devices (e.g. VirtIO based PCI devices) that
don't have EEH capability shouldn't have the associated PE. So we
shouldn't try to get the PE's device tree node. Otherwise, it
would cause kernel crash.
Actually, it was introduced by commit 66523d9f ("powerpc/eeh: Trace
error based on PE from beginning").
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/msi.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/msi.c
b/arch/powerpc/platforms/pseries/msi.c
index d19f497..9284e42 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -218,9 +218,16 @@ static struct device_node *find_pe_dn(struct pci_dev
*dev, int *total)
if (!dn)
return NULL;
- /* Get the top level device in the PE */
+ /*
+ * Get the top level device in the PE, but some PCI devices
+ * without EEH capability (e.g. VirtIO based PCI devices)
+ * don't have the associated PE. So we should not get the
+ * top level device from PE for those PCI devices.
+ */
edev = of_node_to_eeh_dev(dn);
- edev = list_first_entry(&edev->pe->edevs, struct eeh_dev, list);
+ if (edev->pe)
+ edev = list_first_entry(&edev->pe->edevs,
+ struct eeh_dev, list);
dn = eeh_dev_to_of_node(edev);
if (!dn)
return NULL;
--
1.7.5.4
[-- Attachment #2: Attached Message Part --]
[-- Type: text/plain, Size: 0 bytes --]
next reply other threads:[~2012-11-23 2:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 2:50 Alexey Kardashevskiy [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-11-23 2:51 [PATCH] powerpc/pseries: Fix kernel crash caused by NULL PE Alexey Kardashevskiy
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=50AEE45C.80603@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=benh@kernel.crashing.org \
--cc=david@gibson.dropbear.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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).