From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEDBBC2D0E2 for ; Tue, 22 Sep 2020 10:35:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 634AB239A1 for ; Tue, 22 Sep 2020 10:35:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NX9uznMv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 634AB239A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=y8s3rKNwHXQZ3o8rxiRhb1GOcO7DBI7HJejcBF4CuDk=; b=NX9uznMvphrZOx1JdGiaB3YTCd SpTIEggshzl578d4PutCTw+O6lgI1O75EMHjXQsEcQ9eQnJrJkd64MgYuyYkywU6LRAaje24MLBNp cLsnj3vSkHqqJwVTdWabPWfhx6LOLCrThdhmv+diYVksvHe6wVGFOmWO6rxT/YV6JzdRTtIMsaL+m DPdo+t0uUJANNx55K5r7hdINZ+K/Yr4Gr0+IrKyrHpbyqyFKdP6yWDXMjWr2Mb4WSfmYke0euuaHZ uTiw/6xEPLf46LZ1VjdEw8E3EJVkQ35QDU94zgRvk3hWMzkVzSiNNb30YEiq9hhy6uC9sKanXrSlc izKWZn2Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfcL-0004aA-C5; Tue, 22 Sep 2020 10:33:49 +0000 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKfcH-0004Y8-3G for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2020 10:33:47 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R191e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04420; MF=baolin.wang@linux.alibaba.com; NM=1; PH=DS; RN=6; SR=0; TI=SMTPD_---0U9liOx3_1600770811; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0U9liOx3_1600770811) by smtp.aliyun-inc.com(127.0.0.1); Tue, 22 Sep 2020 18:33:31 +0800 From: Baolin Wang To: catalin.marinas@arm.com, will@kernel.org Subject: [PATCH] arm64: PCI: Validate the node before setting node id for root bus Date: Tue, 22 Sep 2020 18:33:24 +0800 Message-Id: <1600770804-116365-1-git-send-email-baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200922_063345_797262_FEFAB1C2 X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: baolin.wang7@gmail.com, linux-arm-kernel@lists.infradead.org, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If the BIOS disabled the NUMA configuration, but did not change the proximity domain description in the SRAT table, so the PCI root bus device may get a incorrect node id by acpi_get_node(). Thus better to add a numa node validation before setting numa node for the PCI root bus, like pci_acpi_root_get_node() does for X86 architecture. Signed-off-by: Baolin Wang --- arch/arm64/kernel/pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 1006ed2..24fe2bd 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -86,9 +86,13 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) struct pci_config_window *cfg = bridge->bus->sysdata; struct acpi_device *adev = to_acpi_device(cfg->parent); struct device *bus_dev = &bridge->bus->dev; + int node = acpi_get_node(acpi_device_handle(adev)); + + if (node != NUMA_NO_NODE && !node_online(node)) + node = NUMA_NO_NODE; ACPI_COMPANION_SET(&bridge->dev, adev); - set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev))); + set_dev_node(bus_dev, node); } return 0; -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel