Move network interface up operation (ifup) to work queue in RNDIS USB
device driver to avoid calling netdev_carrier_on API in interrupt context.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
The dump_lockholder() function in assert.c was directly accessing themutex->holder
member variable to print the mutex holder's thread ID inthe backtrace log. This is
incorrect because the holder field is aprivate implementation detail of the mutex structure,
and the properAPI nxmutex_get_holder() should be used to retrieve the holder ID.
Using the public API ensures consistency with mutex state management,avoids potential issues
with future changes to the mutex structure'sinternal layout, and adheres to the kernel's
encapsulation principles.
This fix corrects the log output to show the accurate mutex holder IDwhen assertion failures
related to mutex locks occur, improving thedebuggability of lock-related issues.
Signed-off-by: chao an <anchao.archer@bytedance.com>
The elf_emit() function in coredump.c was only checking for negative returnvalues
from lib_stream_puts() to detect write failures. However, lib_stream_puts()can return 0
to indicate that no bytes were written (e.g., due to stream full,end-of-file, or other
non-error conditions that prevent data writing).
This oversight meant that cases where lib_stream_puts() returned 0 would bypassthe error handling,
leading to incomplete data emission in the core dump withoutany failure indication.
The loop would continue attempting to write the remainingdata, resulting in partial or corrupted core dump files.
This fix modifies the condition from ret < 0 to ret <= 0 to:
1. Catch both error conditions (negative return values) and zero-byte writes.
2. Immediately break the write loop and propagate the failure, ensuring the core
dump process correctly aborts when data cannot be written.
This change improves the reliability of core dump generation by ensuring allfailed or
incomplete write attempts are properly handled, preventing corruptedcore dump files.
Signed-off-by: chao an <anchao.archer@bytedance.com>
The wait variable of the memory pool is modified to be controlled by macros, facilitating dynamic adjustment of its value via configuration macros.
Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
The wait member variable of the memory pool structure is not initialized, leading to undefined behavior of the memory pool.
Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
Refactor the logic for managing the .config file to ensure it aligns with Make behavior. Introduce a mechanism to set CONFIG_BASE_DEFCONFIG correctly and streamline the comparison process between .config and .config.orig, improving accuracy in detecting changes.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Refactor the process of comparing .config and .config.orig files by stripping CONFIG_BASE_DEFCONFIG lines to prevent false -dirty flags. Update .config to ensure it matches the expected Make behavior by writing the correct BASE_DEFCONFIG value.
Signed-off-by: Arjav Patel <arjav1528@gmail.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Move the implementation of nxsig_clockwait() into a separate file
to decouple it from nxsig_timedwait().
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
DEV_GPIO_NSIGNALS relies on signal support. Add an explicit Kconfig
dependency on SIGNALS to prevent invalid no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, remove the altmdm_timer-related
implementation and API definitions.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
The sim_bthcisock_interrupt() handler for Bluetooth HCI sockets in the simulatorwas using
an if statement to check for available data on the HCI socket. Thismeant that only a single
packet would be read and processed per interrupt trigger,even if multiple packets were waiting
in the socket buffer.
This led to incomplete data processing: unread packets would remain in the bufferuntil the next
interrupt tick, causing delayed handling of Bluetooth HCI events/commands,packet backlogs,
or missed data in high-throughput scenarios.
This fix replaces the if with a while loop to:
1. Continuously check for and read available data from the HCI socket until no more
packets are present in the buffer.
2. Ensure all pending HCI packets are processed in a single interrupt handler invocation.
3. Eliminate packet backlogs and reduce latency in Bluetooth HCI communication.
The change maintains the same core data reception logic (bthcisock_receive()) butensures it runs
for all available packets, improving the reliability and responsivenessof the simulator's Bluetooth HCI socket implementation.
Signed-off-by: chao an <anchao.archer@bytedance.com>
Raise the minimum required CMake version to 3.20,
as the build system now uses the `cmake_path()` command,
which is available starting from CMake 3.20.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When CONFIG_LIBM_TOOLCHAIN is enabled, include_next the toolchain\n<c\+\+>/cmath wrapper instead of importing symbols from the NuttX\ncmath shim. This avoids include-order recursion and lets libstdc\+\+\nresolve std::abs/std::acos/... against the matching toolchain C\nmath.h declarations.\n\nKeep the existing NuttX cmath namespace path unchanged for non-\ntoolchain libm configurations.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
To prevent reaching the 3MB limit on the CODEOWNERS file, this commit
replaces some multi-file entries with wildcard entries.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing
one in order for correct operation. This commits sets the value to 0 so
that CI builds may pass, but users who build this board will see a
warning indicate the steps for calibrating a new value.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing
one in order for correct operation. This commits sets the value to 0 so
that CI builds may pass, but users who build this board will see a
warning indicate the steps for calibrating a new value.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing
one in order for correct operation. This commits sets the value to 0 so
that CI builds may pass, but users who build this board will see a
warning indicate the steps for calibrating a new value.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing
one in order for correct operation. This commits sets the value to 0 so
that CI builds may pass, but users who build this board will see a
warning indicate the steps for calibrating a new value.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing
one in order for correct operation. This commits sets the value to 0 so
that CI builds may pass, but users who build this board will see a
warning indicate the steps for calibrating a new value.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Changes the default value for CONFIG_BOARD_LOOPSPERMSEC to -1, which is
invalid. All boards that forget to configure this value will encounter a
static assertion at compile time, enforcing that configurations
upstreamed to NuttX have calibrated values for correct delay timings.
Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the
busy-loop delay implementation and thus only have a run-time check to
ensure proper delay-timings (in the case where delays are used before
the alarm/timer driver is registered).
Some boards already in the NuttX upstream do not have calibrated values,
but there are no users who currently own the board to submit a
calibrated value for the configurations to use. In this scenario, the
value is temporarily set to 0 and a warning is displayed so that users
of these boards are informed of the calibration process.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This patch removes unnecessary and unimplemented function declarations in sched.h, fixing typos and cleaning up the header file.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
The current implementation retrieves time from the same source for both
CLOCK_BOOTTIME and CLOCK_MONOTONIC, which is incorrect. CLOCK_BOOTTIME
includes time spent in system suspend, whereas CLOCK_MONOTONIC does not.
This patch fixes the incorrect clock source handling and ensures the
two clocks are distinguished properly.
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>