-
Notifications
You must be signed in to change notification settings - Fork 140
Add new IPC for trace dma free #3197
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
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 |
|---|---|---|
|
|
@@ -539,6 +539,10 @@ EXPORT_SYMBOL(snd_sof_trace_notify_for_error); | |
|
|
||
| void snd_sof_release_trace(struct snd_sof_dev *sdev) | ||
| { | ||
| struct sof_ipc_fw_ready *ready = &sdev->fw_ready; | ||
| struct sof_ipc_fw_version *v = &ready->version; | ||
| struct sof_ipc_cmd_hdr hdr; | ||
| struct sof_ipc_reply ipc_reply; | ||
| int ret; | ||
|
|
||
| if (!sdev->dtrace_is_supported || !sdev->dtrace_is_enabled) | ||
|
|
@@ -549,6 +553,20 @@ void snd_sof_release_trace(struct snd_sof_dev *sdev) | |
| dev_err(sdev->dev, | ||
| "error: snd_sof_dma_trace_trigger: stop: %d\n", ret); | ||
|
|
||
| /* | ||
| * stop and free trace DMA in the DSP. TRACE_DMA_FREE is only supported from | ||
| * ABI 3.20.0 onwards | ||
| */ | ||
| if (v->abi_version >= SOF_ABI_VER(3, 20, 0)) { | ||
| hdr.size = sizeof(hdr); | ||
| hdr.cmd = SOF_IPC_GLB_TRACE_MSG | SOF_IPC_TRACE_DMA_FREE; | ||
|
|
||
| ret = sof_ipc_tx_message(sdev->ipc, hdr.cmd, &hdr, hdr.size, | ||
| &ipc_reply, sizeof(ipc_reply)); | ||
| if (ret < 0) | ||
| dev_err(sdev->dev, "DMA_TRACE_FREE failed with error: %d\n", ret); | ||
|
Member
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. return ret? or add a comment that on why we don't return? This can be done with a fixup PR.
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 think the intention is to continue to the host side release, even if the IPC fails, in this case this should be |
||
| } | ||
|
|
||
| ret = snd_sof_dma_trace_release(sdev); | ||
| if (ret < 0) | ||
| dev_err(sdev->dev, | ||
|
|
||
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.
nitpick: can you swap these?
or move them local under the
if(ABI)?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.
@ranj063 let's do this change suggested by @ujfalusi with a fixup