mtl: introduce mtl_dsp_remove() to fix kmod removal issue#3679
mtl: introduce mtl_dsp_remove() to fix kmod removal issue#3679ranj063 merged 4 commits intothesofproject:topic/sof-devfrom
Conversation
79cdcc8 to
068c130
Compare
|
@ranj063 I pushed for adding mtl_dsp_remove() change. |
sound/soc/sof/intel/mtl.c
Outdated
|
|
||
| /* disable cores */ | ||
| if (chip) | ||
| mtl_dsp_core_power_down(sdev, chip->host_managed_cores_mask); |
There was a problem hiding this comment.
we could explicitly use primary core mask as we know thats the only one needed for MTL to be powered down
There was a problem hiding this comment.
Wondering if we really need to copy this code, just one function that differs. We could have a callback instead and use the default code, as we did for interrupts
There was a problem hiding this comment.
@plbossart i thought about that too but we already have core_set_state() and the core_get/core_put. Adding another ops for powering down cores would just add to confusion. Not sure, if it makes sense or not
There was a problem hiding this comment.
core_get/core_put is a bit different then what we would need here as those two is also sending IPC message to the firmware and cure_put is not implemented for non TGL.
Here we do not want to send IPC.
struct sof_intel_dsp_desc level power_down_host_managed_cores(struct snd_sof_dev *sdev) or an even more generic set_host_managed_cores_power(struct snd_sof_dev *sdev, bool power_up) might work and can be used to share more code, but I don't have objection for the duplicated code.
@ranj063, @bardliao, should we implement core_get/put for MTL? I think we have all the ingredients, no?
There was a problem hiding this comment.
core_get/core_put is a bit different then what we would need here as those two is also sending IPC message to the firmware and cure_put is not implemented for non TGL. Here we do not want to send IPC.
struct sof_intel_dsp_desclevelpower_down_host_managed_cores(struct snd_sof_dev *sdev)or an even more genericset_host_managed_cores_power(struct snd_sof_dev *sdev, bool power_up)might work and can be used to share more code, but I don't have objection for the duplicated code.@ranj063, @bardliao, should we implement core_get/put for MTL? I think we have all the ingredients, no?
Yes, we need core_get/put for MTL.
There was a problem hiding this comment.
@plbossart i thought about that too but we already have core_set_state() and the core_get/core_put. Adding another ops for powering down cores would just add to confusion. Not sure, if it makes sense or not
What's more confusing is the copy of all the initialization flow. That's not really maintainable IMHO, we should try to do something better where the flow remains the same except for one function.
068c130 to
9f74507
Compare
|
@fredoh9 please make sure the code compiles with W=1 and sparse, see reports |
|
@fredoh9 can you please update this PR with @plbossart 's suggestion? Maybe we need to add a core_put() op and call it from hda_dsp_remove() |
|
@fredoh9 do you mind completing this work before starting something new? It's not productive if we keep multiple PRs on the fire. |
I was thinking to finish core get/put from TGL first. Sure, will finish this work also. |
9f74507 to
c4e2554
Compare
|
This is not complete yet, but instead of sitting on it, I need to share the current code with the problem. I'm still based on Rander's SRC PR to test. I can play with SRC pipeline. When I do sof_remove, i have an ipc error, looking at it. |
|
@fredoh9 can we prioritize this, this is a bug with MTL and I'd like to send this fix upstream in this kernel cycle. we have only a couple of days left, thanks! |
c4e2554 to
2d4c8ba
Compare
|
@ranj063 @plbossart @bardliao @RanderWang |
DSP core power down sequences are different between cavs platforms and MTL. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
hda_power_down_dsp is set for power_down_dsp op for all HDA platforms. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2d4c8ba to
2cdf727
Compare
|
@plbossart @ranj063 @bardliao @RanderWang @yongzhi1 @RDharageswari
|
For MTL platform, dsp cores need to go power down first then dsp subsystem also need to set power down. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2cdf727 to
3268bcf
Compare
3268bcf to
c3c1ff2
Compare
Use power_down_dsp op to differentiate power down sequences in platforms. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
c3c1ff2 to
d344ded
Compare
|
@RanderWang @bardliao could you please take a look at this one? |
| @@ -186,6 +186,7 @@ struct sof_intel_dsp_desc { | |||
| enum sof_intel_hw_ip_version hw_ip_version; | |||
There was a problem hiding this comment.
Probably change the commit message to DSP core power down sequences are different between CAVS platforms and ACE platforms.
bardliao
left a comment
There was a problem hiding this comment.
Only one nitpick from me. We could say ACE platforms instead of MTL compare to CAVS platforms
fixes #3662