From 648dcbaded9059ad6d9b47af9787de9512f97a8c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Sat, 18 Oct 2025 14:02:49 +0100 Subject: [PATCH 1/3] [nrf fromtree] arch: riscv: core: vector_table: Fix local ISR generation Fixes local ISR generation so that devices actually boot, also allows enabling LTO for these builds (tested working on nrf54l15 flpr device) Signed-off-by: Jamie McCrae (cherry picked from commit 4023752a5c6eb70f3dd27bf310e8d9a9d9b3ed1f) --- arch/riscv/core/vector_table.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/core/vector_table.ld b/arch/riscv/core/vector_table.ld index 8509ff8eb87c..6a93082ed894 100644 --- a/arch/riscv/core/vector_table.ld +++ b/arch/riscv/core/vector_table.ld @@ -5,8 +5,8 @@ */ #if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) -INCLUDE isr_tables_vt.ld KEEP(*(.vectors.__start)) +INCLUDE isr_tables_vt.ld #else KEEP(*(.vectors.*)) #endif From e71013917144a90230bdd8736872d41e12462fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Wed, 8 Oct 2025 13:41:16 +0200 Subject: [PATCH 2/3] [nrf fromtree] kernel: work: work timeout handler uninitialized variables fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit work and handler pointers are local and not initialized. Initialize them with NULL to avoid compiler error maybe-uninitialized. Signed-off-by: Łukasz Stępnicki (cherry picked from commit 6571f4e1bcf4b615a32b0483299017102c297997) --- kernel/work.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/work.c b/kernel/work.c index bcbb3b467166..301d138fac7c 100644 --- a/kernel/work.c +++ b/kernel/work.c @@ -606,8 +606,8 @@ bool k_work_cancel_sync(struct k_work *work, static void work_timeout_handler(struct _timeout *record) { struct k_work_q *queue = CONTAINER_OF(record, struct k_work_q, work_timeout_record); - struct k_work *work; - k_work_handler_t handler; + struct k_work *work = NULL; + k_work_handler_t handler = NULL; const char *name; const char *space = " "; From 623f436ed25413c0c4e1dd5fb0b5f273ff53af21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20St=C4=99pnicki?= Date: Fri, 24 Oct 2025 13:33:13 +0200 Subject: [PATCH 3/3] [nrf fromtree] arch: riscv: core: vector_table alignement fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For RISCV vector table needs to be aligned depending on CONFIG_ARCH_IRQ_VECTOR_TABLE_ALIGN. This was missing when using LTO making issues when direct ISR were in use. Signed-off-by: Łukasz Stępnicki (cherry picked from commit a825e014d858eb2badd600da6f3163e413b6bf3f) --- arch/riscv/core/vector_table.ld | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/core/vector_table.ld b/arch/riscv/core/vector_table.ld index 6a93082ed894..5667b8935b8e 100644 --- a/arch/riscv/core/vector_table.ld +++ b/arch/riscv/core/vector_table.ld @@ -6,6 +6,7 @@ #if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION) KEEP(*(.vectors.__start)) +. = ALIGN(CONFIG_ARCH_IRQ_VECTOR_TABLE_ALIGN); INCLUDE isr_tables_vt.ld #else KEEP(*(.vectors.*))