wangjianyu3
73b7128fb6
drivers/rpmsg: Fix a typo error of rpmsg_device_destory()
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-25 01:51:18 +08:00
wangjianyu3
b8029d28a3
drivers/rpmsg: Using safe list iterating in rpmsg_device_created()
...
To fix list access after delete error
Test:
/* Export */
rpmsgdev_export("SERVER", "/dev/DEVNAME");
/* Register */
rpmsgdev_register("CLIENT", "/dev/DEVNAME", "/dev/server-DEVNAME", 0);
Log:
[ap] kasan_report: kasan detected a read access error, address at 0x40b7ae78,size is 8, return address: 0x402a3c50
[ap] kasan_show_memory: Shadow bytes around the buggy address:
[ap] kasan_show_memory: 0x40b7ae20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7ae30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7ae40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7ae50: 20 af b7 40 00 00 00 00 c0 17 2a 40 00 00 00 00
[ap] kasan_show_memory: 0x40b7ae60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7ae70: 00 00 00 00 00 00 00 00[b0 f7 b3 40 00 00 00 00]
[ap] kasan_show_memory: 0x40b7ae80: c8 48 b8 40 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7ae90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7aea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x40b7aeb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
$ addr2line -fe nuttx/nuttx 0x402a3c50
rpmsg_device_created
/workspace/nuttx/drivers/rpmsg/rpmsg.c:395 (discriminator 2)
Reported by rongyichang@xiaomi.com
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-25 01:51:18 +08:00
dongjiuzhu1
4960f290c8
drivers/i3c: avoid return error when i3c_master_register without i3c/i2c device
...
1. if i3c_mater_register without i3c/i2c device, rstdaa/clearevents/do_daa could be failed
2. board code/driver code need to actively i3c_master_do_daa when device power on.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-24 23:36:50 +08:00
dongjiuzhu1
694750e8af
drivers/i3c: remove extra i3c_dev_register, do_daa has created them
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-24 23:36:50 +08:00
yangshuyong
cffcccafc2
driver/i3c: Fixed i3c pointer format to check null
...
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2024-09-24 23:36:50 +08:00
yangshuyong
7a48469e70
I3C: fixed the return value error in send ccc cmd api
...
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2024-09-24 23:36:50 +08:00
yangshuyong
9d566d4a9d
I3C: fixed the send ccc cmd check condition error
...
Only affect the send ccc cmd in 3th driver
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2024-09-24 23:36:50 +08:00
yangshuyong
9790c3d316
Added the common interface sending ccc cmd in I3C driver
...
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
2024-09-24 23:36:50 +08:00
dongjiuzhu1
5b48dea4f5
drivers/i3c: support i3c driver model
...
Reference to: https://github.com/torvalds/linux/tree/master/drivers/i3c
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-24 23:36:50 +08:00
SPRESENSE
1e103bd41f
drivers/modem/alt1250: Fix issue where the program would get stuck
...
Fix issue where the program would get stuck
if an unsupported ALTCOM packet was sent.
2024-09-24 20:00:21 +08:00
chao an
a5251161c6
syslog/channel: rename syslog_channel() to syslog_channel_register()
...
Change syslog API naming more reasonable:
1. rename syslog_channel() to syslog_channel_register()
2. rename syslog_channel_remove() to syslog_channel_unregister()
Signed-off-by: chao an <anchao@lixiang.com>
2024-09-24 19:28:49 +08:00
wangjianyu3
a5b85fcd96
misc/rpmsgdev: Fix invalid pointer error when there are more than one remotes
...
Test: (see tests/testcases/rpmsgdev for details)
# 1. Register dummy device
testdev -d 0 -r "/dev/ttyGNSS0"
# 2. Call rpmsgdev_export() to export the device to remote
testdev -d 2 -c "droid" -l "/dev/ttyGNSS0"
Log:
[ap] arm_busfault: PANIC!!! Bus Fault:
[ap] arm_busfault: IRQ: 5 regs: 0x3c434e44
[ap] arm_busfault: BASEPRI: 00000000 PRIMASK: 00000000 IPSR: 00000005 CONTROL: 00000004
[ap] arm_busfault: CFSR: 00008200 HFSR: 00000000 DFSR: 00000000 BFAR: 00000000 AFSR: 00040000
[ap] arm_busfault: Bus Fault Reason:
[ap] arm_busfault: Precise data bus error
[ap] dump_assert_info: Current Version: NuttX ****** ***** *** 12.3.0 ********** Sep 23 2024 18:35:50 arm
[ap] dump_assert_info: Assertion failed panic: at file: armv8-m/arm_busfault.c:113 task: testdev process: testdev 0x2c86ca75
Backtrace:
backtrace_unwind
/workspace/nuttx/arch/arm/src/common/arm_backtrace_unwind.c:632
sched_backtrace
/workspace/nuttx/sched/sched/sched_backtrace.c:105
sched_dumpstack
/workspace/nuttx/libs/libc/sched/sched_dumpstack.c:69
dump_running_task
/workspace/nuttx/sched/misc/assert.c:629
arm_busfault
/workspace/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113
irq_dispatch
/workspace/nuttx/sched/irq/irq_dispatch.c:142
arm_doirq
/workspace/nuttx/arch/arm/src/armv8-m/arm_doirq.c:95
strcmp
/workspace/nuttx/libs/libc/machine/arm/armv8-m/gnu/arch_strcmp.S:107
rpmsgdev_server_created
/workspace/nuttx/drivers/misc/rpmsgdev_server.c:520 (discriminator 1)
rpmsg_register_callback
/workspace/nuttx/drivers/rpmsg/rpmsg.c:245
rpmsgdev_export
/workspace/nuttx/drivers/misc/rpmsgdev_server.c:552
_register_driver
/workspace/tests/testcases/rpmsgdev/testdev.c:216
nxtask_startup
/workspace/nuttx/libs/libc/sched/task_startup.c:70
nxtask_start
/workspace/nuttx/sched/task/task_start.c:114
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 23:59:12 +02:00
yangshuyong
a537ecdd0f
Support nuttx pci endpoint driver framework
...
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-23 10:03:54 +02:00
lipengfei28
ca39dc2e74
math: Optimize the implementation of log2ceil and log2floor
...
and move common math funtions to math32.h:
div_round_up
div_round_closest
is_power_of_2
roundup_pow_of_two
rounddown_pow_of_two
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-23 10:03:54 +02:00
lipengfei28
b18262d78f
bits:rename __set_bit to set_bit __clear_bit to clear_bit
...
This used for add pci ep drver framework
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-23 10:03:54 +02:00
chao an
db5320fd9f
drivers/syslog: compile syslog_device.c if console/char/file channel enabled
...
Add conditional compilation to syslog_device.c
Signed-off-by: chao an <anchao@lixiang.com>
2024-09-23 14:36:40 +08:00
chenrun1
4cec713dbf
fs_inode:Change the type of i_crefs to atomic_int
...
Summary:
1.Modified the i_crefs from int16_t to atomic_int
2.Modified the i_crefs add, delete, read, and initialize interfaces to atomic operations
The purpose of this change is to avoid deadlock in cross-core scenarios, where A Core blocks B Core’s request for a write operation to A Core when A Core requests a read operation to B Core.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-23 14:07:03 +08:00
wangjianyu3
a73ee73c78
Thermal/dummy: Fix depends error
...
1. cpufreq.h not found if cpufreq is not supported on some branches.
./thermal/thermal_dummy.c:25:10: fatal error: nuttx/cpufreq.h: No such file or directory
25 | #include <nuttx/cpufreq.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
2. debug.h is included by including <nuttx/cpufreq.h>, should not.
CC: thermal/thermal_dummy.c thermal/thermal_dummy.c: In function ‘thermal_dummy_init’:
thermal/thermal_dummy.c:338:7: warning: implicit declaration of function ‘therr’ [-Wimplicit-function-declaration]
338 | therr("Register cooling device fan0 failed!\n");
|
https://github.com/apache/nuttx/pull/12824
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
efd7e31b3a
Thermal/procfs: Remove unnecessary nxmutex_unlock
...
https://github.com/apache/nuttx/pull/12824
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
88cc4b1120
Thermal/procfs: Disabled immediately after enabling.
...
When exec "echo 1 > /proc/thermal/cpu-thermal", procfs get "\n" after "1", treat as disable:
```
#1 0x000000000040f452 in thermal_procfs_write (filep=0x7ffff3d241e8, buffer=0x7ffff3d344fc "\n", buflen=1) at thermal/thermal_procfs.c:179
```
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d5ffed635b
Thermal/dummy: Get cpufreq_driver from cpufreq_policy.
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
e8758eb974
Thermal/step_wise: Increase cooling state in case of "stable" trend and "hot" trip.
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
68d5516c90
Thermal/dummy: Fix warning
...
```
CID 1159822: (#1 of 2): 宏将无符号值与 0 做了比较 (NO_EFFECT)
unsigned_compare: 不带符号值的此 greater-than-or-equal-to-zero 比较总是为 true。index >= 0U。
```
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
515c3978dd
Thermal: Check trip type in thermal_zone_device_register().
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
f96d3798a1
Thermal: remove assert of thermal_zone_device_update()
...
Called by both of lpwork and Idle_Task:
[ 0.000000] [ 0] [ INFO] [ap] thermal_zone_device_register: Registered zone device cpu-thermal
[ 0.000000] [ 0] [ EMERG] [ap] _assert: Current Version: NuttX ap 0.0.0 Dec 11 2023 20:59:20 sim
[ 0.000000] [ 0] [ EMERG] [ap] _assert: Assertion failed : at file: thermal/thermal_core.c:820 task: Idle_Task process: Kernel 0x32ade29
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d43f0272e5
Thermal: Add dummy driver
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
b30f866f80
Thermal: Add procfs file nodes
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
520e4042ce
Thermal: Register pm suspend notifier
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
2f285a04f9
Thermal: Support cpufreq cooling device
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
338b5d7415
Thermal: Support step_wise governor
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d1b87bd021
Add thermal framework
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
likun17
09ab135d2f
sensor: Fixed the problem of user information lag in cross-core communication "stublist".
...
When its remote core publishes a message, all subscribed cores will receive the message,
but the local core "stublist" does not update the user's "generation" and "bufferpos" parameters.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-21 23:09:48 +08:00
likun17
bdac8c116a
sensor_rpmsg.c: Fix that "stub" will be created when local core only has subscribers.
...
After the ap core subscribes to the 25hz batch 120ms data of the sensor core, it switches
to the cp core and subscribes to the 50hz batch 120ms sensor core data. At this time,
the data subscribed by the AP will be abnormally lost (12.5hz). Mainly because ap
subscribes to sensor core data earlier than cp. The subscription of cp will be broadcast
to the ap core at the same time, and the corresponding "path" already exists
under "/dev/uorb" of ap. Thus the ap will create a "stub".
There are some restrictions on the creation of "stub" to avoid this situation.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-20 22:05:58 +08:00
Shoukui Zhang
985e539e02
i2c: Optimize access to private data
...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-20 13:28:03 +02:00
wangjianyu3
bdddc76997
nuttx/uorb: Fix incompatible type error
...
Related: b17c074a18
Log:
Error: sensors/ms56xx_uorb.c:145:20: error: initialization of 'int (*)(struct sensor_lowerhalf_s *, struct file *, uint32_t *)' {aka 'int (*)(struct sensor_lowerhalf_s *, struct file *, unsigned int *)'} from incompatible pointer type 'int (*)(struct sensor_lowerhalf_s *, struct file *, long unsigned int *)' [-Werror=incompatible-pointer-types]
145 | .set_interval = ms56xx_set_interval,
| ^~~~~~~~~~~~~~~~~~~
sensors/ms56xx_uorb.c:145:20: note: (near initialization for 'g_sensor_ops.set_interval')
cc1: all warnings being treated as errors
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 19:54:38 +08:00
wangjianyu3
3ab62370cb
nuttx/uorb: Fix initialization error of variable of type struct sensor_ops_s
...
Related change:
.flush : 403469336f
.get_info : 703bb7e7b3
Error Log:
1153 Building NuttX...
1154Error: sensors/bme680_uorb.c:428:3: error: initialization of 'int (*)(struct sensor_lowerhalf_s *, struct file *, long unsigned int)' from incompatible pointer type 'int (*)(struct sensor_lowerhalf_s *, struct file *, int, long unsigned int)' [-Werror=incompatible-pointer-types]
1155 428 | bme680_control /* control */
1156 | ^~~~~~~~~~~~~~
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 19:54:38 +08:00
wanggang26
f6c1d88931
mmcsd: fix a build error
...
Error: mmcsd/mmcsd_sdio.c:1419:12: error: 'mmcsd_setblockcount' defined
but not used [-Werror=unused-function]
1172 1419 | static int mmcsd_setblockcount(FAR struct mmcsd_state_s
*priv,
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-19 15:44:59 +08:00
wanggang26
1a6e8b9c99
mmcsd: fix a logic error
...
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-19 07:29:33 +02:00
wangjianyu3
d2b58a520e
sensor.c: Rename container_of to list_container_of
...
https://github.com/apache/nuttx/pull/11805
Log:
/github/workspace/sources/nuttx/drivers/sensors/usensor.c: In function 'usensor_get_info':
Warning: /github/workspace/sources/nuttx/drivers/sensors/usensor.c:228:44: warning: implicit declaration of function 'container_of'; did you mean 'list_container_of'? [-Wimplicit-function-declaration]
228 | FAR struct usensor_lowerhalf_s *ulower = container_of(lower,
| ^~~~~~~~~~~~
| list_container_of
Error: /github/workspace/sources/nuttx/drivers/sensors/usensor.c:229:44: error: expected expression before 'struct'
229 | struct usensor_lowerhalf_s,
| ^~~~~~
/github/workspace/sources/nuttx/drivers/sensors/usensor.c: In function 'usensor_control':
Error: /github/workspace/sources/nuttx/drivers/sensors/usensor.c:241:44: error: expected expression before 'struct'
241 | struct usensor_lowerhalf_s,
| ^~~~~~
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 11:45:11 +08:00
Petro Karashchenko
549ad08013
can/sja1000: drop driver dependency on __builtin functions
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-09-19 09:39:04 +08:00
Shoukui Zhang
5d3d123272
BCH: Add readonly configuration for BCH devices
...
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2024-09-19 03:53:20 +08:00
wangjianyu3
607b8effe9
driver/sensors: Let gnss geofence follow the existing naming rules
...
ORB_ID(sensor_gnss_geofence_event)
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
ffac2a314b
driver/sensors: Support GNSS Geofence
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
bf83b3fafc
driver/sensors: Support GNSS Measurement & Clock
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
e830db0316
driver/sensors: Add constellation for GNSS
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
wangjianyu3
c652f41c87
nuttx/uorb: Rename GPS to GNSS
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
b17c074a18
nuttx/uorb: change unsigned long to uint32 to fix size issue
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
abbd9c7da9
drivers/sensors: Limit notification events to user
...
1. notify POLLIN to reader.
2. notify POLLPRI to writer,
in addition, notify POLLPRI to the user who completed the flush .
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
dongjiuzhu1
403469336f
driver/sensors: support sensor flush operation
...
Supports the flush operation of the sensor.
The application can initiate a flush action through ioctl SNIOC_FLUSH
to trigger flush, and the call will be returned immediately.
Using SNIOC_GET_EVENTS to clear flush event,
However, the flush implementation is asynchronous, when all the flush
data is push to upper circbuffer, the POLLPRI event(FLUSH_COMPLETED)
will be reported.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-19 03:44:49 +08:00
likun17
703bb7e7b3
sensor.c: Added new interface for obtaining and setting sensor device information.
...
When there is an actual physical sensor, the driver must implement the get info interface. The upper layer can obtain the actual physical sensor information through SNIOC_GET_INFO.
SNIOC_SET_INFO can only set the information of the local virtual sensor, which means it is bound to the local advertisement. Remote subscribers cannot set the information.
Usage:
struct sensor_device_info dev_info;
orb_ioctl(fd, SNIOC_GET_INFO, (unsigned long)(uintptr_t)&dev_info);
or:
ret = orb_set_info(fd, &dev_info);
ret = orb_get_info(fd, &dev_info);
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-19 03:44:49 +08:00