Commit graph

6717 commits

Author SHA1 Message Date
wangjianyu3
b2fc3b2d7f Thermal/step_wise: Fix that hysteresis takes no effect
Test command

  nsh> cat /proc/thermal/cpu-thermal

Trips

  /* Copy from drivers/thermal/thermal_dummy.c */

  {.name = "cpu_crit",   .temp = 90, .hyst = 5, .type = THERMAL_CRITICAL},
  {.name = "cpu_alert1", .temp = 70, .hyst = 5, .type = THERMAL_HOT},
  {.name = "cpu_alert0", .temp = 60, .hyst = 5, .type = THERMAL_NORMAL},

Without this patch

  # Error occured when temperature jump to 69.

  z:cpu-thermal t:67 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:72 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:69 t:1 h:16 l:0 c:fan0 s:0|0
  z:cpu-thermal t:74 t:1 h:16 l:0 c:fan0 s:1|1

With this patch

  z:cpu-thermal t:67 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:72 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:69 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:74 t:1 h:16 l:0 c:fan0 s:2|2

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-28 11:42:09 +08:00
wangjianyu3
51e4bb0f31 Thermal/procfs: Do not print invalid target cooling state directly
Diff
  - z:cpu-thermal t:48 t:1 h:16 l:0 c:fan0 s:0|4294967295
  + z:cpu-thermal t:48 t:1 h:16 l:0 c:fan0 s:0|(invalid)

The invalid value 4294967295(THERMAL_NO_TARGET, defined as UINT_MAX(0xffffffff)) may bother users.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-28 11:42:09 +08:00
wangjianyu3
bdb26eaa6d Thermal/dummy: Add temperature jump to test hysteresis
Log

  z:cpu-thermal t:50 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:47 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:52 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:49 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:54 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:51 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:56 t:1 h:16 l:0 c:fan0 s:0|(invalid)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-28 11:42:09 +08:00
wangjianyu3
e47af10cd3 Thermal: The thermal core depends on LPWORK
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-28 11:42:09 +08:00
wangmingrong1
ea55771478 drivers/e1000: malloc size error
priv->mta is uint32_t

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-28 11:41:19 +08:00
wangjianyu3
b57006e567 drivers/sensors/gnss: Fix deactivate failure when using both topic and device
Deactivate lower driver fails when both uORB topic and driver device are subscribed and opened.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-28 11:40:48 +08:00
Zhe Weng
c331bb9ac5 netdev/upper: Fix wrong CPU when RSS is disabled
When `CONFIG_NETDEV_RSS` is disabled, `NETDEV_THREAD_COUNT` will be 1,
and we should not access `upper->sem[cpu]` with `cpu > 0`.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-12-28 11:40:06 +08:00
hujun5
498c59450f fix a deadlock
0  up_testset (lock=0x404241c0 <g_uart1priv+32>) at /home/hujun5/下载/vela_sim/nuttx/include/arch/spinlock.h:96
1  spin_lock_wo_note (lock=<optimized out>) at /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:207
2  spin_lock_irqsave_wo_note (lock=0x404241c0 <g_uart1priv+32>) at /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:467
3  spin_lock_irqsave (lock=0x404241c0 <g_uart1priv+32>) at /home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:521
4  pl011_txint (dev=0x404240b0 <g_uart1port>, enable=false) at serial/uart_pl011.c:746
5  0x00000000402a3f1c in uart_xmitchars (dev=0x404240b0 <g_uart1port>) at serial/serial_io.c:118
6  0x00000000402a10f8 in pl011_txint (dev=<optimized out>, enable=<optimized out>) at serial/uart_pl011.c:756
7  0x00000000402a2ca0 in uart_write (filep=<optimized out>, buffer=<optimized out>, buflen=0) at serial/serial.c:1493
8  0x000000004028c464 in file_writev_compat (filep=0x4046cda0, uio=<optimized out>) at vfs/fs_write.c:81
9  0x000000004028c588 in file_writev (filep=<optimized out>, uio=uio@entry=0x40470dc0) at vfs/fs_write.c:161
10 0x000000004028c5fc in nx_writev (fd=<optimized out>, iov=iov@entry=0x40470e10, iovcnt=iovcnt@entry=1) at vfs/fs_write.c:257
11 0x000000004028c660 in writev (fd=<optimized out>, iov=iov@entry=0x40470e10, iovcnt=iovcnt@entry=1) at vfs/fs_write.c:356
12 0x000000004028c6dc in write (fd=<optimized out>, buf=buf@entry=0x404090b2 <g_nshgreeting>, nbytes=<optimized out>) at vfs/fs_write.c:421
13 0x00000000402adb10 in nsh_session (pstate=pstate@entry=0x40471080, login=login@entry=1, argc=argc@entry=1, argv=argv@entry=0x4046cf40) at nsh_session.c:108
14 0x00000000402ad94c in nsh_consolemain (argc=argc@entry=1, argv=argv@entry=0x4046cf40) at nsh_consolemain.c:75
15 0x00000000402ad894 in nsh_main (argc=argc@entry=1, argv=argv@entry=0x4046cf40) at nsh_main.c:74
16 0x00000000402a5880 in nxtask_startup (entrypt=0x402ad7fc <nsh_main>, argc=1, argv=0x4046cf40) at sched/task_startup.c:72
17 0x000000004029d444 in nxtask_start () at task/task_start.c:116
18 0x0000000000000000 in ?? ()

fix regresion from https://github.com/apache/nuttx/pull/15301

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-28 11:39:50 +08:00
hujun5
833b9da0f9 use small lock in following files
arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c
arch/z16/src/z16f/z16f_serial.c
arch/z80/src/z8/z8_serial.c
boards/arm/max326xx/max32660-evsys/src/max326_button.c
boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c
drivers/i2c/i2c_bitbang.c
drivers/power/supply/act8945a.c
drivers/serial/uart_pci_16550.c
drivers/serial/uart_pl011.c
drivers/wireless/bluetooth/bt_uart_shim.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-28 11:39:50 +08:00
Jukka Laitinen
925b8b0904 drivers/bch/bchdev_driver.c: Fix BIOC_FLUSH
Don't fail if the lowerhalf mtd driver doesn't support BIOC_FLUSH;
This is normal - if the lowerhalf has nothing to do, it doesn't handle
the IOCTL.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-19 19:22:22 +08:00
Alin Jerpelea
b8a33af866 drivers/usbhost/hid_parser: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
47df393ea6 drivers/input/uinput: migrate to ASF license
Xiaomi has submitted the SGA and the license can be migrated to ASF

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
24b791bdfc drivers/mtd/mtd_config_fs: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 15:29:10 +08:00
Alin Jerpelea
0bfa46497d drivers/spi/ice40: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Copyright and Author information is missing from the License and was filled with
commit authorship
    Signed-off-by: Jakub Janousek <janouja9@fel.cvut.cz>

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-17 08:37:13 +08:00
Andre Heinemans
f4e650352e sensors: fix Make.defs for bmm150 2024-12-16 10:27:21 +08:00
chao an
01e76ddcd9 limits/path: replace CONFIG_PATH_MAX to PATH_MAX to ensure consistency
replace CONFIG_PATH_MAX to PATH_MAX to ensure consistency

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-10 21:56:57 +08:00
lipengfei28
aa1df4e9a9 pci: fix pci dev alloc bridge mem error
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-12-06 21:12:24 +08:00
wangmingrong1
6e3f8d0356 virtio: fix compile error
CC:  virtio/virtio-mmio.c virtio/virtio-mmio.c: In function 'virtio_mmio_config_virtqueue':
virtio/virtio-mmio.c:346:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  346 |       addr = (uint64_t)kasan_reset_tag((FAR void *)vq->vq_ring.desc);
      |              ^
virtio/virtio-mmio.c:350:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  350 |       addr = (uint64_t)kasan_reset_tag((FAR void *)vq->vq_ring.avail);
      |              ^
virtio/virtio-mmio.c:354:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  354 |       addr = (uint64_t)kasan_reset_tag((FAR void *)vq->vq_ring.used)

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-06 20:32:21 +08:00
wangmingrong1
75fc19d729 virtio: Fix the problem of incorrect setting of virtio queue address under tags kasan
There is also a printing error due to https://github.com/apache/nuttx/pull/15043:
Configuration/Tool: rv-virt/virt_nsh
In file included from virtio/virtio-mmio.c:29:
virtio/virtio-mmio.c: In function 'virtio_mmio_init_device':
Error: virtio/virtio-mmio.c:826:14: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  826 |       vrterr("Version %d not supported!\n", vdev->id.version);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~
      |                                                     |
      |                                                     uint32_t {aka long unsigned int}
virtio/virtio-mmio.c:826:24: note: format string is defined here
  826 |       vrterr("Version %d not supported!\n", vdev->id.version);
      |                       ~^
      |                        |
      |                        int
      |                       %ld
cc1: all warnings being treated as errors
make[1]: *** [Makefile:109: virtio-mmio.o] Error 1
make[1]: Target 'libdrivers.a' not remade because of errors.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-05 21:23:30 +08:00
hujun5
1ab1dbc0f0 wm8776: use small lock in drivers/audio/wm8776.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-05 21:22:32 +08:00
zhangyuan29
060fda032b drivers/net: change netdev_lower_quota_load to macro.
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-05 13:26:22 +08:00
zhangyuan29
dcea1b90e7 arch_atomic: only support atomic_xx and atomic64_xx function
Modify the kernel to use only atomic_xx and atomic64_xx interfaces,
avoiding the use of sizeof or typeof to determine the type of
atomic operations, thereby simplifying the kernel's atomic
interface operations.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-12-04 14:03:14 +01:00
wangmingrong1
eed302b8bb virtio: Add virtio version check
In the source code of qemu or linux, there is a check for the virtio version
/* Check device version */
priv->version = readl(priv->base + VIRTIO_MMIO_VERSION);
if (priv->version < 1 || priv->version > 2) {
	debug("(%s): version %d not supported!\n",
	udev->name, priv->version);
	return 0;
}
/* Check device ID */
uc_priv->device = readl(priv->base + VIRTIO_MMIO_DEVICE_ID);
if (uc_priv->device == 0) {
	/*
	* virtio-mmio device with an ID 0 is a (dummy) placeholder
	* with no function. End probing now with no error reported.
	*/
	return 0;
}

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-04 19:49:26 +08:00
chao an
93a34b1992 drivers/timers: export arch timer api to support higher resolution
Before:
[  384.149000] [CPU0] [ 5] Hello World!
After:
[  384.149947] [CPU0] [ 5] Hello World!

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-04 10:52:26 +01:00
gaohedong
9fb84700a8 com/can: Remove unnecessary judgment logic
The feature of preventing the same ID frame rotation should be done in the lowerhalf, not in the upperhalf.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-12-03 08:48:18 +08:00
Jukka Laitinen
140b3080c5 drivers/audio/wm8994.c: Include nuttx/arch.h to fix compilation (up_mdelay prototype)
Fix the compilation error:

  audio/wm8994.c: In function 'wm8994_audio_output':
  Error: audio/wm8994.c:1898:3: error: implicit declaration of function 'up_mdelay' [-Werror=implicit-function-declaration]
   1898 |   up_mdelay(40);
        |   ^~~~~~~~~

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-02 13:14:22 +02:00
pengyiqiang
257339a442 video/fb: fix integer overflow issue
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2024-12-02 13:30:50 +08:00
Simon Filgis
6135892d66 driver for STUSB4500
right now it is only possible to change the delivered power on the fly
by
1. selecting PDO2 slot
2. write to POO2
3. renegotiate power delivery by sw reset command
2024-11-30 08:40:08 -03:00
wangjianyu3
5fbf377214 sensors/fakesensor_uorb: Using different nbuffer for each topic of GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 14:10:57 +08:00
wangjianyu3
d2dd747e09 drivers/sensors/gnss: Different nbuffer for each topic
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 14:10:57 +08:00
wangjianyu3
f1a57f4265 drivers/sensors/gnss: Add suffix to macro of geofence index
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 03:16:25 +08:00
Michal Lenc
a8d4ed910d st7789: add configuration option to set default background color
ST7789 fills the display with 0xffff color during its initialization.
This color may or may not be overwritten by a higher layer (framebuffer
or lcd driver for example). The color remains on the display until
application UI is started if not overwritten by the higher layer before.

This commit adds configuration option LCD_ST7789_DEFAULT_COLOR that
allows to set the default background color. This may avoid shining
display with, for example, white color for an extensive amount of time.
The default value is set to 0xffff previously hard-coded in the driver,
therefore current implementations will not notice the change.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-11-29 18:32:22 +08:00
lipengfei28
f589d5a4c7 pci: pci res have pci addr and cpu addr, ecam use map translation pci
addr to cpuaddr

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-11-29 11:12:54 +08:00
lipengfei28
b44fb53b61 pci:map bar should not be zaro len
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-11-29 11:12:54 +08:00
lipengfei28
c2cd503f66 pci: add /dev/pci,used for pciutils
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-11-29 11:12:54 +08:00
simbit18
9c9b945876 fix nxstyle
Removed extra spaces from .h and .c files
2024-11-28 20:40:13 +08:00
zhanghongyu
ba419cc894 drivers/net/{e1000|igc}: limit no packet is transmit after carrier off
if the drvier tx queue is full up during the network cable unplugging,
there will be no txdone interrupt after inserting the network cable,
transmit cannot be recovered.

Modified to no longer fill the driver with packet when link down.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
0932fccfb2 drivers/net/{e1000|igc}: reset TX ring when disconnected
drivers/net/{e1000|igc}: reset TX ring when disconnected

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
ada47439bd drivers/net/{e1000|igc}: fix link status crash
netdev_lower_carrier_xxx API can't be used in interrupt context

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
5e48f2a3d8 drivers/net/igc: make Interrupt Throttle configurable
make Interrupt Throttle configurable for igc

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
p-szafonimateusz
bf4eadf735 drivers/net/{e1000|igc}: configure RX/TX descriptors from Kconfig
configure E1000/IGC RX/TX descriptors from Kconfig

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 02:46:04 +08:00
Xiang Xiao
573115734d Revert "drivers/pipes: return after short write if buffer is full"
This reverts commit d0680fd1bc.
2024-11-26 11:08:02 -03:00
hujun5
eb65c5a8cd note: Remove enter_critical_section from the sched_note module to avoid recursive calls.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 10:14:02 +08:00
chao an
6ffb001fdf spelling: fix spelling typo premption -> preemption
Signed-off-by: chao an <anchao@lixiang.com>
2024-11-25 22:05:05 +08:00
simbit18
7df0e945ad Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Replace help => ---help---
Remove extra TABs
Add comments
2024-11-20 16:45:40 -03:00
Huang Qi
fd1b52579b Fix some minor style issues
Fix typo and comment style in:
* audio/audio_comp.c
* drivers/drivers_initialize.c
* drivers/pipes/fifo.c

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 10:51:07 +01:00
liamHowatt
27e587b179 arch/esp32s3: fb add pandisplay
Signed-off-by: liamHowatt <liamjmh0@gmail.com>
2024-11-19 20:51:50 +08:00
YAMAMOTO Takashi
aa8aa444c2 drivers/syslog/syslog_channel.c: remove a duplicated comment 2024-11-18 19:10:24 +08:00
buxiasen
f0185cf4db Revert "drivers/pm: pm_smp remove sched_lock"
Now we already support sched_lock for per cpu/tcb

This reverts commit 731af5b42f.
2024-11-18 19:10:14 +08:00
YAMAMOTO Takashi
637a0f5af2 SYSLOG_DEFAULT: avoid using critical section in certain cases
Note that SYSLOG_DEFAULT can be used in extreme situations,
including very early in the boot.
2024-11-18 13:52:53 +08:00