Repository navigation
ASoC: Intel: fix sof_es8336 probe - #3798
Conversation
Changes to add HDMI capture support broke the machine driver probe for all other platforms. The commit listed in the Fixes tag added a board_id descriptor but didn't add the default name for the sof_essx8336 machine driver. Add the missing entry and remove the now-useless platform driver alias. Reported-by: Eugene J. Markow <ejmarkow@yahoo.com> BugLink: thesofproject#3336 Fixes: 86b1959 ("ASoC: Intel: sof_es8336: add support for HDMI_In capture") Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Some Intel-based platforms rely on a topology file that hard-codes the use of MCLK0. This is incorrect in 10% of the cases. Rather than generating yet another set of topology files, this patch adds a kernel module parameter to override the topology value. In hindsight, we should never have allowed mclks to be specified in topology, this is a hardware-level information that should not have been visible in the topology. Future patches will try to set this value automagically, e.g. by parsing the NHLT content. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
SOF topologies hard-code the MCLK used for SSP connections. That was a bad idea in hindsight, this information should really come from BIOS and/or machine driver. This patch introduces a helper to scan all SSP endpoints connected to a codec, and all formats to see what MCLK is used. When BIT(0) of the mdivc offset if set in the SSP blob, MCLK0 is used, and likewise when BIT(1) is set MCLK1 is used. The case where both MCLKs are used is possible but has never been seen in practice so should be treated as an error by the caller. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The NHLT is already used to determine which SSP is connected to an audio codec, we can parse the SSP blob to get the mclk_id from NHLT. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
537c5db to
013290a
Compare
|
@juimonen and @crojewsk-intel can you please take a look at the sound/hda/intel-nhlt.c changes. I think I have the blob formats right based on the alsa-utils header but it's Friday and my brain is fried. |
kv2019i
left a comment
There was a problem hiding this comment.
Looks good. I do wonder a bit should one level of sanitization be done to the binary parsing in second-to-last patch. If this is already done in elsewhere in NHLT code, then ok...
| epnt->device_type == NHLT_DEVICE_I2S && | ||
| epnt->virtual_bus_id == ssp_num) { | ||
|
|
||
| fmt = (struct nhlt_fmt *)(epnt->config.caps + epnt->config.size); |
There was a problem hiding this comment.
Hmm, should there be some input validation that this does end up reading past the allocated struct?
There was a problem hiding this comment.
The code I took was copy/pasted/modified from the existing NHLT helpers. It's quite true that nothing checks that the size isn't corrupted. The NHLT can be overridden as I understand it, so clearly there are means to create an out-of-bounds access.
| cfg = (struct nhlt_fmt_cfg *)(cfg->config.caps + cfg->config.size); | ||
| } | ||
| } | ||
| epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length); |
|
Results are good, see #3336 (comment) |
Changes to add HDMI capture support broke the machine driver probe for
all other platforms. The commit listed in the Fixes tag added a
board_id descriptor but didn't add the default name for the
sof_essx8336 machine driver.
Add the missing entry and remove the now-useless platform driver
alias.
Reported-by: Eugene J. Markow ejmarkow@yahoo.com
BugLink: #3336
Fixes: 86b1959 ("ASoC: Intel: sof_es8336: add support for HDMI_In capture")
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com