-
Notifications
You must be signed in to change notification settings - Fork 350
ipc4: add counter to mtrace buffer status notification #10564
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1641,6 +1641,8 @@ __cold void ipc_send_panic_notification(void) | |||||||
|
|
||||||||
| #ifdef CONFIG_LOG_BACKEND_ADSP_MTRACE | ||||||||
|
|
||||||||
| static atomic_t mtrace_notify_counter; | ||||||||
|
|
||||||||
| static bool is_notification_queued(struct ipc_msg *msg) | ||||||||
| { | ||||||||
| struct ipc *ipc = ipc_get(); | ||||||||
|
|
@@ -1663,7 +1665,8 @@ void ipc_send_buffer_status_notify(void) | |||||||
| return; | ||||||||
|
|
||||||||
| msg_notify.header = SOF_IPC4_NOTIF_HEADER(SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS); | ||||||||
| msg_notify.extension = 0; | ||||||||
| atomic_add(&mtrace_notify_counter, 1); | ||||||||
| msg_notify.extension = atomic_read(&mtrace_notify_counter); | ||||||||
|
Comment on lines
+1668
to
+1669
|
||||||||
| atomic_add(&mtrace_notify_counter, 1); | |
| msg_notify.extension = atomic_read(&mtrace_notify_counter); | |
| msg_notify.extension = atomic_inc_return(&mtrace_notify_counter); |
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.
ack atomic_add() will return the current value which we should use in the extension.
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.
Why does the host need this? Has there been a situation where it received the same notification more than once?
I checked the documentation and there is no such iterator in this message. I think in the case of all notifications the extension field remains empty.
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.
The atomic counter should be initialized explicitly to ensure a known starting state. Consider using ATOMIC_INIT(0) or an initialization function to set the initial value to 0.