Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 150
ASoC: SOF: discard sdev->waitq and sdev->code_loading#1189
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -59,13 +59,10 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context) | ||
| spin_lock_irq(&sdev->ipc_lock); | ||
| /* handle immediate reply from DSP core */ | ||
| hda_dsp_ipc_get_reply(sdev); | ||
| snd_sof_ipc_reply(sdev, msg); | ||
| if (sdev->code_loading) { | ||
| sdev->code_loading = 0; | ||
| wake_up(&sdev->waitq); | ||
| /* do not check reply if no message was initiated */ | ||
| if (sdev->msg) { | ||
| hda_dsp_ipc_get_reply(sdev); | ||
| snd_sof_ipc_reply(sdev, msg); | ||
| } | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| cnl_ipc_dsp_done(sdev); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -121,12 +121,6 @@ void hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev) | ||
| } | ||
| static bool hda_dsp_ipc_is_sof(uint32_t msg) | ||
| { | ||
| return (msg & (HDA_DSP_IPC_PURGE_FW | 0xf << 9)) != msg || | ||
| (msg & HDA_DSP_IPC_PURGE_FW) != HDA_DSP_IPC_PURGE_FW; | ||
| } | ||
| /* IPC handler thread */ | ||
| irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context) | ||
| { | ||
| @@ -172,18 +166,12 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context) | ||
| */ | ||
| spin_lock_irq(&sdev->ipc_lock); | ||
| /* handle immediate reply from DSP core - ignore ROM messages */ | ||
| if (hda_dsp_ipc_is_sof(msg)) { | ||
| /* do not check reply if no message was initiated */ | ||
| if (sdev->msg) { | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| hda_dsp_ipc_get_reply(sdev); | ||
| snd_sof_ipc_reply(sdev, msg); | ||
| } | ||
| /* wake up sleeper if we are loading code */ | ||
| if (sdev->code_loading) { | ||
| sdev->code_loading = 0; | ||
| wake_up(&sdev->waitq); | ||
| } | ||
| /* set the done bit */ | ||
| hda_dsp_ipc_dsp_done(sdev); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -167,9 +167,6 @@ static int cl_trigger(struct snd_sof_dev *sdev, | ||
| /* code loader is special case that reuses stream ops */ | ||
| switch (cmd) { | ||
| case SNDRV_PCM_TRIGGER_START: | ||
| wait_event_timeout(sdev->waitq, !sdev->code_loading, | ||
| HDA_DSP_CL_TRIGGER_TIMEOUT); | ||
plbossart marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. 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 we can also remove the define for that timeout now? 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. If this is correct, I'd be all for this - removing redundant synchronisation controls simplifies the code. But like others I cannot be completely certain that this is safe on all platforms. This assumes, that by the time we arrive here code_loading is already cleared and we don't wait anyway. So, can we add wait with this commit and add a here and run with that code for some time? After we've verified that that warning never triggers, we should be more confident, that it's safe to remove the wait queue. When removing it we still can keep the WARN().
| ||
| snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL, | ||
| 1 << hstream->index, | ||
| 1 << hstream->index); | ||
Uh oh!
There was an error while loading. Please reload this page.