Message ID | 20231025142820.390238-2-apatel@ventanamicro.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers | show |
Series | Linux RISC-V AIA Preparatory Series | expand |
Context | Check | Description |
---|---|---|
conchuod/vmtest-for-next-PR | fail | PR summary |
conchuod/patch-1-test-1 | fail | .github/scripts/patches/build_rv32_defconfig.sh |
conchuod/patch-1-test-2 | fail | .github/scripts/patches/build_rv64_clang_allmodconfig.sh |
conchuod/patch-1-test-3 | fail | .github/scripts/patches/build_rv64_gcc_allmodconfig.sh |
conchuod/patch-1-test-4 | fail | .github/scripts/patches/build_rv64_nommu_k210_defconfig.sh |
conchuod/patch-1-test-5 | fail | .github/scripts/patches/build_rv64_nommu_virt_defconfig.sh |
conchuod/patch-1-test-6 | success | .github/scripts/patches/checkpatch.sh |
conchuod/patch-1-test-7 | success | .github/scripts/patches/dtb_warn_rv64.sh |
conchuod/patch-1-test-8 | success | .github/scripts/patches/header_inline.sh |
conchuod/patch-1-test-9 | success | .github/scripts/patches/kdoc.sh |
conchuod/patch-1-test-10 | success | .github/scripts/patches/module_param.sh |
conchuod/patch-1-test-11 | success | .github/scripts/patches/verify_fixes.sh |
conchuod/patch-1-test-12 | success | .github/scripts/patches/verify_signedoff.sh |
On Wed, Oct 25 2023 at 19:58, Anup Patel wrote: > The riscv_of_processor_hartid() used by riscv_of_parent_hartid() fails > for HARTs disabled in the DT. This results in the following warning > thrown by the RISC-V INTC driver for the E-core on SiFive boards: > > [ 0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller > > The riscv_of_parent_hartid() is only expected to read the hartid from > the DT so we should directly call of_get_cpu_hwid() instead of calling We should? Or maybe not? Please write precise changelogs and use imperative wording as documented in Documentation/process.
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index c17dacb1141c..157ace8b262c 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -125,13 +125,14 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo */ int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid) { - int rc; - for (; node; node = node->parent) { if (of_device_is_compatible(node, "riscv")) { - rc = riscv_of_processor_hartid(node, hartid); - if (!rc) - return 0; + *hartid = (unsigned long)of_get_cpu_hwid(node, 0); + if (*hartid == ~0UL) { + pr_warn("Found CPU without hart ID\n"); + return -ENODEV; + } + return 0; } }