Commit Graph

59811 Commits

Author SHA1 Message Date
guohao15 99ca0dbf9d bugfix:the inode may have been removed by other core in SMP
The inode may has been unlinked from the tree in other core, but it is not yet freed.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-16 16:02:46 -03:00
zhangshuai39 560aed72a4 net: Check listening connections when selecting ports
Added check for port number on listen queue

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-17 01:30:11 +08:00
Yanfeng Liu 7ea747024d board/rv-virt: add elf config
This adds `rv-virt/elf` following `maix-bit/elf` to check
relocatable ELF feature.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-12-16 13:07:37 -03:00
Yanfeng Liu 495f6cc31f arch/Toolchain.defs: use _start entry
This adjusts more archs to use _start as ELF entry.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-12-16 13:07:37 -03:00
guohao15 14942b5ab4 bugfix/fs:write Bad buf addr should return EINVAL
return EINVAL if iov_base == NULL

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-16 19:41:19 +08:00
Lars Kruse ec906cfb0b rp2040,rp23xx,rp23xx-rv: allow up to 32 PIO instructions
Previously only up to 31 PIO instructions were accepted.
But the hardware allowed 32 instructions.

Now we accept 32 instructions.

See the corresponding commit in the pico-sdk repository:

  https://github.com/raspberrypi/pico-sdk/commit/6f7dc67791dfffc2a22a0f0b59e83fd4da89b408

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-12-15 18:01:27 +01:00
zhanghongyu 097dd84bba drivers/usbdev/cdcecm.c: fix cdcecm netdev can not enter running state
When the setinterface interface is called, it indicates that the underlying
USB link has been successfully established. At this point, the status of the
network card needs to be updated to RUNNING by calling the netdev_carrier_on
interface. It is similar to the logic after a Wi-Fi network card is
connected to a hotspot. Otherwise, an incorrect network card status may
cause packets to fail to be successfully sent.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-15 11:14:20 -03:00
anjiahao b95cfa1b14 risc-v:need add crt0 to LDELFFLAG
riscv64-unknown-elf-ld: warning: cannot find entry symbol __start; defaulting to 0000000000000000

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-15 17:35:44 +08:00
dongjiuzhu1 b4c6a92757 drivers/battery: fix race condition in event handling
Move mutex lock before checking flist to prevent race condition where
events could be lost when occurring simultaneously with service opening.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-15 17:35:11 +08:00
dependabot[bot] e83cde2f64 build(deps): bump actions/upload-artifact from 5 to 6
Build Documentation / build-html (push) Has been cancelled
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 09:54:05 +01:00
dependabot[bot] 875cc746f1 build(deps): bump actions/cache from 4 to 5
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 09:53:07 +01:00
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