Repository navigation
[For testing] IPC4 timeout fixes (combo of PR6243 and PR6239) #6242
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
Changes from all commits
bd197f8
030907c
7f1b5ee
abe8ea5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,9 @@ struct ipc { | |
| /* processing task */ | ||
| struct task ipc_task; | ||
|
|
||
| /* task for flushing outbound messages */ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to the commit message: "the platform driver returns -EBUSY?"
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, fixed in #6243 |
||
| struct task ipc_tx_task; | ||
|
|
||
| void *private; | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -981,13 +981,48 @@ void ipc_boot_complete_msg(struct ipc_cmd_hdr *header, uint32_t data) | |
| } | ||
|
|
||
| #ifdef CONFIG_LOG_BACKEND_ADSP_MTRACE | ||
|
|
||
| static bool is_notification_queued(void) | ||
| { | ||
| struct ipc *ipc = ipc_get(); | ||
| struct list_item *slist; | ||
| struct ipc_msg *msg; | ||
| k_spinlock_key_t key; | ||
| bool queued = false; | ||
|
|
||
| key = k_spin_lock(&ipc->lock); | ||
| if (list_is_empty(&ipc->msg_list)) | ||
| goto out; | ||
|
|
||
| list_for_item(slist, &ipc->msg_list) { | ||
| msg = container_of(slist, struct ipc_msg, list); | ||
|
|
||
| if (msg == &msg_notify) { | ||
| queued = true; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| out: | ||
| k_spin_unlock(&ipc->lock, key); | ||
|
|
||
| return queued; | ||
| } | ||
|
|
||
| void ipc_send_buffer_status_notify(void) | ||
| { | ||
| /* a single msg_notify object is used */ | ||
| if (is_notification_queued()) | ||
| return; | ||
|
|
||
| msg_notify.header = SOF_IPC4_NOTIF_HEADER(SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS); | ||
| msg_notify.extension = 0; | ||
| msg_notify.tx_size = 0; | ||
| list_init(&msg_notify.list); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that it affects the test in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it OK to list_init() every time?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lyakh We might have contention between FW->HOST replies and FW->HOST notifications. Kernel needs to ack both and until kernel ack is received, ipc_msg_send() will return EBUSY.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kv2019i Just for the record - you probably mean |
||
|
|
||
| ipc_msg_send(&msg_notify, NULL, true); | ||
|
|
||
| return; | ||
| } | ||
| #endif | ||
|
|
||
|
|
@@ -1014,6 +1049,7 @@ void ipc_cmd(struct ipc_cmd_hdr *_hdr) | |
| msg_reply.tx_size = 0; | ||
| msg_reply.header = in->primary.dat; | ||
| msg_reply.extension = in->extension.dat; | ||
| list_init(&msg_reply.list); | ||
|
|
||
| target = in->primary.r.msg_tgt; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a test. I prefer to do it in ipc4/handler.c without ifdef.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RanderWang Not sure I follow. This is writing to IPC hw registers and it thus should be done in the driver, not the protocol code in ipc4/handler.c. Right? The ifdef is needed as same driver is used for IPC3 and there the semantics are different ACK/REPLY are the same thing, so the proper place to do is later.