Commit Graph

59800 Commits

Author SHA1 Message Date
dependabot[bot] db2daeaec4 build(deps): bump actions/download-artifact from 6 to 7
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 09:52:09 +01:00
zhanghongyu 2b092adf48 net/can: fix possible IOB resource leak when can close
If there is data in readahead, it needs to be released; otherwise,
it will cause the leakage of IOB resources

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-15 10:19:15 +08:00
wangjinjing1 232ef950c6 net/can,udp,tcp: add sem destroy for udp/tcp sndsem;
standardize the usage of semphore

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-15 10:19:15 +08:00
wangjinjing1 8c92be874f net/can: add write buffer to support nonblock send
The sending of can socket can support more scenarios

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2025-12-15 10:19:15 +08:00
zhanghongyu 1c0a3a8d63 net/can: support can receive packets from all can devices
after the socket calls bind with ifindex is 0, it can receive packets
from all can devices

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-15 10:19:15 +08:00
zhanghongyu b7b9aebab9 net/can: return -ENODEV if the device is not found when bind
correction return value

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-15 10:19:15 +08:00
dongjiuzhu1 c1b2b1b4fb poll: fix covertify issue about out-of-bound access fds
when i is zero and file_get is failed, num is -1,
it's uint32_max for nfds.
so remove num and simplify code logic.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-15 10:16:05 +08:00
Petro Karashchenko 11dc1df189 libc: improve libc dependencies in case of LIBM_NONE
Currently the code for strtof, strtod and strtold is in the list
of files to compile unconditionally, but when trying to compile
kernel with toolchain without libm support (LIBM_NONE=y) compilation
fails because code refers math.h

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-14 17:57:27 -03:00
raiden00pl 8c8a7484ab drivers/can/can.c: fix broken O_NONBLOCK
O_NONBLOCK open mode was broken since
https://github.com/apache/nuttx/pull/17360

MIN() comapres signed value (int) with unsigned value (size_t) which causes
an unexpected return value when ret is negative

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-14 15:42:35 -05:00
yangsong8 a87ad98343 usbhost: cdcacm exit wq after copy all received data
Build Documentation / build-html (push) Has been cancelled
Fix issue: When the SIM CDCACM host receives data, the second packet
data reception is incorrect.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-14 10:37:53 -03:00
zhanghongyu aa8ffea3cf netdev_upperhalf: convert Kconfig to variable
Build Documentation / build-html (push) Has been cancelled
Upperhalf supports multiple working modes at the same time,
which is specified by NIC when register

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-14 10:01:22 +08:00
zhanghongyu 84895c8e70 Revert "e1000: add polling mode support for tx/rx"
Remove the previously supported polling mode. If necessary in the
future, switch to a new solution for implementation.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-14 10:01:22 +08:00
Justin Erenkrantz d98e7a7b68 risc-v/litex: For vexriscv, point docs at linux CPU variant instead of secure.
Build Documentation / build-html (push) Has been cancelled
The secure CPU variant of vexriscv immediately panics after bring up.

However, the linux CPU variant of the vexriscv core does work successfully.

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
2025-12-13 18:14:21 -03:00
Michal Lenc 977f9ed4b8 libs/libc/obstack/lib_obstack_free.c: fix object check within chunk
The original condition incorrectly used &h->chunk instead of
h->chunk in the calculation whether the object is in the chunk. This
could lead to the wrong behavior as the first branch gave incorrect
result and thus sometimes the entire obstack was freed even though
object was not NULL.

The commit also simplifies the logic, we can use pointer arithmetic
here and just do h->chunk + 1 as it gives the same result as
(FAR char *)h->chunk + sizeof(struct _obstack_chunk). This saves
unnecessary cast and sizeof.

The second branch should be less than or equal, not just less than.
This ensures the object is correctly located in the chunk even after
previous obstack_finish was called.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Karel Kočí <kkoci@elektroline.cz>
2025-12-13 18:13:19 -03:00
yangsong8 67584d9981 codespell-ignore: Ignore variable name sems
Ignore variable name sems

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8 69cac3bd3a driver/usbdev: Fix usbtrace lock unpaired issue
Fix usbtrace lock unpaired issue

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8 444293e3b5 drivers/usbdev: Use small lock to protect usbdev trace
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8 35a89be950 drivers/usbdev: Use small lock to protect usbdev msc
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8 4d319c6816 driver/usbdev: Use small lock to protect usbdev fs
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
yangsong8 a1f5c269d7 driver/usbdev: Use small lock to protect composite device
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 16:45:06 +08:00
Jiri Vlasak f93a1b34e5 eeprom/spi_xx25xx: Add IOCTL to set Block Protect
Build Documentation / build-html (push) Has been cancelled
Add IOCTL to set Block Protect, because we need a way to set Block
Protect of an EEPROM.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2025-12-13 13:33:48 +08:00
chenxiaoyi 43405d34c4 Documentation: update the gprof usage
Update the usage part to demostrate two easily accessible environments,
one QEMU and one real board.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-13 13:31:46 +08:00
chenxiaoyi 0d757d0134 libc/machine/xtensa: add mcount implementation for gprof
Add the implementation of _mcount() to meet the requirements of gprof.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-13 13:31:46 +08:00
yangsong8 f2191a7e3b drivers/usbhost: fix build waring
usbhost/usbhost_hidkbd.c:1373:14: warning: unused variable ‘flags’ [-Wunused-variable]
 1373 |   irqstate_t flags;
      |              ^~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 13:03:52 +08:00
yangsong8 2660df6581 drivers/usbhost: use small lock to protect usbhost kbd
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 13:03:52 +08:00
yangsong8 25ec00c67c drivers/usbhost: improve usbhost hid kbd code
By passing parameters to the kthread_create process, reduce the global
variables and nxmutex lock.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 13:03:52 +08:00
yangsong8 a7af894cd3 driver/usbhost: use small lock to protect usbhost cdcmbim
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8 23cec99002 drivers/usbhost: use small lock to protect usbhost cdcacm
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8 62f7a8fa22 drivers/usbhost: use small lock to protect usbhost bthci
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8 5571ec8fa2 drivers/usbhost: use small lock to protect usbhost msc
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
yangsong8 b9b62a9204 drivers/usbhost: Use small lock to protect usbhost common function
replace critical_section with spinlock

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-13 12:39:48 +08:00
Justin Erenkrantz 52d5aeb60c risc-v/litex: Add a vexriscv and vexriscv_smp section to arty_a7 doc.
risc-v/litex: For vexriscv_smp, explicitly document requirement for C ISA ext.

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
2025-12-13 11:46:14 +08:00
Junbo Zheng 53edfb5815 sched/misc: correct coredump log format
since it has been replaced with
https://github.com/apache/nuttx/blob/master/sched/misc/coredump.c#L763
and `nput` map to `off_t` https://github.com/apache/nuttx/blob/master/include/nuttx/streams.h#L98

align with other prints, reference:
- https://github.com/apache/nuttx/blob/master/drivers/misc/rwbuffer.c#L1121
- https://github.com/apache/nuttx/blob/master/fs/mmap/fs_rammap.c#L84
- https://github.com/apache/nuttx/blob/master/libs/libc/elf/elf_read.c#L85

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2025-12-12 14:54:05 +01:00
yezhonghui ceeeb73bd9 rpmsgdev: fix export null issue when rpmsgdev init
check rpmsgdev export null or not

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-12 17:48:43 +08:00
yezhonghui 806c881595 rpmsgdev: fix rpmsg dev server name too long issue
rpmsgdev name too long, we can use prefix and key info

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-12 17:48:43 +08:00
rongyichang 0b544d3359 drivers/rpmsg: add slash check for sepical rpmsg dev
rpmsgdev match name too long, so add prefix

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-12-12 17:48:43 +08:00
liaoao ea1e38ef92 rpmsgdev_server: use a separate workqueue to process poll
it will block other works of the list of hpwork when it waits to get buffer for too long. so use a separate workqueue for rpmsgdev.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2025-12-12 17:48:43 +08:00
yezhonghui 582415318a rpmsgdev: destroy distinguish active and passive
rpmsgdev server will not destroy if client reboot

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-12 17:48:43 +08:00
wangchengdong 273578f658 sched/clock: Remove unnecessary preprocessor definition
Remove an unnecessary preprocessor definition in clock_systime_ticks.c.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-12 12:31:16 +08:00
yangsong8 3a76917058 sim/usbdev: Process all pending data at once
After processing a packet of data, do not exit interrupt, but continues
to check whether there is data to be processed. If there is, continue
processing.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
ligd 6736558d10 sim_usb: fix host function caused up_interrupt_context() failed
use host_uninterruptible to protect some system functions

Signed-off-by: ligd <liguiding1@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8 8bf88945ce sim/usbdev: Supports registering multiple USB devices on a same host
when start multiple sim, the host refuses to recognize multiple USB
devices, and the prompt message is as follows:
[365652.175289] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[365652.175304] misc raw-gadget: fail, usb_gadget_probe_driver returned -16

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8 3a0d2cbd41 sim_usb: fix dev function caused up_interrupt_context() failed
use host_uninterruptible to protect some system functions.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8 ae39301416 drivers/usbdev: not use wd timer when zero copy in cdcacm
When using the serial framework buffer, if the buffer is full, excess
data is cached in the usb req buffer. The CDCACM driver doesn't know
when the upper layer will read data from the serial buffer, so it
needs to periodically check if the cached data can be put into the
serial buffer. However, when using zero-copy, each usb req buffer
needs to be completely read before actively switching to the next
req buffer, so the timer is not needed to assist to query.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8 04fbce9d40 driver/usbdev: fix cdcacm wr container missing issue
in cdcacm_sndpacket, If `if (priv->wrcontainer)` is true, then
`priv->wrcontainer` is set to NULL. If an interrupt occurs before
`priv->wrcontainer` is reassigned after being NULL,
`priv->wrcontainer` will be reassigned once during the interrupt,
and `nwrq--` will be called, but no data will be sent at this time.
Only when data is sent by calling `txint` will `priv->wrcontainer`
be reassigned and `nwrq--` called again. This causes the issue.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8 10180ab4eb drivers/usb: use lock to protect reqbuf when cdcacm unbind
When CONFIG_CDCACM_DISABLE_TXBUF is enabled, if the USB is
unplugged during serial data transmission, it is possible
that cdcacm will enter the unbind process, and reqbuf will
be released, causing a crash during serial write.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8 a53223741e drivers/usbdev: fix usb cdcacm build warning
usbdev/cdcacm.c:371:11: warning: implicit declaration of function 'spin_lock_irqsave' [-Wimplicit-function-declaration]
  371 |   flags = spin_lock_irqsave(&priv->lock);
      |           ^~~~~~~~~~~~~~~~~
usbdev/cdcacm.c:375:3: warning: implicit declaration of function 'spin_unlock_irqrestore' [-Wimplicit-function-declaration]
  375 |   spin_unlock_irqrestore(&priv->lock, flags);
      |   ^~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8 d2daf66d38 drivers/usbdev/cdcacm: Fix the issue of missing release one req buf
When unbinding, if a req buf is held by priv->container, it also
needs to be released.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8 cc067ab199 drivers/usbdev/cdcacm.c: Use small lock to protect cdcacm
Use spin lock to replace enter_critical_section

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00
yangsong8 fe293ec9b5 drivers/usbdev/cdcacm.c: fix check priv->nwrq issue
When enable CONFIG_CDCACM_DISABLE_TXBUF, dev->xmit.buffer always
take one req, so just compare CONFIG_CDCACM_NWRREQS - 1.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:34:47 +08:00