public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jon Mason <mason@myri.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH 0/2] PCI: PCI-E MPS bug fixes
Date: Tue, 13 Sep 2011 18:56:19 -0300	[thread overview]
Message-ID: <1315950979.455.159.camel@pasglop> (raw)
In-Reply-To: <CAMaF-rPhfVmuMthdO_iHEMmSbi9cujX7LrK+DTGHZ=FxGpdokg@mail.gmail.com>


> DNS issue with kernel.org when the patches went out caused it to not
> get out to any of the mailing lists.
> 
> In Linux' github tree
> Patch 1/2 is commit 5307f6d5fb12fd01f9f321bc4a8fd77e74858647
> Patch 2/2 is commit ed2888e906b56769b4ffabb9c577190438aa68b8
> 
> > When using "safe" mode, I get a crash in pcie_find_smpss(). Patch below.
> >
> > From 1b542d690323fab332e61099193d598c5c515d13 Mon Sep 17 00:00:00 2001
> > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Date: Tue, 13 Sep 2011 15:16:33 -0300
> > Subject: [PATCH] pci: Don't crash when reading mpss from root complex
> >
> > In pcie_find_smpss(), we have the following statement:
> >
> >        if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) ||
> >            dev->bus->self->pcie_type != PCI_EXP_TYPE_ROOT_PORT))
> >
> > The problem is that at least on my machine, this gets called for the
> > root complex (virtual P2P bridge), and dev->bus->self is NULL since
> > the parent bus for this is not itself anchor to a PCI device.
> >
> > This adds the necessary NULL check.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Good catch.
> 
> Acked-by: Jon Mason <mason@myri.com>

Linus, please apply.

Cheers
Ben.

> > ---
> >  drivers/pci/probe.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> > index 8473727..09d1c0f 100644
> > --- a/drivers/pci/probe.c
> > +++ b/drivers/pci/probe.c
> > @@ -1351,7 +1351,8 @@ static int pcie_find_smpss(struct pci_dev *dev, void *data)
> >         * will occur as normal.
> >         */
> >        if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) ||
> > -           dev->bus->self->pcie_type != PCI_EXP_TYPE_ROOT_PORT))
> > +            (dev->bus->self &&
> > +             dev->bus->self->pcie_type != PCI_EXP_TYPE_ROOT_PORT)))
> >                *smpss = 0;
> >
> >        if (*smpss > dev->pcie_mpss)
> > --
> > 1.7.4.1
> >
> >
> >
> >
> >
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2011-09-13 21:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 21:41 [PATCH 0/2] PCI: PCI-E MPS bug fixes Jon Mason
2011-09-09 22:44 ` Linus Torvalds
2011-09-10  0:04   ` Jesse Barnes
2011-09-13 10:50     ` Benjamin Herrenschmidt
2011-09-13 18:17       ` Benjamin Herrenschmidt
2011-09-13 21:05         ` Jon Mason
2011-09-13 21:56           ` Benjamin Herrenschmidt [this message]
2011-09-13 20:55       ` Jon Mason

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=1315950979.455.159.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mason@myri.com \
    --cc=torvalds@linux-foundation.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