-
Notifications
You must be signed in to change notification settings - Fork 140
Fix a runtime pm issue when HDMI codec doesn't work #2287
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
Fix a runtime pm issue when HDMI codec doesn't work #2287
Conversation
ff3069f to
d89bff4
Compare
plbossart
left a comment
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 think I understand the idea @RanderWang but I made a set of suggestions to better explain what you are trying to fix. I also don't know if @kv2019i will have a chance to review this.
kv2019i
left a comment
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.
Thanks @RanderWang ! This (plus the recent regression in 5.8-rc) that we need to get these configs under CI testing. To me the patchset looks good.. if you add the additional comments, this should be good.
lyakh
left a comment
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.
comments are not compulsory for this PR, just optional things to consider.
sound/soc/sof/intel/hda-codec.c
Outdated
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.
This isn't something introduced by this patch, but this code means, that in case of success this function returns 1, which isn't very common for a .probe() style function. I see that this function is only called from one location and there its return code is checked for < 0 but maybe it would be good to change this to return 0 on success.
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.
yes, I get your idea.
In snd_hdac_device_init pm_runtime_set_active is called to increase child_count in parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be invoked to clean up a HD-audio extended codec base device. At this time the child_count of parent is not decreased, which makes parent device can't get suspended. This patch calls pm_runtime_set_suspended to decrease child_count in parent device in snd_hdac_device_exit to match with snd_hdac_device_init. pm_runtime_set_suspended can make sure that it will not decrease child_count if the device is already suspended. Signed-off-by: Rander Wang <rander.wang@intel.com>
d89bff4 to
7ba9c02
Compare
When snd_hdac_device_init is failed, the codec is released by kfree immediately without releasing some resources. The vendor_name should be free if the memory is allocated and the runtime pm status should be restored, especially the runtime pm status of parent device. Signed-off-by: Rander Wang <rander.wang@intel.com>
7ba9c02 to
a459829
Compare
When hda_codec_probe() doesn't initialize audio component, we disable the codec and keep going. However,the resources are not released. The child_count of SOF device is increased in snd_hdac_ext_bus_device_init but is not decrease in error case, so SOF can't get suspended. snd_hdac_ext_bus_device_exit will be invoked in HDA framework if it gets a error. Now copy this behavior to release resources and decrease SOF device child_count to release SOF device. Signed-off-by: Rander Wang <rander.wang@intel.com>
|
update PR, thanks for review! |
|
btw, what's that CI "failure?" I don't see any on the "details" page |
I only found some tests are skip. @aiChaoSONG SKIP items will lead to CI failure ? SKIP | SKIP | SKIP | SKIP |
|
@lyakh @RanderWang BYT/BDW don't support 'runtime-pm' case, so it's skipped. |
fixes #2274