Commit graph

63241 commits

Author SHA1 Message Date
Felipe Moura
4d3c5cac46 drivers/sensors/sensor: always report POLLIN for fetch only sensor
A fetch() only lower half reads the device on demand, so its data is
always available and there is never anything to wait for. The upper half
did not reflect that: poll() only reported POLLIN when the descriptor was
opened O_NONBLOCK, and a blocking read() waited on buffersem, which is
only posted when the lower half drives notify_event from an interrupt of
its own.

A fetch() only sensor with no interrupt therefore never satisfied
poll()/read() at all. This is not hypothetical: in the in tree
nucleo-h563zi:dts configuration CONFIG_STM32_DTS_TRIGGER defaults to 0,
which selects stm32_dts_fetch(), and no CONFIG_STM32_DTS_ITEN_* option is
enabled, so the DTS interrupt never fires. A blocking read() on that
sensor waits forever, even though stm32_dts_fetch() performs a complete
software triggered measurement on its own and needs no interrupt at all.
Applications had to work around this by forcing O_NONBLOCK on the
descriptor themselves, see apache/nuttx-apps#3686.

Drop the O_NONBLOCK special case in both paths: sensor_poll() now always
reports POLLIN for a fetch only sensor and sensor_read() calls fetch()
directly instead of waiting. Update the sensor_ops_s::fetch
documentation, which described the old contract.

With the wait gone, buffersem has no waiters left. Its only two readers
were the ones removed here, both in the fetch path: the wait in
sensor_read() and the nxsem_get_value() in sensor_poll(). The remaining
nxsem_post() calls in sensor_push_event() and sensor_notify_event() had
nothing left to wake, so drop the semaphore and those posts as well.

Assisted-by: Claude:claude-sonnet-5

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 12:50:12 +02:00
Felipe Moura
3dbc455480 drivers/sensors/l3gd20: always deliver samples with push_event
The driver had two modes selected by CONFIG_SENSORS_L3GD20_BUFFER_SIZE:
with a buffer it pushed samples from a work queue, and without one it
exposed fetch() while still using the data ready interrupt to signal
readiness through notify_event.

That second mode misuses the fetch interface. fetch() means the data is
read from the device on demand and is therefore always available, while
an interrupt driven sensor is exactly what push_event is for. Mixing the
two forces the upper half to guess whether a fetch() only lower half
will ever notify, and it makes poll() unusable in a multi descriptor
loop, because the descriptor reports ready while the read still has to
wait for the next interrupt.

Drop the fetch path and always use the work queue and push_event, which
is what the driver already did by default since BUFFER_SIZE defaults to
1. CONFIG_SENSORS_L3GD20_BUFFER_SIZE gains a range of 1 to 32, as a zero
sized buffer no longer has a meaning, and SCHED_HPWORK is now selected
unconditionally because the work queue is always used.

No in tree configuration enables this driver and the previous default
already took the push path, so no defconfig changes are needed.

Assisted-by: Claude:claude-sonnet-5

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-05 12:50:12 +02:00
dependabot[bot]
dd8b78f0e1 build(deps): bump docker/login-action from 4.5.1 to 4.6.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 4.5.1 to 4.6.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](abd2ef45e7...dbcb813823)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-05 12:38:32 +02:00
dependabot[bot]
52b26ac1eb build(deps): bump actions/github-script from 7 to 9
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 9.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-05 12:37:50 +02:00
zhekunren
c8f6c8b72d net/tcp/tcp_send: Remove work_available check when updating retransmit timer
The condition work_available(&conn->work) && tx_unacked != 0
prevented tcp_update_retrantimer from being called when the work
queue was still busy, leaving conn->timer stale or zero on
subsequent sends. This caused the RTT estimation to compute a
false RTT (m = rto - 0 = rto), creating a positive feedback loop
that inflated the RTO to extreme values (e.g., 232 half-seconds
= ~116 seconds).

Fix: remove the work_available check so that tcp_update_retrantimer
is always called when there is unacknowledged data. The decision to
re-queue the work is handled internally by tcp_update_timer.

Signed-off-by: zhekunren <zhekunren@qq.com>
2026-08-05 10:56:59 +02:00
fangyibo
ecacc7bc7c Documentation/audio: document the audio upper half interface
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
The audio subsystem page listed the source files and the configuration
options, but nothing about the interface the upper half presents to
applications.  PR #18348 added a device state machine, a second buffer
allocation mode, poll and mmap support and several new ioctls, none of
which were described anywhere, so the only way to learn the expected
call sequence was to read audio/audio.c.

Document what the upper half now guarantees:

  - the device state machine, and the fact that AUDIOIOC_START is
    rejected until AUDIOIOC_CONFIGURE has moved the device out of
    AUDIO_STATE_OPEN;
  - the normal open/configure/allocate/enqueue/start sequence;
  - the two AUDIOIOC_ALLOCBUFFER modes selected by u.pbuffer, who owns
    the buffers in each, and that a shared ring request may return zero
    when the ring is already populated;
  - that AUDIOIOC_GETBUFFERINFO also establishes the shared ring depth,
    so a lower half which does not implement it disables that mode;
  - the poll event semantics and how mmap() selects between a ring
    buffer and the device status by requested length;
  - all ioctls handled by the upper half, grouped by purpose;
  - how per-open state is aggregated into the device state when several
    applications share one device.

No functional change.

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-08-05 07:58:53 +02:00
fangyibo
975ab1d9aa audio: limit the buffer count guard to shared ring requests
The upper->periods >= upper->nbuffers check sat at the top of
audio_allocbuffer(), but upper->periods is only incremented for shared
ring requests (u.pbuffer == NULL), so for private buffer callers the
check degenerated into "nbuffers == 0" and rejected every allocation
when the lower half does not implement AUDIOIOC_GETBUFFERINFO, which is
the only place nbuffers is ever assigned.

Move the guard inside the shared ring branch so private buffers, which
never enter upper->apbs[] and are unrelated to the ring depth, stay
allocatable. The zero return value is kept as-is because a second
application attaching to the same device relies on it to skip
allocation and go straight to AUDIOIOC_ENQUEUEBUFFER.

Signed-off-by: fangyibo <fangyibo@xiaomi.com>
2026-08-05 07:58:53 +02:00
William Byatt
506542e91a video/rgbcolors: Fix RGBTO8 to use the high bits of each component.
RGBTO8 shifted each component up before masking:

    (((uint8_t)(r) << 5) & 0xe0)

The cast is promoted to int before the shift, so the mask keeps bits 5:7
of the shifted value, which are bits 0:2 of r.  The macro therefore
encoded the three least significant bits of red and green and the two
least significant bits of blue, rather than the most significant.

This disagrees with RGBTO16 in the same file, which correctly takes the
high bits, and with RGB8RED/RGB8GREEN/RGB8BLUE immediately below it,
which are documented as the inverse transformation but read the result
as high bits.

All in-tree callers pass full 8-bit components, so all were affected:
RGBTO8(39, 64, 139) in apps/examples/nxterm, intended as midnight blue,
evaluates to 0xe3 -- full red plus full blue, i.e. magenta.

Take the high bits instead, so that RGBTO8 matches RGBTO16 and the
RGB8xxx macros become its true inverse.

Tested on a RISC-V LiteX/VexRiscv target with an 8bpp RGB332 frame
buffer, and with a host round-trip check over all 256 representable
colours.

Assisted-by: Claude:claude-opus-5
Signed-off-by: William Byatt <william@byatt.io>
2026-08-04 21:17:48 -03:00
Felipe Moura
184ba318cd Documentation/mpu6050: document the data ready interrupt mode
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
The registration example showed the three argument form, which no longer
compiles, and fetch() as the only way samples are taken. Update it, add
a section on the two acquisition modes and the attach() a board provides
for the interrupt one, and state the 100 Hz sample rate.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-04 17:40:28 -03:00
Felipe Moura
6a12133160 drivers/sensors/mpu6050: deliver samples from the data ready interrupt
fetch() timestamps a sample when the application asks for it, not when
the device measured it, and reads accel and gyro separately so the two
topics never share an instant. Add an optional push mode behind
CONFIG_SENSORS_MPU6050_INT: the board supplies mpu6050_config_s::attach,
the handler timestamps and defers to HPWORK, and the worker reads once
and pushes both topics. The I2C read cannot run in the interrupt.

The mode is chosen at build time, so fetch() is simply left out of the
ops table and out of the build when the option is set: an instance uses
one model or the other, never the mixture that made poll() unusable on
l3gd20. A board that enables it without attach fails with -EINVAL.

Also set CONFIG so the DLPF is on. Left at reset the gyroscope output is
8 kHz, not 1 kHz, so SMPLRT_DIV 9 gave 800 Hz rather than the documented
100 Hz; measured 833 Hz before and 101 Hz after. fetch() hid this since
the application set the pace.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-04 17:40:28 -03:00
shichunma
80c30d97b0 drivers/usbdev/rndis: Fix reported MTU OID sizes
RNDIS reports Ethernet packet sizing to the host through NDIS OIDs.
OID_GEN_MAXIMUM_FRAME_SIZE is the MTU-style value and excludes the
link-layer header, while CONFIG_NET_ETH_PKTSIZE includes the Ethernet
header.

Report the frame size as CONFIG_NET_ETH_PKTSIZE - ETH_HDRLEN, and
report OID_GEN_MAXIMUM_TOTAL_SIZE as CONFIG_NET_ETH_PKTSIZE instead of
a hardcoded 2048.

Assisted-by: OpenAI Codex:GPT-5
Signed-off-by: shichunma <shichunma@bestechnic.com>
2026-08-04 17:39:56 -03:00
Marco Casaroli
eba1d9561b ci: Build the documentation from its lock file.
The documentation job installs with `pipenv install`, which does not honour
the committed Pipfile.lock.  Every run in the logs prints "Locking
dependencies..." and "Updated Pipfile.lock" and then installs from the set it
has just re-resolved, so each build takes whatever PyPI resolves that day
rather than what the lock file names.

On the evening of 2026-08-03 that resolution produced a virtualenv without
packaging, and four unrelated pull requests failed identically, before Sphinx
had read a single file:

  File ".../sphinx/extension.py", line 7, in <module>
      from packaging.version import InvalidVersion, Version
  ModuleNotFoundError: No module named 'packaging'

`pipenv sync` installs exactly what Pipfile.lock names and never re-resolves,
which is what the lock file is for.  The committed lock covers all fourteen
packages the Pipfile asks for, packaging included, so it is complete enough to
install from as it stands.

The workflow also ran only for changes under Documentation/, so a change to the
documentation build was never exercised by the build it changed.  It now
triggers on its own path as well, which is what tests this commit.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-08-04 17:28:41 -03:00
Filipe Cavalcanti
c4f641991a arch/risc-v: add LDO source for Espressif devices
Adds LDO support for RISC-V Espressif devices. In general, should
only affect ESP32-P4 on a few boards.
ESP32-P4 has 4 channels of low-dropout voltage regulators, which
are programmable. Can be used to power external devices.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-08-04 23:31:56 +08:00
Takashi Furuya
b3a280e3b0 s32k3xx/flexcan: Initialize union and allow BRS control
- Zero initialize union in s32k3xx_transmit()
- Allow setting BRS from frame flags

Signed-off-by: Takashi Furuya <takashi.furuya@nttedt.co.jp>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 22:47:08 +08:00
Takashi Furuya
94f4b9e92f s32k1xx/flexcan: Initialize union and allow BRS control
- Zero initialize union in s32k1xx_transmit()
- Allow setting BRS from frame flags

Signed-off-by: Takashi Furuya <takashi.furuya@nttedt.co.jp>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 22:47:08 +08:00
Takashi Furuya
c4010cb205 kinetis/flexcan: Initialize union and allow BRS control
- Zero initialize union in kinetis_transmit()
- Allow setting BRS from frame flags

Signed-off-by: Takashi Furuya <takashi.furuya@nttedt.co.jp>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 22:47:08 +08:00
Takashi Furuya
a117a55b44 imx9/flexcan: Initialize union and allow BRS control
- Zero initialize union in imx9_transmit()
- Allow setting BRS from frame flags

Signed-off-by: Takashi Furuya <takashi.furuya@nttedt.co.jp>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-04 22:47:08 +08:00
Takashi Furuya
5f8a3ea68d imxrt/flexcan: Initialize union and allow BRS control
- Zero initialize union in imxrt_transmit()
- Allow setting BRS from

Signed-off-by: Takashi Furuya <takashi.furuya@nttedt.co.jp>
2026-08-04 22:47:08 +08:00
Martin Krasula
8f62ee1389 sched/semaphore: Clear mutex blocking bit after timeout
Clear NXSEM_MBLOCKING_BIT in nxsem_wait_irq() when a mutex waiter is
removed and the wait queue becomes empty.

Signed-off-by: Martin Krasula <mkrasula@elektroline.cz>
2026-08-04 11:14:33 -03:00
Marco Casaroli
58e227a8a5 Documentation: Document dlopen() reference counting.
Describe the shared library open semantics in the FLAT and PROTECTED
builds: dlopen() of a library that is already loaded returns a handle
to it and takes an additional reference, and the library is unloaded
only when the last handle is closed.  Note the consequences that follow
from having a single instance: libraries are matched by basename, data
is shared by all users, and constructors and destructors run once.

Contrast this with insmod(), which still rejects a duplicate module
name, and note that dlopen() is not implemented in the KERNEL build.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-08-04 11:12:49 -03:00
Marco Casaroli
e47be608d5 libc/dlfcn: Count opens so a library can be shared.
dlopen() of a library that is already loaded fails.  libelf_insert()
rejects a name that is already in the module registry with EEXIST, and
dlinsert() passes that straight out, so the second caller gets NULL.
POSIX says dlopen() shall return a handle to the object, and there is no
way today for two modules to hold the same library at once -- which is
what a shared library is for.

So dlopen() now takes another reference on a library that is already
there, and dlclose() only tears it down when the last handle goes.  The
count lives in the dlfcn layer rather than in libelf_insert() so that
insmod keeps its own behaviour: a second insmod of the same name still
fails with EEXIST, which is right for a kernel module.

The module name is what makes any of this possible, and a PROTECTED build
did not have one.  Names were defined for CONFIG_BUILD_FLAT or the kernel
side of a split build, on the reasoning that only the kernel needed them,
which predates dlopen() being usable from user space.  Without a name the
user-space copy of libelf cannot recognise a second open of a library,
cannot count opens, and cannot make dlclose() mean anything -- two
dlopen()s there produce two independent copies of the library and lose
track of the first.  Names are therefore defined wherever CONFIG_LIBC_DLFCN
is, which costs NAME_MAX per loaded module in that configuration.

The path no longer has to be copied either.  The module name is the
basename of the file and libelf_insert() takes it as a const string, so
dlinsert() finds it with strrchr() instead of handing a writable
duplicate of the whole path to basename().

BUILD_KERNEL is deliberately untouched.  dlopen() returns NULL there
unconditionally: dlinsert() is a stub, because sharing a library between
processes with separate address spaces needs the text in a shared region
and the data per process at a matching virtual address, which is a
different problem from this one.

Built for mps3-an547:picostest with and without CONFIG_LIBC_DLFCN, and
for stm32f4discovery:kostest, a PROTECTED configuration, with it enabled.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-08-04 11:12:49 -03:00
Jukka Laitinen
a1ac765a7b arch/arm64/src/imx9/imx9_usdhc.c: Fix imx9 usdhc DMA initialization
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
USDHC_PROCTL selects whether the usdhc uses SDMA or ADMA. This driver
only uses the SDMA or no DMA at all, so select that option. There might be a
wrong register value left by ROM code or an earlier bootloader which uses
ADMA.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-08-04 13:55:31 +02:00
Jorge Guzman
121182e599 Documentation/applications/games/nxdoom: document the display options
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
The options that let a board trade memory for drawing speed were only
described in their Kconfig help, where someone bringing the game up on a
new board is unlikely to find them.  Describe what each one does and
when it is worth enabling.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-04 10:30:04 +08:00
Jorge Guzman
7426e092c7 boards/arm/stm32h7/linum-stm32h753bi: add an nxdoom configuration
Runs NXDoom on the board's LCD, played with a USB HID keyboard and
reading the game data from the microSD card, so it exercises the LTDC
framebuffer, the OTG FS host and the SDMMC peripheral at once.

Three settings are needed that are not obvious:

  CONFIG_FAT_FORCE_INDIRECT, because the FAT layer otherwise reads whole
  sectors straight into the caller's buffer and the SDMMC IDMA cannot
  reach the caller's buffer when it lives in external SDRAM.  The
  failure appears part way through startup, once the internal RAM has
  filled and allocations start coming from SDRAM.

  CONFIG_HIDKBD_NOGETREPORT, because the keyboard answers GET_REPORT on
  the control pipe with an empty report and only delivers key data on
  its interrupt endpoint.  Without it the keyboard enumerates, reports
  no error, and no key is ever seen.

  CONFIG_STM32_LTDC_L1_L8 with the frame buffer colour map, because DOOM
  is natively palettised:  letting the display convert the palette while
  it scans out removes the conversion from the blit and halves the
  amount of data written per frame.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-04 10:30:04 +08:00
Jorge Guzman
c2bcc11a7f arch/arm/src/stm32h7: fix LTDC format specifier for the CLUT index
chromakey is a uint32_t, so printing it with %d warns.  The line is only
compiled when CONFIG_STM32_FB_CMAP is enabled, which is why it has gone
unnoticed.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-04 10:30:04 +08:00
Jukka Laitinen
a35042fa9c drivers/mmcsd/mmcsd_sdio.c: Fix finfo print modifier
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
Use PRIx32 to print uint32_t type argument to fix compilation error on
64 bit platforms.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-08-03 23:18:48 +08:00
Abhishek Mishra
4002e6af5f Documentation: describe FS permission interface and mount-crossing
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
Document inode_checkperm / inode_checkpathperm, mountpoint traverse vs open
semantics, and the optional mountpt_operations.permission hook in
file_permission.rst.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-02 18:48:40 -03:00
Abhishek Mishra
08afc5f2cf fs: enforce path search and unify inode permission helpers
Require X_OK on path ancestors and mountpoint gates via
inode_checkpathperm(), and use inode_checkperm() for inode mode checks.
inode_checkpathperm() takes the inode tree read lock (or INODE_CHECK_LOCKED
when the caller already holds it) and can fold a non-zero amode check onto
the target inode in the same call.

When CONFIG_FS_PERMISSION is disabled, inode_checkperm/inode_checkpathperm
are empty macros returning 0 so there is no stub .text cost.

Skip mountpoint R/W open-mode checks in inode_checkopenperm(); keep
traversal separate from open.  Add an optional mountpt_operations.permission
hook (tmpfs when CONFIG_FS_PERMISSION) for in-volume DAC without making the
VFS mount-crossing path depend on it.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-02 18:48:40 -03:00
Jorge Guzman
758b9d98fc boards/xtensa/esp32s3/esp32s3-m5-cardputer: follow the unified lvglterm input
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
The terminal no longer has separate matrix and USB input sources:  it
reads any keyboard through one path.

Left as it was, the unknown symbol would have been dropped and the
configuration would have fallen back to the touch variant, which is the
default.  This board has no touchscreen, so the terminal would have had
no input at all and the build would have said nothing.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-02 18:37:12 +08:00
Jorge Guzman
a073c2f9c1 Documentation: follow the keyboard change in the application docs
The lvglterm page still told the reader to pick the input source that
matches the hardware, which was the whole thing being removed:  it has
one physical keyboard variant now, and reads whatever is registered.

The hidkbd page pointed at HIDKBD_ENCODED, which no longer exists.  What
produces that byte stream now is INPUT_KEYBOARD_BYTESTREAM.

system/kbd had no page at all.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-02 18:37:12 +08:00
Jorge Guzman
093937a988 boards/arm/stm32h7/linum-stm32h753bi: drive lvglterm from the serial console
The terminal reads a keyboard device and does not care which one, so it
can be driven with no keyboard plugged in at all.  Enable UINPUT_KEYBOARD
and system/kbd so that the configuration can do it out of the box, and
document how, including how to have the USB keyboard and the console feed
the terminal at the same time.

The terminal no longer has a USB specific input source either, so the
device path has to be spelled out:  the USB HID driver names its devices
/dev/kbda onwards while the option defaults to /dev/kbd0.

INPUT_KEYBOARD_BYTESTREAM is not needed here.  The terminal reads events
now, and this configuration has no other keyboard consumer.

UINPUT_KEYBOARD_BUFNUMBER is raised to 128.  It counts events rather than
keys, so the default of eight holds four keystrokes, and a console hands
over a whole line at once.  The upper half overwrites the oldest event
when the buffer is full, so a typed line arrived with its beginning
silently missing.

HIDKBD_NOGETREPORT is enabled as well.  Sampling the keyboard over the
control pipe every 40 ms loses any key pressed and released between two
samples, which on this board meant most of them.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-02 18:37:12 +08:00
Piyush Patle
da99c2eba5 arm64/am62x: Add TISCI client, GPIO and I2C drivers
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
On K3 SoCs the A53 cluster does not own device power, clocks, resets or
interrupt routing; these are managed by the DM/TIFS firmware and requested
over TISCI through the secure-proxy mailbox.  Add:

  - a TISCI client (secure-proxy transport plus device/clock/reset helpers)
  - a GPIO driver for banks 0/1 with pad mux and TISCI power-on
  - an OMAP-I2C driver for the main-domain I2C controllers

and wire them into the PocketBeagle2 and BeaglePlay bring-up.

Tested on PocketBeagle2 (SYSFW 11.2.5) with the TechLab cape attached:

  nsh> i2c bus
  nsh> i2c dev -b 0 0x03 0x77   # I2C0 detects onboard 0x20 and 0x50
  nsh> gpio -o 1 /dev/gpio3     # drives a user LED; read back with:
  nsh> gpio /dev/gpio3

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-08-02 11:40:13 +08:00
shichunma
9aa6eb5671 net/ipfilter: Reassemble IPv6 fragments before filtering
IPv6 input currently lets fragmented packets continue into the IP filter path before reassembly. Forwarded IP filter rules can inspect L4 fields, but non-first IPv6 fragments do not carry the transport header.

Consume IPv6 fragments through the existing reassembly/drop helper before NAT66 or IP filter processing. This keeps plain IPv6 forwarding unchanged when neither L4-dependent feature is enabled, while avoiding filtering incomplete fragments.

Signed-off-by: shichunma <shichunma@bestechnic.com>
2026-08-01 17:40:07 -03:00
shichunma
0ed3a38638 net/nat: Reassemble IPv6 fragments before NAT66
NAT66 needs transport headers to create or match address and port mappings. Consume IPv6 fragments through local reassembly before NAT66 processing so forwarded fragmented traffic is not translated fragment-by-fragment without L4 context.

Also dispatch inbound NAT66 using the parsed IPv6 next-header value, matching the outbound path and allowing packets with extension headers before the transport header to be translated.

Signed-off-by: shichunma <shichunma@bestechnic.com>
2026-08-01 17:40:07 -03:00
shichunma
682ce1db2f net/ipv4: Forward fragments before local reassembly
Allow non-local IPv4 fragments to reach the forwarding path before local fragment reassembly. This lets routers forward fragmented datagrams without requiring local reassembly state.

Keep NAT44 and IP filter builds on the existing reassembly path because those features can depend on L4 headers. Preserve the original fragment offset and MF flag when fragout must split an already-fragmented packet for a smaller egress MTU.

Signed-off-by: shichunma <shichunma@bestechnic.com>
2026-08-01 17:40:07 -03:00
Abhishek Mishra
db6ab892a2 fs/binfmt: close symlink TOCTOU and harden setuid/setgid exec hygiene
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
Perform pseudo-filesystem permission checks inside inode_reserve() and
inode_remove() while the inode tree lock is held, and hold that lock across
pseudorename mutations so symlink swaps cannot bypass directory checks.
Hold a read lock around pseudo-fs open permission checks.

On setuid/setgid exec, update saved set-IDs, mark the task group secure,
sanitize dangerous environment variables, clear debug/dumpable flags, and
add issetugid(), secure_getenv(), and PR_SET/GET_DUMPABLE support.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-08-01 15:32:03 -03:00
Javier Alonso (Javinator9889)
06ca196d56 docs: Add new watchdog functionality
The watchdog documentation includes the new functionality of the
driver's char device: When reading from it, it emits information
about the watchdog status including flags, timeout and timeleft
as milliseconds. An example has been included as well.

Signed-off-by: Javier Alonso <dev@javinator9889.com>
2026-08-02 00:38:05 +08:00
Javier Alonso
679c397401 WDOG: Output status on read
Currently, the `read` function of the watchdog device is dummy and
does nothing. Although this is fine, it's not useful at all from a
userspace perspective, where you may want to check the current WDOG
status.

A wrapper around the `ioctl` `WDIOC_GETSTATUS` has been added as
the `read` function for the WDOG.

Signed-off-by: Javier Alonso <javieralonso@geotab.com>
2026-08-02 00:38:05 +08:00
zhangning21
e73f7f7d0e ci: Support pull request dependencies via Depends-On.
Allow pull requests targeting master to declare same- and
cross-repository dependencies. Parse declarations with a tested Python
helper, apply exact dependency commits before the existing build matrix,
and rerun heavy CI only when an edited description changes the dependency
state.

Keep fork builds read-only and use a trusted workflow_run to validate
artifacts and post per-build dependency results. Document the supported
declaration forms and operational limits.

Assisted-by: Kiro:gpt-5.6-sol
Signed-off-by: zhangning21 <zhangning21@xiaomi.com>
2026-08-01 20:26:14 +08:00
hanzhijian
ddf350f1a3 libs/libc: support explicit bases up to 36
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
The strto* interfaces document explicit bases in the range 2 through 36, and lib_isbasedigit() already supports alphabetic digits through base 36.  However, lib_checkbase() rejects every explicit base above 26 with EINVAL.

Raise the validation limit to 36 so the conversion interfaces accept the full documented range while continuing to reject base 37 and above.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-08-01 20:08:32 +08:00
yushuailong
8cec1d01db sched/sched: Fix uninitialized sporadic params returned by nxsched_get_param()
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
When querying the calling task itself (pid == 0 or the caller's own
pid), nxsched_get_param() only filled in sched_priority and never
touched the SCHED_SPORADIC related members (sched_ss_low_priority,
sched_ss_max_repl, sched_ss_repl_period and sched_ss_init_budget).
With CONFIG_SCHED_SPORADIC enabled, the caller received uninitialized
stack garbage in these fields, and a task running under the sporadic
policy could not retrieve its own sporadic parameters.

Fix this by factoring the sporadic parameter fill-in into a common
helper nxsched_get_sporadic_param() shared by both the self-query and
the lookup paths, so both paths now return identical information.

The self-query path keeps its original fast-path behavior: no TCB
lookup and a lock-free read of sched_priority.  Only the read of the
sporadic state is wrapped in a critical section, because tcb->sporadic
may be freed concurrently, e.g. by sched_setscheduler() from another
CPU switching the task away from SCHED_SPORADIC.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-08-01 11:19:50 +08:00
Jiri Vlasak
e50a2d34d2 gpio: Fix GPIO expanders warnings
- ISO1H812G is *output* only expander, not input.
- Warning make sense when we try to set the expander the wrong way.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-08-01 11:15:11 +08:00
Jorge Guzman
0281e71cf8 boards: drop the keyboard options that the driver change made stale
apache/nuttx#19586 removed HIDKBD_ENCODED and made USBHOST_HIDKBD select
INPUT, but four configurations still name one or both, so they do not
survive a refresh and the normalisation step fails:

  boards/arm/sama5/sama5d4-ek/configs/ipv6
  boards/arm/sama5/sama5d4-ek/configs/nsh
  boards/arm/sama5/sama5d4-ek/configs/nxwm
  boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm_kbda

Removing the lines is the whole fix. INPUT still ends up enabled through
the select, and encoding now comes from INPUT_KEYBOARD_BYTESTREAM, which
the one configuration that wanted it already sets.

Nothing changes in the resulting .config, which is why the build never
noticed: Kconfig drops an option that no longer exists without saying
anything, and only the refresh compares the file before and after.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-08-01 11:13:37 +08:00
Udit Jain
6f0da60bd7 libs/libbuiltin/compiler-rt: skip unsupported Arm VFP builtins asm
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
The compiler-rt builtins build globs every arm/*.S source, but several of
those hand-written assembly files require FPU features the target may not
have.  Upstream compiler-rt selects them conditionally; NuttX did not, so
BUILTIN_COMPILER_RT builds for single-precision-FPU Arm targets (e.g.
Cortex-M33, -mfpu=fpv5-sp-d16) failed to assemble with errors such as
"selected FPU does not support instruction -- vadd.f64".

Filter the source list to match the configured FPU, in both the Makefile
and CMake builds:
  - chkstk.S / chkstk2.S are Windows/MinGW-only stack probes, always dropped;
  - with no hardware FPU (!CONFIG_ARCH_FPU) all arm/*vfp.S are dropped;
  - with a single-precision FPU (!CONFIG_ARCH_DPFPU) the double-precision
    *df*vfp.S routines are dropped.

Reproduced against compiler-rt 17.0.1 with arm-none-eabi-gcc 14.2 using the
Cortex-M33 single-precision flags: 18 of 86 arm/*.S files failed to assemble
(17 double-precision *df*vfp.S plus chkstk.S); after the filter all remaining
68 files assemble cleanly.

Fixes: https://github.com/apache/nuttx/issues/17386
Generated-by: Claude (Anthropic)
Signed-off-by: Udit Jain <uditjainstjis@gmail.com>
2026-07-31 15:37:33 -03:00
Jorge Guzman
baea352374 boards/xtensa/esp32s3/esp32s3-m5-cardputer: report the cursor keys as keycodes
The Fn cursor cluster was reported as ordinary key presses carrying 0x80
to 0x83, chosen to sit above the printable range so that an application
could tell them apart from characters.  That is the collision this work
exists to remove:  a key that produces no character is a special key, and
the event type is what says so.

Report them as KEYBOARD_SPECPRESS carrying KEYCODE_UP and friends, which
is what every other keyboard does and what the applications now expect.

The character tables are untouched, so the layout and the shift map behave
exactly as before.  Only the four Fn cursor keys change.

Not tested on hardware:  the board was not available.  It builds, and the
change is confined to the two lines that pick the event type.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 11:02:20 -03:00
Jorge Guzman
b7ce3cbf20 arch/sim: report the keyboard the way the contract says
The X11 keyboard reported any keysym that its translation table did not
know as an ordinary key press carrying the raw keysym.  An application
looking for a byte of text got 65307 for Escape and 65289 for Tab, and
the modifiers arrived as 65505 and friends.

That is not a character, so it cannot be a KEYBOARD_PRESS.  NXDoom on
the simulator has therefore had no menu, no map and no fire, which is
most of the game.

Escape and Tab are control characters and are reported as such.  The
eight modifiers get the keycodes that the codec now has for them.  And a
keysym above the Latin-1 range that no table knows is not reported at
all, which closes the case rather than the three instances of it.

Verified by dumping the events while typing:  Escape arrives as 27, Tab
as 9, the modifiers as keycodes 88 to 95, and the game plays.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 11:02:20 -03:00
Jorge Guzman
b5382c5fb3 Documentation: describe the contract for writing a keyboard driver
The keyboard driver documentation described the byte stream codec and
nothing else.  It never mentioned keyboard_register(), keyboard_event()
or the event types, so somebody writing a driver had no way to find the
interface that every keyboard in the tree actually uses.

That omission has a cost that can be counted:  six of the nine drivers
that register a keyboard report only the press and release types and
never the special ones, which means their arrow keys are silently
dropped by any application that follows the contract.  The header they
would read to find out declares two of the four types.

Document the contract, why the event type is what tells an arrow key
from the character that shares its value, what to name the device, how
to get a matrix keyboard working without writing a driver at all, and
how to test the result with or without the hardware.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 11:02:20 -03:00
Jorge Guzman
59101fa206 drivers/input: report special keys from the keyboard matrix
The matrix driver reported every key with KEYBOARD_PRESS and
KEYBOARD_RELEASE, so a board whose matrix has arrows or function keys
had no way to say so:  the keycode ranges overlap the character range,
and the event type is what tells them apart.

A keymap entry is a uint32_t, so wrap the entry in KMATRIX_SPECIAL() to
declare that it holds a value from enum kbd_keycode_e.  Existing keymaps
hold characters and are unaffected.

While here, drop the cast that truncated the keycode to sixteen bits,
and default the device to /dev/kbd0.  Applications look for a keyboard
under that name, and /dev/keypad0 kept the matrix out of reach of every
one of them.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 11:02:20 -03:00
Jorge Guzman
f47fd03407 boards: select the keyboard byte stream where the application needs it
These are the configurations whose application reads the USB HID keyboard
as a byte stream.  Now that the driver reports through the keyboard upper
half, they need INPUT_KEYBOARD_BYTESTREAM to keep behaving as before.

INPUT drops out of the normalised defconfigs because USBHOST_HIDKBD now
selects it.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 11:02:20 -03:00
Jorge Guzman
f0a870baab drivers/usbhost: report the HID keyboard through the keyboard upper half
The driver kept a character device, a ring buffer, a poll waiter list
and an encoder of its own, in parallel with everything the keyboard
upper half already provides.  A USB keyboard was therefore the one
keyboard an application could not read like any other.

Register with keyboard_register() and report with keyboard_event(),
which removes the private character device and the four hundred lines
that served it.  Special keys are reported with the SPEC event types
carrying a keycode, so an application no longer has to guess whether a
value in the character range is a character or an arrow key.

HIDKBD_ENCODED and HIDKBD_NODEBOUNCE go away with the code they guarded.
Encoding is now inherent to the event, and the previous report is no
longer an optimisation:  a HID keyboard reports the keys that are down
rather than the transitions, so it is what tells a new press from a key
still held, and what tells that a key has been released.

Reporting the modifiers as keys is new, so it is behind
HIDKBD_REPORT_MODIFIERS and off by default.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 11:02:20 -03:00