Commit graph

136,983 commits

Author SHA1 Message Date
Zafer SEN
5f01a3d236 lwm2m: remove redundant NULL check in _INIT_OBJ_RES_INST
Drop the unnecessary _ri_ptr NULL check, as multi-instance resources
always provide a valid instance array when _ri_count > 0. This
simplifies the initialization logic and prevents compile time warrning
messages/noice.

Signed-off-by: Zafer SEN <zafersn93@gmail.com>
2026-04-03 14:56:14 -05:00
Pieter De Gendt
1c6c57f4d8 scripts: ci: check_compliance.py: Add --all-commits argument
Besides a custom range to run the compliance checks, allow to run on all
commits to HEAD.
This is useful when testing locally, to verify existing files in tree.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-03 14:52:51 -05:00
Daniel Leung
04df4a4aa2 xtensa: correctly flush stack when creating new thread
On a cache incoherent system, we need to make sure the caching
of stack space is properly flushed to memory when creating new
threads. This is especially important if the thread starts
running on the CPU other than the one initializing the thread.
Without flushing, the other CPU would not have the up-to-date
data to correctly start the thread.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-04-03 14:51:56 -05:00
Carlo Caione
1a2d905469 scripts: ci: add compliance check for device MMIO API usage
Add a DeviceMmioCheck to check_compliance.py that flags driver files
casting DT_REG_ADDR() or DT_INST_REG_ADDR() to a pointer without
using the device MMIO API.

    .base = (SomeType *)DT_INST_REG_ADDR(n),

This stores the raw physical address and dereferences it directly. On
systems with an MMU, the physical address has no page table entry and
the access will fault unless someone else has created an identity
mapping (typically via mmu_regions.c).

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2026-04-03 14:51:27 -05:00
Laura Carlesso
f82d97e3d5 soc: infineon: edge: Force syslib assembly relocation to ramfunc/itcm
The syslib delay function are implemented in an assembly file.
Even with the relocation done in CMakeLists.txt this file does not
properly get copied because gen_relocate_app.py does not keep
in consideration plain regions (e.g. just .text rather than .text.xyz).
Therefore force the relocation using the ramfunc and itcm linker
section for cm33 and cm55 respectively.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-04-03 14:48:04 -05:00
Laura Carlesso
3baf4090de board: infineon: kit_pse84_ai: Add DTCM and ITCM regions to board
For cm55 where dtcm and itcm regions are available,
add the chosen attribute.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-04-03 14:48:04 -05:00
Laura Carlesso
a3177bd575 soc: infineon: edge: Correct linker regions
The linker region rwdata was including sections ramfunc
and itcm which should instead be placed in a code region.
Created itcm_mem.ld and ramfunc_mem.ld for cm55 and
cm33 respectfully to place the section accordingly.
Added the linker sources in cmakelists.txt

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-04-03 14:48:04 -05:00
Laura Carlesso
3a026add24 soc: infineon: edge: Correct initialization of MPU regions and linker fix
Now that the cores have dedicated executable regions
for the code relocation, give executable permissions only
to those rather than the entire RAM region.
Additionally, removed the rwdata exception for the assembly
file given that it now gets properly placed in the correct region
by the relocate script.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-04-03 14:48:04 -05:00
Laura Carlesso
8da4601754 modules: hal_infineon: Specify exact regions for code relocations
Rathenr that use the general RAM region for relocating
code use the dedicated memory region for each individual
core/partition.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-04-03 14:48:04 -05:00
Laura Carlesso
2491baf282 boards: infineon: Update memory map with specific ram execution regions
Added designation of RAM regions for code execution on
cm33 cores so that they can be properly used for relocation
and have specific executable flag in the MPU initialization.

Signed-off-by: Laura Carlesso <laura.carlesso@infineon.com>
2026-04-03 14:48:04 -05:00
Taha Benderli
517cfd37d8 net: l2: ethernet: fix order of address check
ethernet_update_tx_stats checks the multicast address first and then the
broadcast which causes the broadcast address to be treated as multicast
and not counted correctly.Fix this by checking broadcast address first,
followed by the multicast address.

Signed-off-by: Taha Benderli <taha.benderli@analog.com>
2026-04-03 23:18:26 +09:00
Ibrahim Abdalkader
455e70d068 soc: xlnx: zynqmp: use imply instead of select for ARM_MPU
Change 'select ARM_MPU' to 'imply ARM_MPU' so that tests and
applications can override it with CONFIG_ARM_MPU=n. The previous
'select' caused a prefetch abort in the LLEXT module_build sample,
which disables MPU to allow execution from heap-allocated memory.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-04-03 23:16:53 +09:00
Fabrice DJIATSA
7a21cd3c10 samples: drivers: lora: add filter for stm32wl scenarios
Update filter so non-concerned platforms can't execute the test.

With theses changes, board like b_l072z_lrwan1 with "semtech,sx1276"
compatible can't run these tests.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-04-03 23:15:19 +09:00
Fengming Ye
f75db68d03 kernel: workq: not yield when current workq is empty
Workq optionally yield after every work handler to avoid starving
other threads.
When current workq is empty after this work handler, current thread
will go to sleep in next loop. So no need to yield, bringing one more
schedule cost.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2026-04-03 23:15:04 +09:00
Nikhil Namjoshi
c12f7b566c net: Add net_pkt_skip error handling
There are several areas in the networking stack where this is missing.
So make sure we add it.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-03 23:14:47 +09:00
Nikhil Namjoshi
f98624455c net: Update net_calc_chksum to return err code on failure
`net_calc_chksum` is designed to return uint16_t checksum.
Its current behavior is to return 0 checksum on error
(or on an empty payload) and a valid non zero checksum for non empty
payloads. 0 could be a valid checksum for empty payload.

So update the `net_calc_chksum` and its wrapper's definition to
return error codes.

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-03 23:14:47 +09:00
Lucas Romero
32f7b0f231 twister: fix harmful wait on virtual com port
that can never succeed because it is not in the com port filter list.
This would trigger every time that a combination of --flash-before and
--serial-pty is used.

The list of monitored serial ports - at least on linux - does not contain
/dev/pts but that list is constantly checked if the /dev/pts/X device might
magically appear some day.

This is the proper fix instead of adding /dev/pts/* to the monitor list
because the reason why we need to wait is because in the codepath without
serial_pty, we might be resetting the target device, causing the dev node
to disappear/reappear. This is not the case for the virtual ports created
for serial_pty.

Signed-off-by: Lucas Romero <lucas.romero@a-labs.io>
2026-04-03 23:14:12 +09:00
Nikhil Namjoshi
86fd0944c5 net: tcp: Fix potential underflow in tcp data length
tcp_options_len calculation in tcp_data_len can underflow
if th_off(th) is less than 5. This can lead to a huge
tcp_options_len value and subsequently a wrong data length calculation.
Add the checks in tcp_recv() which is a top API, so that the checks
are covered at the entry point.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/106657

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-04-03 23:13:33 +09:00
Peter Mitsis
df630e09ae kernel: Fix timeout handler for delayable work
Between the points in time when sys_clock_announce() calls the
timeout handler for delayable work and when that handler wins
the work queue spinlock another thread or ISR could have called
k_work_reschedule_for_queue(). Should this occur, the timeout
that the handler is trying to process becomes stale and the
handler should not proceed any further with it.

As the workqueue spinlock is the controlling lock (it is always
held before either aborting or adding a timeout), it is safe
for the handler to call z_is_timeout_handler_canceled() once
it holds the workqueue spinlock.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2026-04-03 23:13:23 +09:00
Peter Mitsis
f9376ddde5 kernel: Fix gap in workqueue work timeout
The workqueue work timeout feature is supposed to abort the work
queue thread if the time to execute a work item exceeds the work
queue's configured threshold. The work thread may race against the
timeout handler responsible for aborting the thread when the two
are running on separate CPUs--particularly since the timeout handler
only locks the workqueue spinlock for part of its duration.

To get around this, two separate flags must be checked a 'finished'
flag to indicate that the thread has finished processing the work
item and the timeout's flag indicating if it has been removed while
processing its timeout handler. Should either be found to be true
within in the timeout handler, the thread is deemed to have completed
in time and the timeout handler proceeds no further.

Otherwise the timeout handler is deemed to have won the race and the
workqueue thread is aborted. Should the workqueue thread detect this,
it goes to sleep until it can be aborted to prevent it from handling
any more work items.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2026-04-03 23:13:23 +09:00
Nicolas Pitre
5a3c601e71 kernel: track announcing state in timeout dticks field
The routine sys_clock_announce() removes the timeout from the timeout
list and unlocks the timeout spinlock before invoking the timeout's
handler. This creates a window where another ISR (or a thread running
on another CPU) can abort or reuse the timeout before the handler
executes. When this happens, the timeout handler should bail early.

Use the dticks field to carry this state: set it to
TIMEOUT_DTICKS_ANNOUNCING after remove_timeout() (which needs
dticks = 0 to propagate remaining ticks) and before calling the
handler. In z_abort_timeout(), set TIMEOUT_DTICKS_ABORTED when the
timeout is either linked (existing behavior) or in the announcing
state (new). The z_add_timeout() path naturally overwrites dticks
with a real tick value, so re-use is also detected.

Provide z_is_timeout_handler_canceled() for handlers to check if
they should bail. This avoids adding a flags field to struct _timeout,
keeping the struct size unchanged.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-04-03 23:13:23 +09:00
Mirai SHINJO
02b5ab3c9e arch: riscv: remove unused stdio.h include
arch/riscv/core/thread.c does not use any stdio symbols.
Therefore, remove the unused include.

No functional change.

Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
2026-04-03 23:13:10 +09:00
Pieter De Gendt
9f043928c0 scripts: ci: check_compliance.py: Speedup adding testcase results
The result property getter rebuilds the list from XML children every
access, and the setter removes all existing results then re-appends them
all. So self.case.result += [res] is O(n²) over time.

self.case.append(res) directly appends to the underlying XML element in
O(1), bypassing the expensive property entirely.

Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-04-03 23:12:51 +09:00
Fabrice DJIATSA
46f2c75b21 drivers: watchdog: stm32: stm32wb0 series don't support *_FreezePeriph
STM32WB0 watchdog does not support disable the Debug
module during STANDBY mode once the DBGMCU
clock is enabled.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-04-03 23:12:22 +09:00
Jordan Yates
07f1481906 storage: stream: stream_flash: check size overflow
Add an initialisation time check for stream flash that the requested
offset and size does not overflow `size_t`. This in turn ensures that
`inspect_device` doesn't erroneously return `0` if the addition would
have overflowed.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-04-03 23:11:34 +09:00
Sylvio Alves
97fc526073 soc: esp32: fix SPIRAM memtest default to disabled
The SPI SRAM memory test runs on the entire mapped PSRAM
region during boot. At lower clock speeds (e.g. 40MHz),
this can take over 10 seconds for a 4MB device, delaying
startup significantly.

Remove the default y so the memtest is opt-in. Users can
still enable it with CONFIG_ESP_SPIRAM_MEMTEST=y when
needed for hardware validation.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-03 23:10:58 +09:00
Sylvio Alves
e26cfb1d9d soc: esp32: fix SPIRAM heap address to use runtime mapping
The SPIRAM heap address was set from the linker symbol
_ext_ram_heap_start, which may not match the actual MMU
mapping at runtime. On SoCs with unified cache (C5, C6,
H2), the virtual address depends on MMU page allocation
and can differ from the linker estimate.

Use esp_psram_get_mapped_region() to obtain the actual
mapped address and size at runtime.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-03 23:10:58 +09:00
Sylvio Alves
a5be8aafca soc: esp32c5: fix SPIRAM linker script mapping
The ext_dram_seg was placed at DROM_SEG_ORG + DROM_SEG_LEN
(0x43000000), but the MMU maps PSRAM into the first free
pages in the unified cache address space (0x42000000+).
This mismatch caused the SPIRAM heap to point to unmapped
memory, resulting in data corruption and crashes.

Move ext_dram_seg origin to IROM_SEG_ORG and add an
.ext_ram.dummy section that skips past both IROM and DROM
MMU page reservations, matching the runtime behavior of
esp_mmu_map_reserve_block_with_caps().

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-03 23:10:58 +09:00
Yangbo Lu
dbdc3939e6 net: qbv_shell: fix variable without initialization
Some variables were used without initialization causing
command failure. Fixed them.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2026-04-03 23:10:23 +09:00
Maureen Helm
5c1b82e4d3 release: Zephyr 4.4.0-rc2 v4.4.0-rc2
Set version to v4.4.0-rc2.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2026-04-02 14:29:04 -05:00
Jamie McCrae
0ee28025a4 boards: nordic: Remove duplicate documentation blurb
Removes information that is duplicated and should have been removed
a year prior as this information is now automatically generated by
the documentation build and is always updated, rather than
referencing the same copy and pasted block that was out of date
years ago

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-04-02 13:14:06 -05:00
Sylvio Alves
d473e33fc6 drivers: mbox: espressif: fix missing guard for ESP32-C5
If building mbox driver for ESP32-C5, it fails due to
invalid headers. Add needed guard for that SoC.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-02 13:13:17 -05:00
Kapil Bhatt
41a85d9a8f modules: hostap: Adjust memories for p2p and enterprise
When Enterprise and P2P both enabled it takes P2P size.
But for Enterprise it requires more.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-04-02 13:11:50 -05:00
yueling hu
763626c19c drivers: flash: shell: Fix result for test command
Fix return value issue when comparing errors

Fixes:   drivers/flash/flash_shell.c

Signed-off-by: yueling hu <502966985@qq.com>
2026-04-02 13:09:19 -05:00
Benjamin Cabé
75c9794045 samples: net: wireguard: increase CONFIG_MAIN_STACK_SIZE
On real hardware, the main stack seems to be ever so slightly too small,
so increase it based on observed actual usage on FRDM-MCXN947.

main  : STACK: unused 7016 usage 1176 / 8192 (14 %); CPU: 4 %
      : Total CPU cycles used: 81758333
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-02 08:52:29 -05:00
Matthias Hauser
e2b7e6f063 boards: we: move UART30 pins to port P0
UART30 is only supported on P0 pins

Signed-off-by: Matthias Hauser <matthias.hauser@we-online.de>
2026-04-02 08:52:08 -05:00
The Nguyen
c2e14b90bd boards: renesas: correct setting for SDRAM on aik_ra8d1
Correct setting for on-board SDRAM to 9bit bus-width.

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2026-04-02 08:51:32 -05:00
The Nguyen
878fc2b949 boards: renesas: correct mipi_dsi connector label for aik_ra8d1
The interrupt input on the touch panel should be labeled on
port_irq12 on this board.

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2026-04-02 08:51:32 -05:00
The Nguyen
5199cc23ea boards: renesas: fix wrong zephyr,canbus chosen on aik_ra8d1
zephyr,canbus should be chosen for canfd0 on this board.

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2026-04-02 08:51:32 -05:00
Anand Kumar
93bed12c18 clock: esp32: treat already-enabled clock as success
Return 0 from clock_control_esp32_on() when the peripheral clock is
already on, matching clock_control_on() success semantics.

Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
2026-04-02 08:51:00 -05:00
Anand Kumar
27cf607152 tests: clock_control: allow double-start success or -EALREADY
Second clock_control_on() may return 0 or -EALREADY when the clock is
already on; assert it stays ON. Prepares for ESP32 clock_control
returning success when already enabled.

Signed-off-by: Anand Kumar <anandvtu16158@gmail.com>
2026-04-02 08:51:00 -05:00
Guillaume Gautier
582d237f47 doc: releases: update migration guide for STM32 SPI pin slew-rate
Update migration guide to include the change of slew-rate for the STM32
SPI pins.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2026-04-02 08:50:13 -05:00
Sylvio Alves
78cd957f97 soc: espressif: fix soc_random ref count underflow on mcuboot
soc_random_enable() was called inside hardware_init() which
only runs for CONFIG_MCUBOOT and CONFIG_ESP_SIMPLE_BOOT. For
MCUboot-loaded apps (CONFIG_BOOTLOADER_MCUBOOT), hardware_init
is skipped, so soc_random_enable() never ran. However,
soc_random_disable() was called unconditionally in loader.c,
causing periph_module_disable() to decrement the peripheral
clock reference counter below zero. This prevented
periph_module_enable() from actually enabling the hardware
clock for any peripheral touched by soc_random_disable(),
such as I2S0 on ESP32, breaking drivers that depend on it.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-04-02 08:50:03 -05:00
Krzysztof Chruściński
7579ccc68e modules: hal_nordic: nrfs: Fix initialization priority
NRFS initialization must happen after the IPC service. Setting
the same priority may lead to locking if NRFS initialization
happens before the IPC.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-02 08:49:17 -05:00
Krzysztof Chruściński
f0c7574695 soc: nordic: common: mram_latency: Move initialization to the POST_KERNEL
Move to the post kernel. Set priority which is higher than the
IPC service and NRFS.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-04-02 08:49:17 -05:00
Aksel Skauge Mellbye
315da11745 drivers: adc: siwx91x: Fix clock configuration
Since `a78cd34` the ADC driver did not correctly configure
its internal divisor. The responsibility was moved from the
clock control driver to the ADC driver and the `init` function
of the ADC driver was updated accordingly. But the driver
continued calling the clock control API from the `configure`
function, leading to `-EINVAL` being returned.

Correctly configure the internal divisor in the ADC driver by
calling the HAL API directly.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2026-04-02 08:48:48 -05:00
Muzaffar Ahmed
84e95b9046 drivers: wifi: siwx91x: Fix twt_capable by inferring it from link mode
The twt_capable field in wifi status earlier was hardcoded to true. It
seems better to set it to true only when the link mode is 802.11ax or
higher.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2026-04-02 08:48:26 -05:00
Benjamin Cabé
4f49b07771 dts: bindings: fix p_state description
The P in p_state stands for Performance, not Power
Also, separator character must be TAB

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-02 08:48:04 -05:00
Benjamin Cabé
53cad47b28 dts: bindings: add binding type descriptions
Adds a few recently added the descriptions for a few recently added
binding types.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-02 08:48:04 -05:00
Benjamin Cabé
5eaf23d723 doc: _scripts: gen_devicetree_rest.py: sort binding types alphabetically
Fix alphabetically sorting for binding types as it was previously
putting abbreviation (for which "raw" text started with ':abbr:...') as
first in the list.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-02 08:48:04 -05:00