Repository navigation
IPC and keyword detection fixes #4869
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
75fae95
57d013a
35f05c3
c3e6d86
b2ef980
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 |
|---|---|---|
|
|
@@ -223,6 +223,18 @@ static int ipc_stream_pcm_params(uint32_t stream) | |
| return -EINVAL; | ||
| } | ||
|
|
||
| switch (pcm_dev->cd->pipeline->status) { | ||
| case COMP_STATE_ACTIVE: | ||
| case COMP_STATE_PRE_ACTIVE: | ||
| /* | ||
| * IPC4 has a use-case when a PCM parameter change request can | ||
| * be sent on an active pipeline, ignore it | ||
| */ | ||
| pipe_dbg(pcm_dev->cd->pipeline, | ||
| "ipc: ignore PCM param change request on an active pipeline"); | ||
| return 0; | ||
| } | ||
|
|
||
|
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. Commit not matching code. Commit says ignore, code says "-EINVAL".
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. true, let me fix
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. and -EINVAL is not a a success code either ;-) ipc: ipc3: return error on PCM_PARAMS request for active pipelines
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. but why should it be an error? can we not ignore the IPC and return succes?
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. we should also be a bit more verbose with the trace context, i.e. "ipc: pipe X is active but client requested PCM params change"
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. @lgirdwood could you please reply to @ranj063 's question, I'm not sure I asked for an explanation from you when you requested me to do this :-)
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. Sending PCM params during a running pipeline means the driver and FW are out of sync. Now that's an obvious eror, but IIUC an IPC4 use case, so we should return 0 and have a big comment about this in teh code.
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. @lgirdwood you want it back to returning zero?..
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. yes please, with a comment too :)
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. @lyakh ping - only this change is needed I think (and the commit message to align with return value). |
||
| #if CONFIG_HOST_PTABLE | ||
| cd = pcm_dev->cd; | ||
|
|
||
|
|
@@ -1524,9 +1536,11 @@ void ipc_cmd(ipc_cmd_hdr *_hdr) | |
| goto out; | ||
| } | ||
|
|
||
| if (!cpu_is_secondary(cpu_get_id())) | ||
| if (cpu_is_primary(cpu_get_id())) { | ||
| /* A new IPC from the host, delivered to the primary core */ | ||
| ipc->core = PLATFORM_PRIMARY_CORE_ID; | ||
| tr_info(&ipc_tr, "ipc: new cmd 0x%x", hdr->cmd); | ||
| } | ||
|
kv2019i marked this conversation as resolved.
Resolved
|
||
|
|
||
| ipc->delayed_response = false; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -166,7 +166,7 @@ int schedule_task_init_edf(struct task *task, const struct sof_uuid_entry *uid, | |
| goto error; | ||
|
|
||
| /* flush for secondary core */ | ||
| if (cpu_is_secondary(task->core)) | ||
| if (!cpu_is_primary(task->core)) | ||
|
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. Why this change @lyakh ? Isn't cpu_is_secondary() the easier to parse in this case?
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. @kv2019i sorry, I might not have the best taste for "simple" vs. "complex" :-) This is the only use of |
||
| dcache_writeback_invalidate_region(edf_pdata, | ||
| sizeof(*edf_pdata)); | ||
| return 0; | ||
|
|
||
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.
I get the commit message description of the problem, but I've having hard time how moving the cpu-is-me check form one place to another actually fixes the problem as describe in commit message. Can you somehow clarify how this is supposed to work?
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.
I can. Look at the
.delayed_responseflag below. As I describe in the commit message,ipc_complete_cmd()can be entered 3 times: first on the primary core, then on the secondary core from the IDC / IPC, then on the secondary core from the pipeline task. Before this patch the first call on the primary core would set.delayed_responsetofalse, so that the second call to this function would already find.delayed_responseset tofalseand send a response. Then the third call would again find it asfalseand send it again. After this patch the primary core won't setfalse, only the secondary core will.Uh oh!
There was an error while loading. Please reload this page.
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.
@lyakh it is true the function is entered 3 times but the delayed_response flag is actually set only on the core that the IPC gets executed on right? So what the primary core does is sort of immaterial right?
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.
ipcis a global object. So, can something like this happen??
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.
IDC is non-blocking isnt it? And timer IRQ can preempt the IPC task?
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 It depends on the
modeparameter. E.g. forSTREAM_TRIGGERit's non-blocking:falsemeans non-blocking