From patchwork Fri Sep 11 23:21:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 517050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5FA5614012C for ; Sat, 12 Sep 2015 09:23:33 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=c8C9VBix; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755936AbbIKXXV (ORCPT ); Fri, 11 Sep 2015 19:23:21 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:33896 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754986AbbIKXWK (ORCPT ); Fri, 11 Sep 2015 19:22:10 -0400 Received: by iofb144 with SMTP id b144so115382463iof.1; Fri, 11 Sep 2015 16:22:09 -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=fZNTFz0meeq0udMklgISKhA1sOo03TMptyUoH/Aafkw=; b=c8C9VBixek8MeH7Is9Vi7HG51gdgHbhK89FORG1beB0zXUscnKj4zEuRVHpJqaOvMr niA0ILm325I9saox925RP3hYixBBryuLHcYDGeihs4nEdYWijTot6t5+iOK9yiW49bR8 7lZbZY9eqKfQjuT0Aj3wAIYoTAHSh3k+IZ7O3airrd/vCzuitgQOg/uch4lpPD8ZpGoR 0k9bFKWehdjkiI+Meq/5zcx4tNcD6ZkhJHJWV7+mfIJd7K9D5ZApn6Reev7eRs2gVLUu wFzuI33+MTHCDxoIOn/Jbr77CWQPDYGtamOIkpEqVFjRrAYiMPdaI4DsY4KIZRrn+EyK VVzA== X-Received: by 10.107.152.12 with SMTP id a12mr7219470ioe.148.1442013729344; Fri, 11 Sep 2015 16:22:09 -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 o10sm642556igp.22.2015.09.11.16.22.04 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 11 Sep 2015 16:22:08 -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 t8BNM45q005062; Fri, 11 Sep 2015 16:22:04 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id t8BNM3Ch005061; Fri, 11 Sep 2015 16:22:03 -0700 From: David Daney To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Frank Rowand , Grant Likely , Bjorn Helgaas , linux-pci@vger.kernel.org, Will Deacon , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linux-arm-kernel@lists.infradead.org Cc: David Daney Subject: [PATCH 5/6] PCI: generic: Pass proper starting bus number to pci_scan_root_bus(). Date: Fri, 11 Sep 2015 16:21:58 -0700 Message-Id: <1442013719-5001-6-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1442013719-5001-1-git-send-email-ddaney.cavm@gmail.com> References: <1442013719-5001-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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. Signed-off-by: David Daney Acked-by: Will Deacon --- 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 fce5bf7..8219c0b 100644 --- a/drivers/pci/host/pci-host-generic.c +++ b/drivers/pci/host/pci-host-generic.c @@ -265,7 +265,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");