Repository navigation
Module remove: inform DSP that driver is going to be removed #2044
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 |
|---|---|---|
|
|
@@ -342,6 +342,14 @@ int snd_sof_device_remove(struct device *dev) | |
| { | ||
| struct snd_sof_dev *sdev = dev_get_drvdata(dev); | ||
| struct snd_sof_pdata *pdata = sdev->pdata; | ||
| int ret; | ||
|
|
||
| ret = snd_sof_dsp_power_down_notify(sdev); | ||
| if (ret < 0) { | ||
| dev_err(dev, "error: %d failed to prepare DSP for device removal", | ||
| ret); | ||
| return ret; | ||
| } | ||
|
|
||
|
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. @mrajwa Why not do this as part of remove sequence, e.g. in hda.c:hda_dsp_remove()? Not sure why the extra new method is needed and are the expected semantics. If it's called always before remove, what's the benefit? If some delay is needed between sram gating and power-off, this can be added in hda_dsp_remove() as well?
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. I also don't get why we need a new callback. If this is part of the power-down sequence, then let's add it as part of the power down sequence. this should apply to ALL D3 transitions.
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. +1 but @mrajwa this is meant to specifically fix the module reload problem on GLK isnt it? But we've still got the failure in the CI test?
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, at hda_dsp_remove() time you have IPCs already disabled + machine driver is removed - you won't be able to send IPC message to DSP anymore. Also, I think notifying DSP should be the very first thing to do.
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. @marjwa then we do need an ABI change if we're adding a new IPC?
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. @mrajwa snd_sof_free_trace() will first send a STOP IPC before freeing the dma pages for trace.
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 you want to keep it here, then the best place is to do this before snd_sof_remove() and after snd_sof_machine_unregister().
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. @mrajwa I also think we cannot do this in the core for the legacy platforms. Those platforms do no support runtime PM and we've never tested the CTX_SAVE IPC with them. So we need to be careful here. Take a look at the CI results. I think we should do this only for GLK+ in the remove op
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. @mrajwa any updates? This is a CI blocker
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. @ranj063, as for
First of all at the .remove stege for each platform (hda_dsp_remove) it is already too late to send any IPC. |
||
| if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) | ||
| cancel_work_sync(&sdev->probe_work); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.