From patchwork Mon Dec 7 17:20:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jayachandran Chandrashekaran X-Patchwork-Id: 57807 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp1270984lbb; Mon, 7 Dec 2015 08:59:36 -0800 (PST) X-Received: by 10.66.136.108 with SMTP id pz12mr26939539pab.93.1449507574602; Mon, 07 Dec 2015 08:59:34 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ll4si2438686pab.39.2015.12.07.08.59.34; Mon, 07 Dec 2015 08:59:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756270AbbLGQ7c (ORCPT + 6 others); Mon, 7 Dec 2015 11:59:32 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:35402 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756195AbbLGQ7a (ORCPT ); Mon, 7 Dec 2015 11:59:30 -0500 X-IronPort-AV: E=Sophos;i="5.20,395,1444719600"; d="scan'208";a="82455504" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw3-out.broadcom.com with ESMTP; 07 Dec 2015 09:33:34 -0800 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 7 Dec 2015 08:59:29 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.3.235.1; Mon, 7 Dec 2015 08:59:29 -0800 Received: from netl-snoppy.ban.broadcom.com (unknown [10.132.128.129]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 6667241012; Mon, 7 Dec 2015 08:56:03 -0800 (PST) From: Jayachandran C To: , Bjorn Helgaas , , Arnd Bergmann , CC: Jayachandran C , Lorenzo Pieralisi , Tomasz Nowicki Subject: [RFC PATCH v2 2/4] PCI: Handle NULL parent in pci_bus_assign_domain_nr Date: Mon, 7 Dec 2015 22:50:27 +0530 Message-ID: <1449508829-10797-3-git-send-email-jchandra@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449508829-10797-1-git-send-email-jchandra@broadcom.com> References: <1449508829-10797-1-git-send-email-jchandra@broadcom.com> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org pci_create_root_bus is called with NULL as parent in ACPI. On arm64 this ends up calling pci_bus_assign_domain_nr, which crashes when dereferencing parent. To fix this, update pci_bus_assign_domain_nr to return if parent is NULL. Setting up the domain number will be handled from pcibios_root_bridge_prepare on arm64 when booted with ACPI. Signed-off-by: Jayachandran C --- drivers/pci/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 314db8c..a96c356 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4772,8 +4772,13 @@ int pci_get_new_domain_nr(void) void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent) { static int use_dt_domains = -1; - int domain = of_get_pci_domain_nr(parent->of_node); + int domain; + /* in case of ACPI, parent is NULL */ + if (parent == NULL) + return; + + domain = of_get_pci_domain_nr(parent->of_node); /* * Check DT domain and use_dt_domains values. *