From patchwork Thu Aug 1 06:08:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13749756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58477C3DA64 for ; Thu, 1 Aug 2024 06:13:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E50306B00BF; Thu, 1 Aug 2024 02:13:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDAD36B00C0; Thu, 1 Aug 2024 02:13:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C52DF6B00C1; Thu, 1 Aug 2024 02:13:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A5E326B00BF for ; Thu, 1 Aug 2024 02:13:18 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 602421608E1 for ; Thu, 1 Aug 2024 06:13:18 +0000 (UTC) X-FDA: 82402659276.15.94B9FC2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id BC444A0009 for ; Thu, 1 Aug 2024 06:13:16 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pqPSECnC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722492750; a=rsa-sha256; cv=none; b=TjKpecyQoy4wPuxizLQwXjHSd41aswCelgo3off0sBmthwhZSedskLF6XuK6QXyspdEQ2r lcSgjJ+80j/7Smam1pSS05aQ//6TUx5zslJBif4nzZUh+O4RzTVPGYHHGbCQ/ruYipZ0dt r/m6R+0KF5qnx0qiHVRKMl+YyJUx360= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pqPSECnC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722492750; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QRa6MsaZCxWeQl/Ai32u7E5M5KUGTAfpa3fP02pDjE0=; b=hopkK9iXceuyduEfsFXbVtJSKlf50d0gJNoeln0feH9oldRs4MCWiPnzhSIRHaVlzwVawN A4imWi8etflYYp3Li4+3JPEjr+VEelkBSy8hvlSGpZQhS5WlDQ3U6u+trWpN/wVHUjWS5D 5favl6zq/ZLoIuP/JuDIYEPRs0gCcdQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 04D8B62779; Thu, 1 Aug 2024 06:13:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9FA9C4AF0A; Thu, 1 Aug 2024 06:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722492795; bh=wgBkv6gb0pPzoMRiWhD0EVSQTy0zZwrH+GjPrFy0JG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pqPSECnC0eM5g/zSNnOAmjrOasiIzwPA6z/+g6VkF4/et9bbVvssBzCmMrT2fH2FH s8h76/CNsq3n19tI98+vSyv3i90mhkvLpBDaWko03EvTXamnFlNQgmpdo+G83yUOyx QyLtENSdzXa9vkqCaNUDnt/UF6i2lx9sq7bccco42lDyUnUu3rXB+g1cBh06tVNc9Z O/TqPVS7+0XmmBYN3tsp7y8r/0t3RnE/Zo1cRWYh4hXoZOIuKMzLdquIzKitbNSpQR n3IeWHly9yw4naiZQqSAl7QY2ittG7QUqkHNN9dFTUw1WtpMMeCmArHNdljr08O4Fn RoQH6f0HaoqCg== From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev , Andreas Larsson , Andrew Morton , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dan Williams , Dave Hansen , David Hildenbrand , "David S. Miller" , Davidlohr Bueso , Greg Kroah-Hartman , Heiko Carstens , Huacai Chen , Ingo Molnar , Jiaxun Yang , John Paul Adrian Glaubitz , Jonathan Cameron , Jonathan Corbet , Michael Ellerman , Mike Rapoport , Palmer Dabbelt , "Rafael J. Wysocki" , Rob Herring , Samuel Holland , Thomas Bogendoerfer , Thomas Gleixner , Vasily Gorbik , Will Deacon , Zi Yan , devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, nvdimm@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Subject: [PATCH v3 23/26] of, numa: return -EINVAL when no numa-node-id is found Date: Thu, 1 Aug 2024 09:08:23 +0300 Message-ID: <20240801060826.559858-24-rppt@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240801060826.559858-1-rppt@kernel.org> References: <20240801060826.559858-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: BC444A0009 X-Stat-Signature: 5m7yew8564wx9kb4n39mio7y8ytx4sba X-Rspam-User: X-HE-Tag: 1722492796-922861 X-HE-Meta: U2FsdGVkX19d8Ev4/YJZc6R/UxlTA+P5XWu1+IIE0DtOXzhpnb3rWdGzyxO/4WVfpu6u0fDD6p97q+mct/H/RGSgQo8RjFz+rUEPJbrqdrO2h1fSbMEjTiqrFGhqH93ii+32RwL6oe13Uo6blMfB3eGqDDzSWtB6l+CDkU4tiBFwz6qpOhrouKuAgFiuGgPrPoz7yORsrS3xxbo1g8ZF95xd/KJvcAezli8z38jplCzKWYtxFlal8gIJ+E7uwSX1A1t7ZzKNO9St/M3p41vV7bv86H8mhmf+wuFrCbzbR2e3hY7s6atZ14owWq5cN+64D+uu1P65Ce2VsgaDhPuLew97S60UgYpOuTimRkqFGI00jr9fP2z8DK0HlB/7ePDat3dGWBdj8hCVjRlGPph7MFF5ilQbD3M3YHz/QPAUoS/RPshwiUK/0zkFAVA8lZuJuj+CTkpmj/YqIKdNU9aX072a25EApfPujdRktT9wdTS3jnD3lrVjI4nnBfFw9k3dA5moQwhwGt89/w+14Ma8KkMWwNpd+LkYCL+r7if+R5r5xN+ULaX17JYd3OAPHemACcpLTn0dkAk33SFhbYQDAIsjNRNyMXxSjdRpLNP5Z8VlzSr2XpS6J/ZSVhJ7RU1sSmrlGQN4jbMBjSYBQUSWmmdFhzMliRc2d9OF0BWRFGoarMJYSQErnFc8NjcFjMkhaFq1SU6wzB+Xcw9rOR60Q8gtISL0n2DdxfHEc3QXb9UC99Uu8bNE4HU5+CEqTPB5pB/zMELQeFzQyOcwMb5o+cFXqWGBDy0zthvtyjrvpo7OicSEjtNev+S8t2ZxLQ4i/3bjBMC3qnd66Idx+jZu8lDCHp2SpioXfLIT0Kh7JwovoTdqawKH1S+MZu5eis68n7IRNivPERwES9iIzrzS5/iWrTL03TzwaQlmgth450mUqXAiPnblkoA4QHnvDLVSWZwv1p5T8wqokdPEmIP zo13nBf2 dgxLNfRoIuUHo65cKUUHeb8Pk7p2aAyLDdNBjcw9RqJHYiBp8roiM0n8f0e1AI7wkjk70vR3Y305L5MTzbJE5fH6IjZaWSNWOEwI7PIbSbcPIGhE8oejPICECT3yRMhwfsIJD1eVqGDHNUy0vhfE30vHGrOaQ76jdVfB4roPymvyHkKHcadWIn3cjZzI7reLKpSSrPKkj1B/U4UDslbWO3sW+mN30mfnaz1eJ4B0VF1emXsBlidHTDudFiJ7cGHQX0H2TWJUZoHLqpWi4mcM8IG7Mag== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: "Mike Rapoport (Microsoft)" Currently of_numa_parse_memory_nodes() returns 0 if no "memory" node in device tree contains "numa-node-id" property. This makes of_numa_init() to return "success" despite no NUMA nodes were actually parsed and set up. arch_numa workarounds this by returning an error if numa_nodes_parsed is empty. numa_memblks however would WARN() in such case and since it will be used by arch_numa shortly, such warning is not desirable. Make sure of_numa_init() returns -EINVAL when no NUMA node information was found in the device tree. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Acked-by: David Hildenbrand --- drivers/of/of_numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 838747e319a2..2ec20886d176 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c @@ -45,7 +45,7 @@ static int __init of_numa_parse_memory_nodes(void) struct device_node *np = NULL; struct resource rsrc; u32 nid; - int i, r; + int i, r = -EINVAL; for_each_node_by_type(np, "memory") { r = of_property_read_u32(np, "numa-node-id", &nid); @@ -72,7 +72,7 @@ static int __init of_numa_parse_memory_nodes(void) } } - return 0; + return r; } static int __init of_numa_parse_distance_map_v1(struct device_node *map)