160 Commits

Author SHA1 Message Date
Piyush Patle 0dccc8ba21 include/debug.h: Move to include/nuttx/debug.h
debug.h is a NuttX-specific, non-POSIX header. Placing it in the
top-level include/ directory creates naming conflicts with external
projects that define their own debug.h.
This commit moves the canonical header to include/nuttx/debug.h,
following the NuttX convention for non-POSIX/non-standard headers,
and updates all in-tree references.

A backward-compatibility shim is left at include/debug.h that
emits a deprecation #warning and re-includes <nuttx/debug.h>,
allowing out-of-tree code to continue building while migrating.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
yintao 621da5bc5c drivers/rpmsg_virtio: Add VIRTIO_RPMSG_F_BUFADDR to support specify the address
support specify the address by h2r_buf_addr and r2h_buf_addr
so is can split shared memory pool

Signed-off-by: yintao <yintao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-03-05 12:39:13 +08:00
Bowen Wang 877a9af2d1 rpmsg_virtio/rptun: support fallback cpuname when VIRTIO_RPMSG_F_CPUNAME not set
When the VIRTIO_RPMSG_F_CPUNAME feature is not negotiated, the driver
previously would crash due to DEBUGASSERT. This commit adds support
for a fallback mechanism:

1. Add rpmsg_virtio_probe_cpuname() API that accepts an optional cpuname
   parameter to be used when VIRTIO_RPMSG_F_CPUNAME is not available.

2. Modify rptun driver to pass the cpuname from rptun device config
   to rpmsg_virtio_probe_cpuname().

3. Refactor rptun device register/unregister to prioritize RPMSG device
   handling before other virtio device types.

This ensures the system works correctly in scenarios where the remote
side does not support the VIRTIO_RPMSG_F_CPUNAME feature.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-04 20:01:13 -03:00
liaoao 425a760799 drivers/rpmsg: implement timestamp support for rpmsg_port
Add TX/RX timestamp tracking for rpmsg_port to enable latency
measurement and debugging:

- Add rpmsg_port_get_timestamp() to retrieve buffer timestamps
- Add rpmsg_port_update_timestamp() to record timestamps at TX/RX time
- Integrate timestamp recording in rpmsg_port_spi and rpmsg_port_spi_slave
- Reserve space for rpmsg_timestamp_s in buffer size calculations

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-02-01 01:14:49 +08:00
liaoao 198a8fe108 drivers/rpmsg: add rpmsg_get_timestamp to retrieve buffer timestamps
Add rpmsg_get_timestamp() API to get the TX/RX timestamps of an rpmsg
buffer. This is useful for latency measurement and debugging purposes.

The new rpmsg_timestamp_s structure contains:
  - tx_nsec: timestamp when the buffer was transmitted
  - rx_nsec: timestamp when the buffer was received

Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-02-01 01:14:49 +08:00
Bowen Wang 521fcd964d virtio: should use size matched operation to read virtio config space
1. Use virtio_read_config_bytes() to read the string types in
rpmsg-virtio and virtio-net;
2. Use virtio_read_config_member() to read the elements in
virtio-snd configuration space;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-30 08:11:57 -03:00
Bowen Wang 16763e4c67 drivers/rpmsg_port: support release the rx buffer in ept->cb
Now we can release the rx buffer in ept->cb, ept->cb should copy
the rx buffer it's private buffer and then return
RPMSG_SUCCESS_BUFFER_RETURNED.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-29 09:26:50 -03:00
zhangbo56 6735550815 drivers/rpmsg_port_uart: Fix some compile warnings
some printf formats warning fix

Signed-off-by: zhangbo56 <zhangbo56@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 6b7acc1760 drivers/rpmsg_port_uart: clear the connected stats first when recv poweroff
When recv peer poweroff command, should clear the connected status
first to avoid there is data to send when call the rpmsg_unregister(),
then tx thread hang at the data send process but peer has power
off.

When clear the connected status first, rpmsg_port_uart_tx_ready()
will drop the tx packet to avoid tx thread is waked up to send useless
data.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 8889bdd967 drivers/rpmsg_port_uart: do rpmsg_port_unreigster when connected
rpmsg_port_unreigster() should be called after rpmsg_port_reigster(),
so add the connected condition when receive poweroff command.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang f93876228a drivers/rpmsg_port_uart: add rpmsg_port_uart dump support
Dump the rx/tx thread backtrace.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 7496666de3 drivers/rpmsg_port: support dump ops and dump when get buffer timeout
To debug the tx buffer get failed issue, the rpmsg port uart/spi
can use this mechanism to dump more debug informations.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang e36fd2d05a drivers/rpmsg_port_uart: support the rx recursive logic
Fix the case that tx thread want to send data to peer and try to
wakeup peer, but rx thread blocked on the tx buffer got procees and
so rx thread can't process the commands includes the wakeup ack
command, then the tx thread will hang at the wakeup process forever.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang b200f49697 drivers/rpmsg_port: notify the lower transport when no free buffers
When no free buffers, notify the lower transport, so the lower
transports can know this thing and do some work, such as continue
to process the rx data to avoid the rx thread is blocked that
even can't process the commands.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 5efa6b8ecd drivers/rpmsg_port_uart: move the command process to a function
Extract command process code to a standalone function to simplify
the rx thread code.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 4dce10e024 drivers/rpmsg_port_uart: rename tx/rxwakelock to tx/rx_wakelock
Unified naming method

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 42809c17a7 drivers/rpmsg_port_uart: use ping-pong wake/ack to fix wake/ack issue
Orignal issue: the new wakeup process may be waked by the last Ack
command from peer, and lead the data is lost because peer may have
enter into the sleep mode.

W = Wake, A = WakeAck, R = Relax, D = Data
TX: [0]W-[1]R--------[4]W----[6]DDDDDDDDDDDD-------
RX: ------------[3]A----[5]Enter Sleep-------------

In this figure, Ack command [3] wakeup the wakeup process [4] because
[3] may be received with a delay.

Now use the ping-pong wake/ack command to fix this issue because
the different wake/ack command can block the last Ack command
wake the wrong wakeup process.
W1 = Wake1, A1 = WakeAck1, W2 = Wake2, A2 = WakeAck2, R = Relax, D = Data
TX: [0]W1-[1]R-------[4]W2----------[6]DDDDDDDDDDD--
RX: ------------[3]A1---------[5]A2-----------------

With this patch, the Ack comamnd [3] can't wakeup the wakeup process [4]
because [3] is Ack1 but [4] is Wake2, and local will not send data until
peer response a [5]Ack2.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 4025f258c7 drivers/rpmsg_port_uart: dump error data when recv error char
Try to dump more error log to catch the uart trasmission issue.
1. dump the received error char when received the non start char
at the wait start state;
2. dump the dbg buffer and received buffer when received the
duplicate end char at the wait start state;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang f833f0ed79 drivers/rpmsg_port_uart: add debug buffer for rpmsg_port_uart
Record the history receive data for debug

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang df366b591f drivers/rpmsg_port_uart: add reboot notifier for rpmsg_port_uart
Peer will receive the power off command and unregister the rpmsg
connections to avoid the rpmsg services stuck at the rpmsg operations.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 3e9003802b drivers/rpmsg_port_uart: support wake up by peer core
Support wakeup by peer core (Linux)

1. Add 3 commands: STAYWAKE/RELAXWAKE/STAYWAKEACK

Local will stay the wakeup source when received the STAYWAKE command
and relax the pm wake soucre when received the RELAXWAKE.
And local should response the STAYWAKEACK to peer to notify local has
been waked up.

Local core must send the RELAXWAKE command to peer when there is nothing
to do (send/receive data) otherwise peer can't enter into sleep mode.
So we wakeup the tx thread to send the RELAXWAKE command at the time
that may blocked in the file_read() in rx thread.

NOTE:
Local core should relax the pm wakelock when received POWEROFF
command to allow enter into sleep mode when peer core SHUTDOWN.

2. Change all the flags to event, use event is more convinent
to reprsent all the flags. But the tx sem must be kept because we need
support notify the tx is ready event the tx thread is running to avoid
miss any tx ready event.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang af7ff1b52b drivers/rpmsg_port_uart: process the commands as much as possible
To avoid the command is not processed when hang in the rx_cb

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang d0185e2746 drivers/rpmsg_port_uart: change some important debug logs level
Increace some important debug logs level fot debug

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang ee02d0c769 drivers/rpmsg_port_uart: switch the uart IO to GPIO when peer poweroff
Use the TIOCVHANGUP to notify the driver to switch the uart io
to gpio mode to avoid the current leak caused by the uart io because
peer core may already poweroff so the io can be in high voltage
state.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 579cf47299 drivers/rpmsg_port_uart: reserved more commands for future use
To maintain compatibility in future update, the data transfer is
still valid even can't process the new added command.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Bowen Wang 2386d80d53 drivers/rpmsg_port_uart: do not panic when received error happened
1. Dump the error log and continue process the next packet when
received error happened instead direclty panic to allow use adb
to update peer core's firmeware;
2. Add more error log to debug the receive error;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-28 19:23:41 +08:00
Xiang Xiao 91d4aeba66 drivers/rpmsg_port_uart: unify the timeout usage
All the timeout use macro RPMSG_PORT_UART_TIMEOUT

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-28 19:23:41 +08:00
Xiang Xiao 4bbccac6f0 drivers/rpmsg_port_uart: Zero next when hit RPMSG_PORT_UART_RX_WAIT_START twice
align the behaviour with Linux driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-28 19:23:41 +08:00
Yongrong Wang f56ea30479 drivers/rpmsg: refactor internal APIs to private header
Move rpmsg internal APIs from public header include/nuttx/rpmsg/rpmsg.h
to private header drivers/rpmsg/rpmsg.h. These APIs are only used within
the rpmsg driver implementation and should not be exposed to external
modules.

Moved APIs:
- rpmsg_modify_signals()
- rpmsg_ns_bind() / rpmsg_ns_unbind()
- rpmsg_device_created() / rpmsg_device_destory()
- rpmsg_register() / rpmsg_unregister()

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-26 17:23:31 -03:00
liaoao ae6ad9c193 drivers/rpmsg_port_spi_slave: add getrecvbuf callback for zero-copy receive
Add a new getrecvbuf callback to the SPI slave device operations
that allows the slave device to provide a pre-allocated receive
buffer directly to the controller. This enables zero-copy data
transfer by allowing the controller to receive data directly into
the device's buffer instead of copying.

Changes:
- Add SPIS_DEV_GETRECVBUF macro and getrecvbuf callback to
  spi_slave_devops_s structure in include/nuttx/spi/slave.h
- Implement getrecvbuf in rpmsg_port_spi_slave driver
- Update getdata to return 0 as it's no longer used for this path

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao fd6ab20362 drivers/rpmsg_port_spi: fix SPI exchange length calculation
The cmdhdr->len was uninitialized before being used in SPI exchange
operations. This caused incorrect transfer lengths.

Changes:
- Initialize cmdhdr->len to sizeof(struct rpmsg_port_header_s) during
  initialization for both SPI master and slave drivers
- Use port.txq.len instead of cmdhdr->len for TX exchange length
- Use port.rxq.len instead of cmdhdr->len for RX getdata length

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao ba81948741 drivers/rpmsg_port_spi/slave: update type of pin number to pinset_t
Correct the gpio pin number type

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 9f4708f643 drivers/rpmsg_port_spi: fix build error
CC:  vfs/fs_unlink.c rpmsg/rpmsg_port_spi.c: In function ‘rpmsg_port_spi_complete_handler’:
rpmsg/rpmsg_port_spi.c:415:11: warning: implicit declaration of function ‘rpmsg_port_spi_drop_packets’; did you mean ‘rpmsg_port_drop_packets’? [-Wimplicit-function-declaration]
  415 |           rpmsg_port_spi_drop_packets(rpspi, RPMSG_PORT_SPI_DROP_ALL);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           rpmsg_port_drop_packets
rpmsg/rpmsg_port_spi.c:415:46: error: ‘RPMSG_PORT_SPI_DROP_ALL’ undeclared (first use in this function); did you mean ‘RPMSG_PORT_DROP_ALL’?
  415 |           rpmsg_port_spi_drop_packets(rpspi, RPMSG_PORT_SPI_DROP_ALL);
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~
      |                                              RPMSG_PORT_DROP_ALL

rpmsg/rpmsg_port_spi_slave.c:292:5: warning: implicit declaration of function ‘container_of’; did you mean ‘list_container_of’? [-Wimplicit-function-declaration]
  292 |     container_of(port, struct rpmsg_port_spi_s, port);
      |     ^~~~~~~~~~~~
      |     list_container_of

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 986a1f38a6 drivers/rpmsg_port_spi/slave: increase rx thread default stack size
The default stack size should be large enough to avoid the stack
overflow:

0x18551ad8      1968      1968   100.0%!    24.2%   rpmsg-spi

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 49d95aa0d1 drivers/rpmsg_port_spi/slave: remove the pm prepare ops
Use pm wakelock is enough to make sure system will not suspend
when there is a transfer in process, and it can actually sleep when
there is buffer to send but peer side not response in 1ms which is
the timeout we set.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao a52dc0e785 drivers/rpmsg_port_spi_slave: unbind spictrl when peer shutdown
Unbind the spictrl to close the spi controller, and bind it again
when peer boots.
This can help to reduce the leak current caused by the spi gpio.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
Xiang Xiao fa947f95ee drivers/rpmsg_port_spi/slave: add RPMSG_PORT_SPI_ prefix to BYTES2WORDS
Code format optimization

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:17:27 +08:00
Xiang Xiao 8981810e96 drivers/rpmsg_port_spi: call rpmsg_port_spi_pm_action(false) in inactive path
Only call rpmsg_port_spi_pm_action(false) when no more data to
transfer to avoid unnecessary pm unlock/lock operations.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 6ca67e4061 drivers/rpmsg_port_spi: check crc value only when crc is enabled
Allow one side enables crc check while the other side not enabled.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao de5ec3be6c drivers/rpmsg_port_spi/slave: notify remote core when reboot
Now rpmsg_port_spi/slave support send shutdown command to remote
core to notify then local core will reboot, so remote core can
notify all the rpmsg services to do the unregister.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao abe28e1bcf drivers/rpmsg_port_spi/slave: add pm ops support for rpmsg port spi
Add low power support for the rpmsg port spi/slave transport, now
the rpmsg port spi/slave transport will not allow enter into the
low power state when there are still tx data to sent or rx data
to processed.

Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-26 21:17:27 +08:00
Yongrong Wang aa567d43f6 drivers/rpmsg: fix struct alignment issue by removing zero array member
This commit fixes a memory alignment issue in the rpmsg subsystem.
The previous implementation used a flexible array member (rdev[0])
in struct rpmsg_s, but due to automatic 8-byte padding, rpmsg->rdev
could differ from the transport layer's rdev address (e.g.,
rpmsg_virtio->rvdev.rdev), causing potential memory corruption.

Changes:
- Remove rdev[0] flexible array member from struct rpmsg_s
- Add rpmsg_get_rdev_by_rpmsg() inline helper to calculate rdev
  address as (rpmsg + 1), ensuring correct pointer arithmetic
- Update all rpmsg->rdev references to use the new helper function
- Fix rpmsg_virtio_notify_wait() to use correct container_of macro

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-01-26 21:12:34 +08:00
Bowen Wang 2795918932 drivers/rpmsg: unify cpuname/local_cpuname to struct rpmsg_s
Unify all the cpuname/local_cpuname to struct rpmsg_s, so we can
remove the ops->get_cpuname and ops->get_local_cpuname in
struct rpmsg_ops_s.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-24 17:10:18 +08:00
buxiasen c4acb35000 drivers/rpmsg_virtio_lite: init the pm wakelock name
Fix the issue that pm feature not picked before
rename the rpmsg_virtio to rpmsg_virtio_lite

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-24 17:10:18 +08:00
Bowen Wang ccf660ce10 drivers/rpmsg: use explicit NULL comparisons for pointer checks
Replace implicit pointer checks (!ptr and ptr) with explicit
NULL comparisons (ptr == NULL and ptr != NULL) to follow
NuttX coding style guidelines.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-22 22:08:32 +08:00
yintao 6a4feb4fc4 drivers/rpmsg_router: rename dst_ept to peer_ept
peer_ept is a better name than dst_ept

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-22 22:08:32 +08:00
yintao 7d61b7c43f drivers/rpmsg_router: fix race condition lead to use-after-fre
Should only destroy one side endpoint when receive one side
NS destroy message.

Before:
edge1           hub                  edge2
destroy -->     edge1 destroy
                edge2 destroy
                (used-after-free)
                edge2 destroy    <-- destroy
                edge1 destory

After
edge1           hub                  edge2
destroy -->     edge1 destroy
                edge2 destroy    <-- destroy

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-22 22:08:32 +08:00
yintao 31664023f9 drivers/rpmsg_router: avoid rpmsg:cpu failed to bind dest
nxsig_clockwait
/home/work/data/miui_codes/build_home_rom/nuttx/sched/signal/sig_timedwait.c:329 (discriminator 1)
nxsig_clockwait
/home/work/data/miui_codes/build_home_rom/nuttx/sched/signal/sig_timedwait.c:320
nxsig_nanosleep
/home/work/data/miui_codes/build_home_rom/nuttx/sched/signal/sig_nanosleep.c:96
nxsig_usleep
/home/work/data/miui_codes/build_home_rom/nuttx/sched/signal/sig_usleep.c:84
__metal_sleep_usec
/home/work/data/miui_codes/build_home_rom/nuttx/drivers/../include/metal/system/nuttx/sleep.h:27
rpmsg_device_destory
/home/work/data/miui_codes/build_home_rom/nuttx/drivers/rpmsg/rpmsg.c:473
rpmsg_port_unregister
/home/work/data/miui_codes/build_home_rom/nuttx/drivers/rpmsg/rpmsg_port.c:751
rpmsg_port_spi_process_packet
/home/work/data/miui_codes/build_home_rom/nuttx/drivers/rpmsg/rpmsg_port_spi.c:572
nxtask_start
/home/work/data/miui_codes/build_home_rom/nuttx/sched/task/task_start.c:111

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-22 22:08:32 +08:00
yintao 28e2ca5d23 drivers/rpmsg_router: Distinguish NS_CREATE or NS_ACK for rpmsg_router_edge
If ns_msg->flags == RPMSG_NS_CREATE_ACK, means already know peer's address
so direclty use usr_ept->dest_addr

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-22 22:08:32 +08:00
yintao 6e3f0b0a53 drivers/rpmsg_router: fix double free at rpmsg_router_hub_unbind
fist free when rpmsg_port_unregister at rpmsg spi thread
<free+12>
<rpmsg_router_hub_ept_release+6>
<rpmsg_ept_decref+28>
<rpmsg_unregister_endpoint+120>
<rpmsg_destroy_ept+40>
<rpmsg_router_hub_unbind+22>
<rpmsg_device_destory+172>
<rpmsg_port_unregister+26>

this thread will free r:droid and r:audio at last;
But in this process,
rpmsg_destroy_ept "r:droid" will send NS_destroy to audio;
audio will response NS_destroy to ap; if r:droid has not been
removed from the ept list yet, the rptun_audio thread on ap will
occur as follows:

3  0x103016fa in kasan_check_report
4  0x103018b6 in __asan_store4_noabort
5  0x106ca352 in metal_list_del
6             in rpmsg_unregister_endpoint
7  0x106ca77a in rpmsg_destroy_ept
8  0x102db232 in rpmsg_router_hub_unbind
9  0x106cabb2 in rpmsg_virtio_ns_callback
10 0x106cad5c in rpmsg_virtio_rx_callback
11 0x106cc190 in virtqueue_notification
12 0x106ca064 in rproc_virtio_notified
13 0x106c9ad0 in remoteproc_get_notification
14 0x102dd4ba in rptun_worker at rptun/rptun.c:334
15 rptun_worker (arg=<optimized out>) at rptun/rptun.c:328
16 0x102dd974 in rptun_thread  rptun/rptun.c:353
17 0x102cd558 in nxtask_start () at task/task_start.c:1

this will lead to r:audio be freed again.

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-22 22:08:32 +08:00