-
Notifications
You must be signed in to change notification settings - Fork 133
ASoC: Intel: Prevent HDMI PCM creation if iDisp codec is not present #5412
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
ASoC: Intel: Prevent HDMI PCM creation if iDisp codec is not present #5412
Conversation
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 is very nice! This is also easy to add to other machine drivers if they need make HDMI optional. One question on the first two patches.
SOFCI TEST |
241c45e
to
21f022c
Compare
Changes since v1:
|
…links If a link has been ignored then it is not even added. The snd_soc_get_pcm_runtime() will return NULL as the runtime will does not exist. We can just skip this step to avoid performing a lookup to do nothing. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
snd_soc_remove_pcm_runtime() might be called with rtd == NULL which will leads to null pointer dereference. This was reproduced with topology loading and marking a link as ignore due to missing hardware component on the system. On module removal the soc_tplg_remove_link() would call snd_soc_remove_pcm_runtime() with rtd == NULL since the link was ignored, no runtime was created. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…MI PCMs If the system does not have iDisp codec then mark the HDMI PCM link as ignore. This ensures that HDMI PCMs will not be created when there is no iDisp codec available. When iDisp codec is not present and the HDMI PCMs were created they were not operational, all operations would fail on them. With this patch it is possible to load the topology with HDMI links, but gives the ability to ignore them and thus prevent the creation of the nonworking PCM devices. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
If the system does not have iDisp codec then mark the HDMI PCM link as ignore. This ensures that HDMI PCMs will not be created when there is no iDisp codec available. When iDisp codec is not present and the HDMI PCMs were created they were not operational, all operations would fail on them. With this patch it is possible to load the topology with HDMI links, but gives the ability to ignore them and thus prevent the creation of the nonworking PCM devices. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
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 @ujfalusi ! Looks good now and this is very welcome. I just hit this on one setup where there was a small error in UCM, and result was a flood of errors to kernel dmesg due to the dummy HDMI PCMs. It's much less confusing with this PR.
If the system does not have iDisp codec then mark the HDMI PCM link as
ignore.
This will 'hide' ensures that HDMI PCMs will be not created when there is
no iDisp codec available.
When iDisp codec is not present and the HDMI PCMs were created they were
not operational, all operations would fail on them.
With this patch it is possible to load the topology with HDMI links, but
gives the ability to ignore them and thus prevent the creation of the
nonworking PCM devices.
The first two patch (actually only one of them) is needed to prevent NULL pointer dereference on module removal since the runtime is not created and snd_soc_remove_pcm_runtime() do not have checks for rtd == NULL.