Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbbLQR1Y (ORCPT ); Thu, 17 Dec 2015 12:27:24 -0500 Received: from mail.kernel.org ([198.145.29.136]:33589 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbbLQR1W (ORCPT ); Thu, 17 Dec 2015 12:27:22 -0500 Date: Thu, 17 Dec 2015 11:27:18 -0600 From: Bjorn Helgaas To: Keith Busch Cc: LKML , x86@kernel.org, linux-pci@vger.kernel.org, Jiang Liu , Thomas Gleixner , Dan Williams , Bjorn Helgaas , Bryan Veal , Ingo Molnar , "H. Peter Anvin" , Martin Mares , Jon Derrick Subject: Re: [PATCHv6 2/7] pci: child bus alloc fix on constrained resource Message-ID: <20151217172718.GC23549@localhost> References: <1449523949-21898-1-git-send-email-keith.busch@intel.com> <1449523949-21898-3-git-send-email-keith.busch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449523949-21898-3-git-send-email-keith.busch@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1813 Lines: 54 Hi Keith, On Mon, Dec 07, 2015 at 02:32:24PM -0700, Keith Busch wrote: > Does not allocate a child bus if the new bus number does not fit in the > parent's bus resource window. > > Signed-off-by: Keith Busch > --- > drivers/pci/probe.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index edb1984..6e29f7a 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -704,6 +704,12 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, > int i; > int ret; > > + if (busnr > parent->busn_res.end) { > + dev_printk(KERN_DEBUG, &parent->dev, > + "can not alloc bus:%d under %pR\n", busnr, > + &parent->busn_res); > + return NULL; Can you take a look at 1820ffdccb9b ("PCI: Make sure bus number resources stay within their parents bounds") and 12d8706963f0 ("Revert "PCI: Make sure bus number resources stay within their parents bounds"")? This is implemented differently, but it seems like it might expose the same problem we found with 1820ffdccb9b. If you could take a look and confirm that "no, this does something differently than 1820ffdccb9b did" or "yes, this might expose that problem again," that would help. Bjorn > + } > /* > * Allocate a new bus, and inherit stuff from the parent.. > */ > -- > 2.6.2.307.g37023ba > > -- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/