dtls_tx() reserves a control buffer large enough for IPV6_PKTINFO, but
always passes the whole buffer as msg_controllen, also when it only
writes the smaller IP_PKTINFO cmsg. The rest of the buffer is zeroed,
so the stack reads it as a second cmsg with cmsg_len 0. For that cmsg
NET_CMSG_NXTHDR() returns the same cmsg again, so set_pkt_hoplimit()
in context_sendto() loops forever.
As in coap_server_sendto(), this happens on 64-bit targets with
16-byte z_max_align_t (x86_64, aarch64), where a second cmsghdr fits
after the IPv4 cmsg. A DTLS server then hangs on the first record it
sends to an IPv4 peer.
Set msg_controllen to NET_CMSG_SPACE() of the PKTINFO actually
written.
This regressed in commit 631a8ec97e ("net: coap_server: reply from
the correct local address").
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
coap_server_sendto() reserves a control buffer large enough for
IPV6_PKTINFO, but always passes the whole buffer as msg_controllen,
also when it only writes the smaller IP_PKTINFO cmsg. The rest of the
buffer is zeroed, so the stack reads it as a second cmsg with
cmsg_len 0. For that cmsg NET_CMSG_NXTHDR() returns the same cmsg
again, so set_pkt_hoplimit() in context_sendto() loops forever.
This happens when the space left after the IPv4 cmsg can hold a
cmsghdr. On 64-bit targets with 16-byte z_max_align_t (x86_64,
aarch64) the buffer is 48 bytes and a second header fits at offset
32. The CoAP server thread then spins on the first unicast IPv4
request and never replies. On native_sim/native/64 this hangs the
whole process. 32-bit targets such as Cortex-M are not affected,
because the remaining space is too small.
Set msg_controllen to NET_CMSG_SPACE() of the PKTINFO actually
written.
This regressed in commit 631a8ec97e ("net: coap_server: reply from
the correct local address").
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
transport_mgmt_get_other_transport() checks for the outgoing direction
in both branches. Asking for the other side of a bridge's incoming
transport with the incoming direction returns NULL, while asking with
the outgoing direction returns it.
The direction is the role of the given transport in the bridge, as for
transport_mgmt_is_bridged() and transport_mgmt_get_bridge(), so check
for the incoming direction in the first branch.
Fixes#121953
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
transport_mgmt_disconnect_bridge() returns -ENOTCONN for a bridge that
is not connected without releasing the transport management lock.
With CONFIG_MCUMGR_GRP_TRANSPORT_LOCKING, which is enabled by default,
the next lock then blocks forever. The SMP layer takes the lock for
every request and response when transport management is enabled, so
MCUmgr stops processing.
Release the lock before returning.
Fixes#121952
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
A detached section stays in the ELF buffer, but its address was
derived from the text region, which is only right while the text
region is also used in place. When the text region is copied,
e.g. because a coarse PMP granularity leaves the buffer
misaligned, calls into a detached section jumped into the copy
and relocations targeting it were applied outside the copied
text region.
Mark detached sections in the section map and take their address
from the ELF buffer.
Assisted-by: Claude:opus-5
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The responders walking the external records snapshot the count first
and read the pointer later, with nothing serializing them against
mdns_responder_set_ext_records(). Replacing or unregistering the table
in between makes the walk index the new pointer with the old count, and
an unregister returned while a response was still being built, so the
caller could free a table that was still in use. Guard the table with a
mutex held by the setter and for the whole record walk, so a returned
call means the records are no longer referenced.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The header documents a NULL records pointer as the way to unregister
the external record table before freeing it, but the function rejected
it with -EINVAL. Accept NULL with a zero count and clear the table;
keep rejecting NULL with a non-zero count and a non-NULL pointer with
a zero count.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fixes an issue whereby the list size was set to 0 when using the
get details for groups command as it did not count the number of
groups it would be returning
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The file of an upload or download was only closed after the transfer
when its length was non-zero, because a length of 0 also stands for an
unknown length, e.g. for an upload resumed at a non-zero offset. Empty
files were therefore kept open until the inactivity timeout. Whether
the length is known is now tracked separately.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
64-bit statistics were truncated to 32 bits, because they were encoded
with zcbor_uint32_put(). They are now encoded with zcbor_uint64_put().
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
stat_mgmt_count() passed a pointer to its counter pointer to
stats_walk(), so the counter of the caller was never incremented.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
The "& 0xff" mask for unsigned taskstat priorities was applied to the
result of zcbor_uint32_put() instead of to the priority. Because of
operator precedence it also bound the conditional expression the wrong
way. Negative priorities are now reported as 0-255 again.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
Uploading an empty file did not truncate an existing file, because the
file was only opened and truncated when the request carried data. A
request at offset 0 is now always processed, and fs_write() is skipped
for zero-length data.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Martin Stumpf <finomnis@gmail.com>
mcumgr_serial_process_frag_raw() takes a struct smp_hdr pointer that it
only ever overwrites with the start of the received data before reading
it, and its caller passes an uninitialised variable. Clang reports this
with -Wuninitialized, which fails the build as soon as the raw framing
code is compiled with the LLVM toolchain.
Make the header pointer a local variable of the function, and drop the
parameter and the unused variable in its caller.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
When the configuration descriptor read mismatch occurs, the function
exits, but the error code still contains 0 from the previous successful
read, so the calling function is informed that the configuration was
successful, even though the real state wasn't updated.
This fix explicitly returns error code.
Signed-off-by: Robert Khanafiev <robert.khanafiev@fischer-electronic.com>
bt_rfcomm_dlc_send() returns buf->len after it has put the buffer on
the DLC TX queue and scheduled the TX work. That work runs on the
Bluetooth workqueue, on another CPU or as soon as an interrupt preempts
the caller, and hands the buffer to L2CAP, which modifies and later
frees it. The returned byte count is then read from a buffer RFCOMM no
longer owns.
Read the length before queueing the buffer, and clear the pointer at
the handover with net_buf_take().
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The LLL marks the payloads of a burst as done by moving the current
burst number past the burst number, which the 4 bit field can not hold
for the largest burst number of 15. The counter wraps to 0 instead,
and the LLL goes on with the payload numbers of the previous burst.
Widen the field to 5 bits.
Tested for regressions with tests/bsim/bluetooth/ll/cis on nrf52_bsim.
No test with a burst number of 15 is added.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
When neither 2M nor Coded PHY is enabled, EVENT_DEFER_MAX is 0 and the
TRX busy iteration maximum is 0 too. The debug assert in the central and
peripheral is_abort callbacks then fails every time a connection event
is cancelled by an overlapping event, e.g. when a connection event with
more data runs into the next connection interval.
Only check the iteration count when deferral is supported.
Tested for regressions with tests/bsim/bluetooth/ll/conn on nrf52_bsim.
No test of a build without the 2M and Coded PHYs is added.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
StackSize and StackBase were swapped and StackUsage was uninitialized.
While at it, I reduced code duplication.
Signed-off-by: Gero Schwäricke <gero.schwaericke@sevenlab.de>
The previous commit fixed the CLOCK_DESCRIPTION parsing, which took the
TLV container with CONTAINER_OF() on the TLV itself instead of on the
tlv member of the container. Two more places did the same:
- the USER_DESCRIPTION parsing, which stored the description pointer
inside the received message instead of in the container;
- ptp_tlv_pre_send() for a CLOCK_DESCRIPTION, used when a management
message is forwarded to the other ports, which also converted the byte
order of the clock_desc pointer variables instead of the fields they
point to.
Give ptp_tlv_pre_send() the same pointer to the tlv member of the
container that ptp_tlv_post_recv() now takes, and get the container
from it in both places.
Add tests/net/ptp/tlv_mgmt, which runs tlv.c on a received
CLOCK_DESCRIPTION and USER_DESCRIPTION TLV and sends the first one on
again. Its three cases fail on main without the two commits.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Massimiliano Cialdi <massimiliano.cialdi@powersoft.com>
The PTP_TLV_TYPE_MANAGEMENT / PTP_MGMT_CLOCK_DESCRIPTION was
not working due to wrong use of CONTAINER_OF
Forward port of the v3.7-branch fix (#99673), which never reached main.
The test stubs of ptp_tlv_post_recv(), which main has and v3.7-branch
does not, follow the new signature.
Fixes#99527
(cherry picked from commit 889f556469)
Signed-off-by: Markus Suing <markussuing@eaton.com>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Massimiliano Cialdi <massimiliano.cialdi@powersoft.com>
When a BIG control PDU is pending, isr_rx() calls lll_chan_iso_event()
before starting the radio for the control subevent. The extra work
before radio_tmr_start_us() can make the start late and trip its
LL_ASSERT_ERR().
Calculate the control subevent channel in next_chan_calc_seq() and
next_chan_calc_int(), after the radio start of the last data subevent
is set up. When isr_rx() skips the remaining data subevents, or the last
BIS is not synchronized, isr_rx() still calculates the channel before
the start, as before.
Tested on two nRF5340 Audio DKs with zephyrproject-rtos/zephyr#120919
applied: without this change, a sink following a source that re-creates
its BIG hit the assert within six terminations in both runs.
Assisted-by: Claude:claude-opus-5.5
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
The Sink and Source PAC characteristics set the notify property under
CONFIG_BT_PAC_SNK_LOC_NOTIFIABLE and CONFIG_BT_PAC_SRC_LOC_NOTIFIABLE,
but their CCCD follows CONFIG_BT_PAC_SNK_NOTIFIABLE and
CONFIG_BT_PAC_SRC_NOTIFIABLE.
With only the PAC option set, a client's CCCD write is rejected with
CCC Improper Configuration. With only the location option set, the
property has no CCCD behind it.
Gate the property on the PAC option.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Arkadiusz Grzelka <devitwise@gmail.com>
Use the offset returned by the target to determine how many image bytes
were actually written instead of assuming that the complete requested
payload was accepted.
An SMP frame commonly carries up to 340 bytes of image data, but a target
may accept fewer bytes, for example 336 bytes, when the flash write size
must be aligned to a 16-byte boundary. Account for this behavior so the
client advances its source buffer by the target-confirmed amount and
continues the upload without losing data.
Signed-off-by: Martin Meyer <meyer.m90@gmail.com>
The RPMsg shell normally uses non-blocking sends during regular operation.
When all TX buffers are in use, rpmsg_trysend() fails and the shell core
cannot retry the output because the backend has no TX completion callback.
Add an option to force the existing blocking mode so applications can wait
for an available RPMsg TX buffer when output loss is not acceptable.
Signed-off-by: Takumi Ando <takumi@spacecubics.com>
Commit fixes configuration of the sequence store rate.
KConfig picks up the first met default option.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
An LE credit-based connection request or response may carry 0 initial
credits. l2cap_chan_tx_give_credits() still set BT_L2CAP_STATUS_OUT for
such a grant, reporting the channel as sendable. An SDU queued before the
peer granted credits then never went out: l2cap_data_pull() dropped the
channel from the ready list for lack of credits, and the first real grant
found the bit already set and did not add the channel back.
Ignore grants of 0 credits, so that the first real grant sets the bit and
resumes TX.
Fixes#121544
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
CONFIG_MCUMGR_TRANSPORT_UART_ASYNC=y fails to build unless the
unrelated CONFIG_UART_CONSOLE_MCUMGR=y is also set. The RX timeout added
by commit 3b9cd7b9cb ("drivers: console: uart_mcumgr: Add async
timeout") is defined under UART_CONSOLE_MCUMGR, the UART console's
MCUmgr passthrough, so CONFIG_UART_CONSOLE_MCUMGR_ASYNC_RX_TIMEOUT_US
is undefined in any other configuration.
Move the option next to the other MCUmgr UART async options as
MCUMGR_TRANSPORT_UART_ASYNC_RX_TIMEOUT_US, under
MCUMGR_TRANSPORT_UART_ASYNC, which guards the driver code that uses
it. The prompt, default and help text are unchanged. The option has
not been in a release, so it is renamed without a deprecation period.
Tested by building samples/subsys/mgmt/mcumgr/smp_svr for
nrf52840dk/nrf52840 with serial.conf and the asynchronous UART API,
which fails without this change.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
bt_disable() completes the commands that are still queued when it
closes the HCI transport, but not the one that has been handed to the
driver. A command that another thread sends while bt_disable() waits
for the controller to be reset is transmitted once the controller has
responded to the reset. The transport is then closed before the
response to the command arrives, and its sender waits for the command
timeout, which ends in an assertion.
Complete the command in flight with an error once the transport has
been closed, since nothing can respond to it any more.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
When send_buf() fails, typically because the HCI driver failed to send
the packet, the TX processor gives the connection up and disconnects
it. bt_conn_disconnect() waits for its HCI command, and the TX
processor is what transmits commands: with
CONFIG_BT_TX_PROCESSOR_THREAD, the default, it waits for a command
that it cannot send, holding the host lock, until the command times
out and the Host asserts.
Leave the disconnecting to the Bluetooth workqueue, which can wait for
the command. The connection is flagged for it, and the TX processor
passes a flagged connection over for as long as it is connected, so
that nothing more is sent on it while it is being disconnected. A
connection that is still connected after that, because the command
failed, loses the flag and goes on sending. A disconnected one loses
it too, as a central CIS keeps its object for its next connection.
A BIS is left alone: it cannot be disconnected on its own, and
terminating its BIG would take the other BISes down too. What failed
to go out on it is lost, and sending goes on.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
bt_disable() clears BT_DEV_READY and then waits for the controller to
be reset, with the connections still in place since
commit 78ea662dfe ("Bluetooth: Host: Reset controller before conn
teardown in bt_disable()"). Data sent meanwhile is dropped by
send_buf(), the Host being no longer ready, which the TX processor
takes for a fatal error and answers by disconnecting the connection.
That is a synchronous HCI command issued from the thread that
transmits commands, so it waits for a command that it cannot send, and
does so holding the host lock. With CONFIG_BT_SMP bt_disable() takes
that lock once the controller has been reset and never gets to purge
the command queue, which would have ended the wait: both threads stay
blocked until the command times out and the Host asserts.
Seen with auto-pts, which powers the tester off while a broadcast
source is streaming.
Have the TX processor pass over the connections while the Host is not
ready, before it takes anything from them. What is queued stays where
it is until bt_disable() tears the connections down, as for any
connection that goes away with data queued, or until the Host is ready
again after a failed reset, which now restarts the TX processor.
That replaces the check in send_buf(), which came too late: the upper
layer had by then accounted for the data as handed over, and the
failure was reported to a callback running in the TX processor.
bt_disable() now clears BT_DEV_READY under the host lock, which the TX
processor holds for a whole pass, so that the flag does not change
under a pass that another thread is in the middle of.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
New inode allocation remains committed when file or directory creation
fails after allocation. The caller only drops the in-memory reference; the
inode remains allocated on disk.
Keep removal pending until initial creation succeeds. Mark later creation
failures for cleanup through the existing inode-drop path.
Fixes#118139
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
The close path returns early when inode sync or drop fails, leaving the
file slab object and public file handle allocated. An abandoned handle can
then exhaust the ext2 file and inode pools.
Always attempt inode cleanup and release the file object. Treat a repeated
close of the cleaned handle as a no-op so the public handle can be cleared.
Fixes#118141
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
Formatting dereferences inode-table block allocations without checking
them, and two directory allocation failures return positive ENOMEM.
Format callers only recognize negative errors, so either case can fault or
report a failed format as successful.
Check allocations before use and return -ENOMEM for allocation failures.
Fixes#118138
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
ext2_inode_drop() compacts the inode pool after removing an entry, so an
increasing close-loop index skips the entry moved into that slot. The close
path also returns before releasing group blocks when metadata commit fails.
Process compacted entries at the current index and preserve cleanup errors.
Always release group blocks and synchronize the backend.
Fixes#118140
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
The metadata commit helpers return before releasing the temporary block
when ext2_write_block() fails. This leaks slab allocations on each failed
metadata write.
Drop the block before returning the write error.
Fixes#118137
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
udc_virtual reports High-Speed from devicetree alone, so on a
Full-Speed-only build "usbd defaults" added a High-Speed configuration
and failed with -ENOTSUP. Guard it with USBD_SUPPORTS_HIGH_SPEED, as
sample_usbd_init.c already does.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
pm_system_resume() clears z_cpus_pm_state[id] before the system_suspend
exit hook reads it, so every successful suspend was traced as
PM_STATE_ACTIVE. Latch the state before entering it and report that.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
The inode read and write paths return a later block error after
earlier bytes have completed. The file wrapper therefore leaves its offset
despite completed write data already being persisted.
Return completed byte counts after later block errors and persist the size
reached by completed writes.
Fixes#118142
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
bt_smp_encrypt_change() clears BT_SMP_DIST_LINK_KEY inside its Secure
Connections branch, and the comment there already says these bits double
as the pairing-finished indicator. On the legacy path the bit is never
cleared, so with CONFIG_BT_CLASSIC=y and CONFIG_BT_SMP_SC_PAIR_ONLY=n,
against a peer that sets LinkKey while Secure Connections is not
selected, local_dist keeps BT_SMP_DIST_LINK_KEY after key distribution
has finished. The `if (!smp->local_dist && !smp->remote_dist)` checks
never become true, smp_pairing_complete() is never called, and the SMP
timeout eventually reports the pairing as failed even though the link is
encrypted and the keys were exchanged.
Move the clearing out of the Secure Connections branch, leaving only
SMP_FLAG_DERIVE_LK inside it. A link key can only be derived from a
Secure Connections LTK, so the bit has nothing to signal on the legacy
path. Nothing on air changes.
Signed-off-by: Zhijie Zhong <zhongzhijie1@xiaomi.com>
Assisted-by: Kiro:claude-opus-5
bt_l2cap_br_connless_send() adds the PSM to the buffer before sending,
and returned the buffer to the caller with the PSM still added when
sending failed, although the caller keeps the buffer on error.
Remove the PSM again when sending fails, and document that the caller
gets the buffer back unchanged.
Tested with tests/bluetooth/host_l2cap_br_send on native_sim.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
In basic mode, bt_l2cap_br_send_cb() added the L2CAP header before
checking that the buffer's user data has room for the send callback.
When that check failed, the caller, who keeps the buffer on error, got
it back with the header added, for example from bt_l2cap_chan_send().
Check the user data before adding the header.
Tested with tests/bluetooth/host_l2cap_br_send on native_sim.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Espressif SoCs set CONFIG_MMU_PAGE_SIZE to 64 KB for their flash cache
MMU without enabling CONFIG_MMU. With the RISC-V PMP enabled, as on
ESP32-H2, the memblk heap block size then has to be a multiple of 64 KB
and the llext.readonly_mmu.memblk build fails a static assertion. Take
LLEXT_PAGE_SIZE from CONFIG_MMU_PAGE_SIZE only when CONFIG_MMU is set.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Mark the early system timer resume prompt as experimental and remove
redundant resume-ordering notes from the PM documentation.
Use CMake's LINKER syntax for the timer idle-exit wrapper. Restrict
the two timer-order tests to GNU ld or LLD toolchains, and explain
why they require SysTick without an LPM companion.
Keep both PM resume sequences unchanged.
All five power management configurations were built and run on
qemu_cortex_m3 with the GNU toolchain; all 48 tests passed.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Restore the legacy system PM resume sequence by default: resume
system-managed devices, run SoC exit post-ops, notify state exit,
and perform system timer idle-exit accounting.
Keep the sequence introduced by #118977 behind the default-off
PM_EARLY_SYSTEM_TIMER_RESUME option, which selects EXPERIMENTAL.
Platforms enabling it must validate SoC and timer dependencies and
timeout callbacks that can run before devices have resumed. The
legacy sequence retains its stopped-timer busy-wait limitation.
Leave STM32 LPTIM unchanged and document both resume sequences. Add
QEMU tests for exact resume ordering, IRQ masking, and timer progress
during device resume.
All 48 tests across five QEMU configurations pass. Build STM32U5
STOP3 and STM32WBA S2RAM. Validate both sequences on FRDM-MCXN947
for ten S2RAM cycles each, including busy-waits in experimental
device resume callbacks. STM32 runtime validation remains pending.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
Solve two issues:
* Other storage modes than CONFIG_BT_MESH_RPL_STORAGE_MODE_SETTINGS
could not reuse the pending store scheduler used by the settings
backend.
* The store timing of SRPL, which is always stored through the
Settings subsystem, would use CONFIG_BT_MESH_RPL_STORE_TIMEOUT if
RPL was also stored in settings via
CONFIG_BT_MESH_RPL_STORAGE_MODE_SETTINGS, but not if another storage
mode was used for RPL.
Decouple the store scheduler from the Settings subsystem and the
chosen RPL storage mode, so the scheduler code and the separate
CONFIG_BT_MESH_RPL_STORE_TIMEOUT option are
a) Available regardless of storage mode, and always used for SRPL when
set and
b) Available without CONFIG_BT_SETTINGS, in case an RPL storage mode
does not need Settings but would like the scheduling.
Also change the BT_MESH_SETTINGS_RPL_RESET_PENDING to always store
immediately. This was in practice already the case whenever settings was
used, since this was only ever scheduled right before a second NO_WAIT
configuration was scheduled (like net key, IV, etc.). Now this behavior
is consistent both with and without BT_SETTINGS enabled.
Assisted-by: Copilot:claude-sonnet-5.5
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
Enable the MCUboot bootutil library when the MCUmgr image management
server or client is enabled.
Add a Zephyr-side Kconfig option for linking applications with the
MCUboot bootutil headers and select the bootutil library from the
MCUmgr image management Kconfig symbols.
This ensures the required bootutil dependency is enabled automatically
for MCUmgr image management functionality.
Signed-off-by: Martin Meyer <meyer.m90@gmail.com>
When the Controller is missing, unpowered or does not run HCI, the first
command that bt_enable() sends times out, and the Host asserts:
ASSERTION FAIL [err == 0] @ .../bluetooth/host/hci_core.c:572
Controller unresponsive, command opcode 0x0c03 timeout with err -11
An application cannot handle this, so Bluetooth cannot be optional at run
time, for example on a board with the Controller on a plug-in module.
The Host now records whether the Controller has sent a packet while
bt_enable() runs. When bt_hci_cmd_send_sync() times out waiting for a
response during bt_enable(), and the Controller has not sent anything,
the Host closes the transport, as bt_disable() does, and bt_enable() fails
with -ETIMEDOUT. The close stops a late response from completing a
command whose sender has returned. Because the transport is closed,
bt_enable() can be called again. This also applies to a command that the
TX processor thread never sends, such as HCI Reset with CONFIG_BT_WAIT_NOP
when no NOP arrives: the close completes it.
The Host still asserts when a command times out after the Controller has
responded. Such a Controller is present but faulty, and once packets have
come in, a clean failure needs the RX teardown that bt_disable() does. The
record is kept across HCI Reset, so a Controller that answers HCI Reset
and then stops also causes the assert. The Host also asserts when the
driver cannot close the transport, and, without
CONFIG_BT_TX_PROCESSOR_THREAD, when a command sent from the system work
queue cannot be sent.
The transport must not be closed while the driver is in send(), and a
send() can outlast the command timeout. The TX processor holds the host
lock during send(), so the Host takes the lock without waiting before it
closes the transport. When the lock is not free, the Host asserts.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Vandra-Meyer Akos <akos@lvgl.io>
Several LOG_ and __ASSERT format strings use %u or %d for arguments
that are size_t or ssize_t, which produces -Wformat= warnings on
LP64 targets (e.g. AArch64). Switch to %zu / %zd.
* subsys/bluetooth/host/classic/sdp.c: three format strings that
compare against sizeof() or use ssize_t counters.
* drivers/bluetooth/hci/hci_nxp_setup.c: matching V1 and V3
"Out of sending buffer range" messages (both LOG_ERR and the
neighbouring __ASSERT that uses the same string).
No functional change; eliminates 5 build warnings on
nitrogen93_smarc/mimx9352/a55/nx611.
Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>