xuxingliang
17cbaadce8
task: use get_task_name where possible
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-25 19:04:02 +08:00
dulibo1
c0ce2083ad
ramlog:flush should reset the tail of the reader
...
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-10-25 19:04:02 +08:00
dulibo1
2f12e18297
noteram:read noteram may cause crash
...
noteram_get may cause _read = ni_bufsize cause assert crash
[ 1493.627200] [79] [ EMERG] [ap] _assert: Assertion failed : at file: note/noteram_driver.c:370 task: trace process: trace 0x446f238a
[ 1493.627400] [79] [ EMERG] [ap] backtrace:
[ 1493.627500] [79] [ EMERG] [ap] [79] [<0xf7933c9d>] _fini+0xae0720b9/0xb673e41b
[ 1493.628400] [79] [ EMERG] [ap] [79] [<0x498b1b0c>] host_backtrace+0x42/0x72
[ 1493.629300] [79] [ EMERG] [ap] [79] [<0x48bef3d1>] up_backtrace+0x127/0x2d2
[ 1493.630200] [79] [ EMERG] [ap] [79] [<0x48b86bed>] sched_backtrace+0x71/0x8a
[ 1493.631100] [79] [ EMERG] [ap] [79] [<0x44676273>] sched_dumpstack+0xed/0x486
[ 1493.631600] [79] [ EMERG] [ap] [79] [<0x445c61ff>] _assert+0x9f0/0xb38
[ 1493.632200] [79] [ EMERG] [ap] [79] [<0x4420dd07>] __assert+0x3f/0x4c
[ 1493.632800] [79] [ EMERG] [ap] [79] [<0x44151648>] noteram_get+0x1b0/0x5fe
[ 1493.633600] [79] [ EMERG] [ap] [79] [<0x44152370>] noteram_read+0x331/0x4f7
[ 1493.634200] [79] [ EMERG] [ap] [79] [<0x444c66f9>] file_read+0x38b/0x3c0
[ 1493.634700] [79] [ EMERG] [ap] [79] [<0x444c6840>] nx_read+0x112/0x170
[ 1493.635300] [79] [ EMERG] [ap] [79] [<0x444c68e5>] NXread+0x47/0xfa
[ 1493.635800] [79] [ EMERG] [ap] [79] [<0x446f2c70>] trace_dump+0x148/0x2f4
[ 1493.636400] [79] [ EMERG] [ap] [79] [<0x446f110b>] trace_cmd_dump+0x41b/0x4b9
[ 1493.636900] [79] [ EMERG] [ap] [79] [<0x446f2723>] trace_main+0x399/0x6e2
[ 1493.637500] [79] [ EMERG] [ap] [79] [<0x44217fc9>] nxtask_startup+0x69/0x7c
[ 1493.638000] [79] [ EMERG] [ap] [79] [<0x440f9b78>] nxtask_start+0x8a5/0x8b8
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-10-25 19:04:02 +08:00
yinshengkai
1c8d0bfdc7
note: add ringbuffer aligned access handle
...
Fix ubsan warning that writes need to be aligned to memory boundaries when writing data
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-25 19:04:02 +08:00
dulibo1
ca989b5101
noteram:overflow may discard all the trace message
...
noteram_add may cause head = tail when remain == NOTE_ALIGN(notelen)
log:
nsh_main-14 [0] 2.132127493: tracing_mark_write: B|14|trace dump -c
nsh_main-14 [0] 2.143322780: tracing_mark_write: E|14|trace dump -c
nsh_main-14 [0] 2.513023895: tracing_mark_write: B|14|trace dump -c
nsh_main-14 [0] 2.524060048: tracing_mark_write: E|14|trace dump -c
nsh_main-14 [0] 2.897055341: tracing_mark_write: B|14|trace dump -c
ap> trace dump -c
nsh_main-14 [0] 3.270037241: tracing_mark_write: B|14|trace dump -c
ap> trace dump -c
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2024-10-25 19:04:02 +08:00
yangsong8
5ff98fb4e1
syslog: enable LF to CRLF config as default
...
This commit fixes the issue #14418
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-21 15:06:31 +02:00
Xiang Xiao
002d89885e
net: Remove IFF_DOWN flag to compatible with Linux/*BSD
...
turn off interface by checking IFF_UP flag isn't set:
https://github.com/apache/nuttx/issues/1838
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-15 22:40:22 +08:00
likun17
068c7176bb
usensor.c:fix container_of member error.
...
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-11 00:52:00 +08:00
lipengfei28
1cb81f9a8f
armv7a pci irq support
...
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-10 15:31:08 +02:00
Bowen Wang
f2a4d59900
pci/pci_ecam: add read_io/write_io for pci ecam
...
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 15:31:08 +02:00
Bowen Wang
fb97285a36
drivers/pci: one pci device should only associate with one driver
...
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 15:31:08 +02:00
Bowen Wang
dbcef4f297
drivers/pci: change all devfn type to unsigned int
...
Now all the type of devfn in pci framework are unsigned int
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 15:31:08 +02:00
Yongrong Wang
fe1286b44a
pci.c: fix compile warning
...
pci/pci.c:1128:15: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
1128 | pciinfo("Limit MME to %x, num to %d\n", mmc, num);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~
| |
| uint32_t {aka long unsigned int}
pci/pci.c:1128:30: note: format string is defined here
1128 | pciinfo("Limit MME to %x, num to %d\n", mmc, num);
| ~^
| |
| unsigned int
| %lx
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-10-10 15:31:08 +02:00
p-szafonimateusz
87b940a611
drivers/pci_qemu_test.c: fix compiler warning
...
pci/pci_qemu_test.c:218:6: warning: ‘ops’ may be used uninitialized [-Wmaybe-uninitialized]
218 | ops->write(dev->bus, &hdr->test, num, sizeof(num));
| ~~~^~~~~~~
pci/pci_qemu_test.c: In function ‘pci_qemu_test_probe’:
pci/pci_qemu_test.c:286:41: note: ‘ops’ was declared here
286 | FAR const struct pci_qemu_test_ops_s *ops;
|
Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-10 15:31:08 +02:00
wangyongrong
7f4f7f293d
pci.c: fix pci 32bit warning
...
pci/pci.c:863:66: warning: right shift count >= width of type [-Wshift-count-overflow]
863 | pci_write_config_dword(dev, msi + PCI_MSI_ADDRESS_HI, (mar >> 32));
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-10 15:31:08 +02:00
Bowen Wang
1407a44862
drivers/pci/pci.c: fix warning when CONFIG_PCI_ASSIGN_ALL_BUSES=n
...
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
415 | FAR struct pci_resource_s *res;
| ^~~
pci/pci.c: In function ‘pci_scan_bus’:
pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable]
663 | FAR struct pci_controller_s *ctrl = bus->ctrl;
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-10 15:31:08 +02:00
lipengfei28
519c5c86aa
add pci irq interface
...
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-10 15:31:08 +02:00
zhaohaiyang1
45bb7a9c1c
char driver CAN: add tx_confirm function in upperCAN driver.
...
add tx_confirm function in upperCAN driver1
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-10 17:58:36 +08:00
zhaohaiyang1
63515d584b
chardriver upperCAN: support to independent set TX/RX FIFO size.
...
support to independent set TX/RX FIFO size.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-10 17:58:36 +08:00
zhaohaiyang1
9b698b2304
add the ability that control CAN transceiver state.
...
add the ability that control CAN transceiver state in nuttx.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2024-10-10 17:58:36 +08:00
Xiang Xiao
ccddaa78c9
can: Add more critical section to fix the race condition.
...
since routines called by IRQ need to be protected in SMP too.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-10 17:58:36 +08:00
Xiang Xiao
4324970980
can: Merge cd_error and rx_overflow into rx_error so the error could dispath to each client without interference
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-10 17:58:36 +08:00
ligd
a965e3c3f9
math: remove is_power_of_2() keep IS_POWER_OF_2()
...
Caused it may conflict with other platfrom
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-08 23:50:47 +08:00
likun17
57f84aaca8
sensor: Added 6dof motion and gesture related types. For details, see: https://developer.android.com/reference/android/hardware/SensorEvent#values
...
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-03 09:06:59 +08:00
dongjiuzhu1
eb0732a183
nuttx/uorb.h: align sensor_type value with aosp refs: 0e67aa0cae
:include_all/hardware/sensors-base.h
...
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-03 09:06:59 +08:00
dulibo1
1179802cfe
gpio:add feature for gpio wakeup
...
1.add pin type to cfg gpio as wake up source
2.add IOEXPANDER_OPTION_WAKEUPCFG for set wake up option
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-10-03 09:06:04 +08: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