From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bjorn Helgaas <bhelgaas@google.com>, David Miller <davem@davemloft.net>
Cc: wangyijing@huawei.com, linux-pci@vger.kernel.org, mroos@linux.ee,
sparclinux@vger.kernel.org, eric.snowberg@oracle.com
Subject: Re: [PATCH] PCI/ASPM: Fix a NULL pointer crash on sparc64
Date: Thu, 20 Aug 2015 08:29:09 +1000 [thread overview]
Message-ID: <1440023349.2737.21.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150819221624.GA8150@google.com>
On Wed, 2015-08-19 at 17:16 -0500, Bjorn Helgaas wrote:
> On Tue, Aug 18, 2015 at 12:10:04PM -0700, David Miller wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> > Date: Tue, 18 Aug 2015 13:49:43 -0500
> >
> > > [+cc Dave, Eric, Ben, sparclinux]
> > >
> > > On Mon, Aug 17, 2015 at 06:47:58PM +0800, Yijing Wang wrote:
> > > > Commit d0751b98dfa3 ("PCI: Add dev->has_secondary_link to
> > > > track downstream PCIe links")assumed root port is always
> > > > the top device in pcie tree. But on sparc64 V245 and T2000tthe
> > > > pcie tree has no root port device in top level, the
> > > > upstream port device is connected directly to root bus.
> > > > So we may get NULL parent for this upstream port device.
Picking up that thread half way through...
> > > > Upstream port ------ Downstream port ------PCIe-PCI bridge
> > >
> > > This is an unusual, possibly even illegal, PCIe topology because
> > > it lacks a Root Port at the top of the hierarchy. From lspci
> > > output
> > > [1]
> > > collected by Meelis, the top-level devices are:
Nobody cares what is "illegal", what matters is what HW actually does :
-) Specs only matter as far as they get followed. In any case, it also
happens on powerpc, when running under a hypervisor such as IBM
PowerVM, PCIe devices appear directly under a virtual host bridge which
is not exposed as a PCIe root complex.
> > The root port is in the PCI controller on sparc64, and PCI
> > controllers
> > don't have actual real PCI configuration space available.
> >
> > I used to put dummy PCI bus nodes into the tree and do provide
> > dummy
> > software PCI config space methods, but that caused more harm than
> > good.
>
> I guess you're talking about what you removed with c26d3c013897
> ("sparc64: Stop creating dummy root PCI host controller devices."),
> which talks about duplicate sysfs and procfs nodes. Removing the
> dummy devices avoids the duplicate node problem, but it doesn't fix
> the root cause, so it's probably not the only possible resolution.
>
> We'll probably have to do something ugly like Yijing's patch just
> because v4.2 is imminent and I don't want it to be broken.
>
> I don't like it because we have these PCIe links where we only know
> about devices on one end of the link, and then we can't manage
> ASPM/MPS/etc. But we've had this situation for several years, so
> I guess nobody cares too much about those things on the affected
> mahines.
Correct, we have this situation on more than just sparc64 and we
shouldn't crash. Just don't touch ASPM/MPS/etc... in those cases.
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bjorn Helgaas <bhelgaas@google.com>, David Miller <davem@davemloft.net>
Cc: wangyijing@huawei.com, linux-pci@vger.kernel.org, mroos@linux.ee,
sparclinux@vger.kernel.org, eric.snowberg@oracle.com
Subject: Re: [PATCH] PCI/ASPM: Fix a NULL pointer crash on sparc64
Date: Wed, 19 Aug 2015 22:29:09 +0000 [thread overview]
Message-ID: <1440023349.2737.21.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150819221624.GA8150@google.com>
On Wed, 2015-08-19 at 17:16 -0500, Bjorn Helgaas wrote:
> On Tue, Aug 18, 2015 at 12:10:04PM -0700, David Miller wrote:
> > From: Bjorn Helgaas <bhelgaas@google.com>
> > Date: Tue, 18 Aug 2015 13:49:43 -0500
> >
> > > [+cc Dave, Eric, Ben, sparclinux]
> > >
> > > On Mon, Aug 17, 2015 at 06:47:58PM +0800, Yijing Wang wrote:
> > > > Commit d0751b98dfa3 ("PCI: Add dev->has_secondary_link to
> > > > track downstream PCIe links")assumed root port is always
> > > > the top device in pcie tree. But on sparc64 V245 and T2000tthe
> > > > pcie tree has no root port device in top level, the
> > > > upstream port device is connected directly to root bus.
> > > > So we may get NULL parent for this upstream port device.
Picking up that thread half way through...
> > > > Upstream port ------ Downstream port ------PCIe-PCI bridge
> > >
> > > This is an unusual, possibly even illegal, PCIe topology because
> > > it lacks a Root Port at the top of the hierarchy. From lspci
> > > output
> > > [1]
> > > collected by Meelis, the top-level devices are:
Nobody cares what is "illegal", what matters is what HW actually does :
-) Specs only matter as far as they get followed. In any case, it also
happens on powerpc, when running under a hypervisor such as IBM
PowerVM, PCIe devices appear directly under a virtual host bridge which
is not exposed as a PCIe root complex.
> > The root port is in the PCI controller on sparc64, and PCI
> > controllers
> > don't have actual real PCI configuration space available.
> >
> > I used to put dummy PCI bus nodes into the tree and do provide
> > dummy
> > software PCI config space methods, but that caused more harm than
> > good.
>
> I guess you're talking about what you removed with c26d3c013897
> ("sparc64: Stop creating dummy root PCI host controller devices."),
> which talks about duplicate sysfs and procfs nodes. Removing the
> dummy devices avoids the duplicate node problem, but it doesn't fix
> the root cause, so it's probably not the only possible resolution.
>
> We'll probably have to do something ugly like Yijing's patch just
> because v4.2 is imminent and I don't want it to be broken.
>
> I don't like it because we have these PCIe links where we only know
> about devices on one end of the link, and then we can't manage
> ASPM/MPS/etc. But we've had this situation for several years, so
> I guess nobody cares too much about those things on the affected
> mahines.
Correct, we have this situation on more than just sparc64 and we
shouldn't crash. Just don't touch ASPM/MPS/etc... in those cases.
Cheers,
Ben.
next prev parent reply other threads:[~2015-08-19 22:30 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-17 10:47 [PATCH] PCI/ASPM: Fix a NULL pointer crash on sparc64 Yijing Wang
2015-08-18 18:49 ` Bjorn Helgaas
2015-08-18 18:49 ` Bjorn Helgaas
2015-08-18 19:10 ` David Miller
2015-08-18 19:10 ` David Miller
2015-08-19 22:16 ` Bjorn Helgaas
2015-08-19 22:16 ` Bjorn Helgaas
2015-08-19 22:29 ` Benjamin Herrenschmidt [this message]
2015-08-19 22:29 ` Benjamin Herrenschmidt
2015-08-20 6:01 ` Bjorn Helgaas
2015-08-20 6:01 ` Bjorn Helgaas
2015-08-20 6:38 ` Benjamin Herrenschmidt
2015-08-20 6:38 ` Benjamin Herrenschmidt
2015-08-20 6:44 ` Kjetil Oftedal
2015-08-20 6:44 ` Kjetil Oftedal
2015-08-20 17:51 ` David Miller
2015-08-20 17:51 ` David Miller
2015-08-20 17:50 ` David Miller
2015-08-20 17:50 ` David Miller
2015-08-20 5:48 ` Bjorn Helgaas
2015-08-20 5:48 ` Bjorn Helgaas
2015-08-20 17:47 ` David Miller
2015-08-20 17:47 ` David Miller
2015-08-20 18:23 ` Bjorn Helgaas
2015-08-20 18:23 ` Bjorn Helgaas
2015-08-20 18:40 ` David Miller
2015-08-20 18:40 ` David Miller
2015-08-20 20:21 ` Bjorn Helgaas
2015-08-20 20:21 ` Bjorn Helgaas
2015-08-20 20:58 ` David Miller
2015-08-20 20:58 ` David Miller
2015-08-20 21:21 ` Bjorn Helgaas
2015-08-20 21:21 ` Bjorn Helgaas
2015-08-20 21:38 ` David Miller
2015-08-20 21:38 ` David Miller
2015-08-21 1:48 ` wangyijing
2015-08-21 1:48 ` wangyijing
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=1440023349.2737.21.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=eric.snowberg@oracle.com \
--cc=linux-pci@vger.kernel.org \
--cc=mroos@linux.ee \
--cc=sparclinux@vger.kernel.org \
--cc=wangyijing@huawei.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 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.