From patchwork Tue Sep 22 23:49:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 7246471 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EB08E9F39B for ; Tue, 22 Sep 2015 23:52:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14CE8209B0 for ; Tue, 22 Sep 2015 23:52:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 416A4208D5 for ; Tue, 22 Sep 2015 23:52:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeXK2-0005uS-B9; Tue, 22 Sep 2015 23:50:06 +0000 Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeXJj-0005U9-Mv for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2015 23:49:48 +0000 Received: by igxx6 with SMTP id x6so19322824igx.1 for ; Tue, 22 Sep 2015 16:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gBEI68H6K8P6QATIRXaRxkmLfUzVF0VfJVVlE9co0y4=; b=qOCSAcyMGzLgVr0mIGJ65TORFnstskc+T5RzauVYlgAhDWuL75vveYusWsT70h4Ub2 D6Kwyqr/DZDrh6z/2QB6nYQE7Mx6ClVQrY6loOGftoWZ9RKKBxfImwZplloAyXFaRBDo SgU59JLVW4cYHmNFEMMi/2I9RoNi4G00Ta0XSkveBSPRPCzflqITHxbn8XCu6YzYwKhG 9f9KdY/73q+2A8T+6zAeObwCNsY6poUbi2J92xxexfM9A0eAQfdybmlZq5DNtC3JU1Gw fEpdy3Bq4qeXf56U3AfO4f5d0Wd8mjNAYJ+pOuPYh0dpEwBdjuP0IpUfXAuACBfuNDBx GJ7w== X-Received: by 10.50.21.3 with SMTP id r3mr12109434ige.94.1442965766870; Tue, 22 Sep 2015 16:49:26 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by smtp.gmail.com with ESMTPSA id z5sm2121729igl.21.2015.09.22.16.49.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 22 Sep 2015 16:49:25 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id t8MNnNXV012986; Tue, 22 Sep 2015 16:49:23 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id t8MNnNFP012985; Tue, 22 Sep 2015 16:49:23 -0700 From: David Daney To: linux-kernel@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Will Deacon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Marc Zyngier Subject: [PATCH v3 5/6] PCI: generic: Pass proper starting bus number to pci_scan_root_bus(). Date: Tue, 22 Sep 2015 16:49:16 -0700 Message-Id: <1442965757-12925-6-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1442965757-12925-1-git-send-email-ddaney.cavm@gmail.com> References: <1442965757-12925-1-git-send-email-ddaney.cavm@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150922_164947_865183_8509822E X-CRM114-Status: GOOD ( 12.93 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Daney If the bus is being configured with a bus-range that does not start at zero, pass that starting bus number to pci_scan_root_bus(). Passing the incorrect value of zero causes attempted config accesses outside of the supported range, which cascades to an OOPs spew and eventual kernel panic. Acked-by: Will Deacon Signed-off-by: David Daney --- No change from v1 or v2. drivers/pci/host/pci-host-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-host-generic.c b/drivers/pci/host/pci-host-generic.c index 0a9c453..e364232 100644 --- a/drivers/pci/host/pci-host-generic.c +++ b/drivers/pci/host/pci-host-generic.c @@ -259,7 +259,7 @@ static int gen_pci_probe(struct platform_device *pdev) if (!pci_has_flag(PCI_PROBE_ONLY)) pci_add_flags(PCI_REASSIGN_ALL_RSRC | PCI_REASSIGN_ALL_BUS); - bus = pci_scan_root_bus(dev, 0, + bus = pci_scan_root_bus(dev, pci->cfg.bus_range->start, &pci->cfg.ops.ops, pci, &pci->resources); if (!bus) { dev_err(dev, "Scanning rootbus failed");