ASoC: Intel: Prevent HDMI PCM creation if iDisp codec is not present#5412
Merged
ranj063 merged 4 commits intothesofproject:topic/sof-devfrom Jun 3, 2025
Merged
Conversation
kv2019i
reviewed
May 12, 2025
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
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.
Collaborator
|
SOFCI TEST |
241c45e to
21f022c
Compare
Collaborator
Author
|
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>
bardliao
approved these changes
May 21, 2025
ranj063
approved these changes
May 21, 2025
lgirdwood
approved these changes
May 26, 2025
kv2019i
approved these changes
Jun 3, 2025
Collaborator
kv2019i
left a comment
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.