From patchwork Wed Aug 1 17:31:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 10552755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F119913BF for ; Wed, 1 Aug 2018 17:32:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE2AB27F17 for ; Wed, 1 Aug 2018 17:32:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D289E28417; Wed, 1 Aug 2018 17:32:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7937E27F17 for ; Wed, 1 Aug 2018 17:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=ODav7tBne8xMG3rZu54jE02RpDU43dH+g6jcEy/cIdo=; b=oRJ zJ1GyN4RzX2LHkW9zVQRXmH56vo7t0pMtE3KiWD/kcO5NpFLh/krexp/cEKE1ngbDQ6bI9xK0tbOX lk/qs/DwQ+XZZSQR04jVl52aqAKe4lb6Fd5pnhuWB5buJGoyUR0vt43vzSSSGUwrknXbUOU+F3ojd jRBoDPA/0iMwAR80Jd1oMrOzSELTp2dumOL+ggDQcg1ZSzpKnXarrEJjynhWyEuct6X5OX9oD/PkI cIt++ub1MAMq7nGBFql32fSq0R/1NXY3oE3jdjg7OiR2nGWdkShYn8ZbjO2J3dHp1LjUS5cNmsgTv fySnp/9LLhoaE/IpOajYHzq09ck0eCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkuzK-0007gS-Jz; Wed, 01 Aug 2018 17:32:42 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkuzH-0007f1-9m for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 17:32:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 62A4480D; Wed, 1 Aug 2018 10:32:27 -0700 (PDT) Received: from localhost (e105922-lin.emea.arm.com [10.4.13.124]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 061B83F5BA; Wed, 1 Aug 2018 10:32:26 -0700 (PDT) From: Punit Agrawal To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: PCI: Remove node-local allocations when initialising host controller Date: Wed, 1 Aug 2018 18:31:34 +0100 Message-Id: <20180801173132.19739-1-punit.agrawal@arm.com> X-Mailer: git-send-email 2.18.0 X-ARM-No-Footer: FoSSMail X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_103239_345265_E44A0C0C X-CRM114-Status: GOOD ( 16.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Catalin Marinas , Punit Agrawal , Will Deacon , jeremy.linton@arm.com, bhelgaas@google.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Memory for host controller data structures is allocated local to the node to which the controller is associated with. This has been the behaviour since support for ACPI was added in commit 0cb0786bac15 ("ARM64: PCI: Support ACPI-based PCI host controller"). Drop the node local allocation as there is no benefit from doing so - the usage of these structures is independent from where the controller is located. It also causes problem during probe if the associated numa node hasn't been initialised due to booting with restricted cpus via kernel command line or where the node doesn't have cpus or memory associated with it. Signed-off-by: Punit Agrawal Cc: Catalin Marinas Cc: Will Deacon Cc: Lorenzo Pieralisi --- Hi, This came up in the context of investigating the boot issues reported due to restricted cpus or buggy firmware. Part of the problem is fixed by Lorenzo's rework of NUMA initialisation[0]. But there also doesn't seem to be any justification for using node-local allocation to begin with. Thanks, Punit [0] https://patchwork.kernel.org/patch/10486001/ arch/arm64/kernel/pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 0e2ea1c78542..bb85e2f4603f 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -165,16 +165,15 @@ static void pci_acpi_generic_release_info(struct acpi_pci_root_info *ci) /* Interface called from ACPI code to setup PCI host controller */ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) { - int node = acpi_get_node(root->device->handle); struct acpi_pci_generic_root_info *ri; struct pci_bus *bus, *child; struct acpi_pci_root_ops *root_ops; - ri = kzalloc_node(sizeof(*ri), GFP_KERNEL, node); + ri = kzalloc(sizeof(*ri), GFP_KERNEL); if (!ri) return NULL; - root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node); + root_ops = kzalloc(sizeof(*root_ops), GFP_KERNEL); if (!root_ops) { kfree(ri); return NULL;