Skip to content

Commit

Permalink
rpmsg_backend: clear reserved bit after the reset work is completed
Browse files Browse the repository at this point in the history
* Clear reserved[0] after the reset work is completed to let host know we're done.

Signed-off-by: hanzongcheng <[email protected]>
  • Loading branch information
mengtanhzc committed Mar 9, 2024
1 parent 5c4e40f commit 1606678
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion subsys/ipc/rpmsg_service/rpmsg_backend_rsc_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static void ipm_callback(const struct device *dev,
uint32_t status;

rsc = (struct fw_resource_table *)context;
metal_cache_invalidate(rsc->reserved, sizeof(rsc->reserved));
status = rsc->reserved[0];

(void)dev;
Expand All @@ -175,12 +176,15 @@ static void ipm_callback(const struct device *dev,
if (status == CPU_OFF_FUNCID) {
/* cpu off work */
k_work_submit_to_queue(&ipm_work_q, &ipm_work_cpu_off);
} else if (status == CPU_ON_FUNCID) {
} else if (status == CPU_ON_FUNCID || status == 0) {
/* normal work */
k_work_submit_to_queue(&ipm_work_q, &ipm_work_vring_rx);
} else if (status == SYSTEM_RESET) {
/* attach work: reset virtqueue */
reset_vq();
/* clear reserved[0] after the reset work is completed */
rsc->reserved[0] = 0;
metal_cache_flush(rsc->reserved, sizeof(rsc->reserved));
}
}

Expand Down

0 comments on commit 1606678

Please sign in to comment.