Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idc: check if secondary core is down before sending IDC #8466

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/idc/zephyr_idc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
#include <rtos/alloc.h>
#include <rtos/spinlock.h>
#include <ipc/topology.h>
#include <sof/trace/trace.h>
#include <sof/lib/uuid.h>

LOG_MODULE_REGISTER(zephyr_idc, CONFIG_SOF_LOG_LEVEL);

/* 5f1ec3f8-faaf-4099-903c-cee98351f169 */
DECLARE_SOF_UUID("zephyr-idc", zephyr_idc_uuid, 0x5f1ec3f8, 0xfaaf, 0x4099,
0x90, 0x3c, 0xce, 0xe9, 0x83, 0x51, 0xf1, 0x69);

DECLARE_TR_CTX(zephyr_idc_tr, SOF_UUID(zephyr_idc_uuid), LOG_LEVEL_INFO);

/*
* Inter-CPU communication is only used in
Expand Down Expand Up @@ -119,6 +129,10 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode)
work->handler = idc_handler;
work->sync = mode == IDC_BLOCKING;

if (!cpu_is_core_enabled(target_cpu)) {
tr_err(&zephyr_idc_tr, "Core %u is down, cannot sent IDC message", target_cpu);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar: sent->send

return -EACCES;
}
if (msg->payload) {
idc_send_memcpy_err = memcpy_s(payload->data, sizeof(payload->data),
msg->payload, msg->size);
Expand Down