• Mike Rapoport (Microsoft)'s avatar
    of, numa: return -EINVAL when no numa-node-id is found · 7e488677
    Mike Rapoport (Microsoft) authored
    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.
    
    Link: https://lkml.kernel.org/r/20240807064110.1003856-24-rppt@kernel.orgSigned-off-by: default avatarMike Rapoport (Microsoft) <rppt@kernel.org>
    Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> [arm64 + CXL via QEMU]
    Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
    Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Andreas Larsson <andreas@gaisler.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Davidlohr Bueso <dave@stgolabs.net>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Huacai Chen <chenhuacai@kernel.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
    Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Rafael J. Wysocki <rafael@kernel.org>
    Cc: Rob Herring (Arm) <robh@kernel.org>
    Cc: Samuel Holland <samuel.holland@sifive.com>
    Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: Zi Yan <ziy@nvidia.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    7e488677
of_numa.c 3.94 KB