FAILED: patch "[PATCH] LoongArch: Use pa_to_nid()/nid_to_addrbase() rather than hard-code" failed to apply to 5.10-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 244eb26bbd152896f976db6415550993cd60b46d
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 244eb26bbd152896f976db6415550993cd60b46d Mon Sep 17 00:00:00 2001
From: Huacai Chen <[email protected]>
Date: Tue, 27 Oct 2026 22:51:23 +0800
Subject: [PATCH] LoongArch: Use pa_to_nid()/nid_to_addrbase() rather than
hard-code
NODE_ADDRSPACE_SHIFT is 44 now but may be changed in future, so use pa_to_nid()/nid_to_addrbase() rather than hard-code.
--- arch/loongarch/include/asm/numa.h | 2 +- arch/loongarch/kernel/irq.c | 3 ++- arch/loongarch/pci/pci.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-)
arch/loongarch/include/asm/numa.h +1 -1
@@ -14,7 +14,7 @@#define NODE_ADDRSPACE_SHIFT 44#define pa_to_nid (addr) (((addr) & 0xf00000000000) >> NODE_ADDRSPACE_SHIFT) -#define nid_to_addrbase (nid) (_ULCAST_(nid) << NODE_ADDRSPACE_SHIFT) +#define nid_to_addrbase (nid) (_U64CAST_(nid) << NODE_ADDRSPACE_SHIFT)#ifdef CONFIG_NUMA
arch/loongarch/kernel/irq.c +2 -1
@@ -20,6 +20,7 @@#include <asm/irq.h> #include <asm/loongson.h> +#include <asm/numa.h> #include <asm/setup.h> DEFINE_PER_CPU(unsigned long, irq_stack);
@@ -69,7 +70,7 @@ static int __init early_pci_mcfg_parse(struct acpi_table_header *header)for (i =0 ; i < n; i++, mptr++) { msi_group[i].pci_segment = mptr->pci_segment; - pch_group[i].node = msi_group[i].node = (mptr->address >>44 ) &0xf ; + pch_group[i].node = msi_group[i].node =pa_to_nid (mptr->address); }return 0 ;
arch/loongarch/pci/pci.c +2 -1
@@ -12,6 +12,7 @@#include <linux/io-64-nonatomic-lo-hi.h> #include <asm/cacheflush.h> #include <asm/loongson.h> +#include <asm/numa.h> #define PCI_DEVICE_ID_LOONGSON_HOST 0x7a00#define PCI_DEVICE_ID_LOONGSON_DC1 0x7a06
@@ -43,7 +44,7 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,phys_addr_t mcfg_addr_init (int node) { -return (((u64 )node <<44 ) |MCFG_EXT_PCICFG_BASE ); +return (nid_to_addrbase (node) |MCFG_EXT_PCICFG_BASE ); }static int __init pcibios_init (void )
Signature · 1 line
2.53.0