]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: wm_adsp: Correct control read size when parsing compressed buffer
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 10 Feb 2022 17:20:51 +0000 (17:20 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 10 Feb 2022 17:26:43 +0000 (17:26 +0000)
commit8832eb73580c20e696b85f2041bc1d8c2a7cda53
tree53697661347cdc98e66647467fb4b4f4ccfa0742
parentb17e61bde25097632b54717f10d1cc6a4b629e49
ASoC: wm_adsp: Correct control read size when parsing compressed buffer

When parsing the compressed stream the whole buffer descriptor is
now read in a single cs_dsp_coeff_read_ctrl; on older firmwares
this descriptor is just 4 bytes but on more modern firmwares it is
24 bytes. The current code reads the full 24 bytes regardless, this
was working but reading junk for the last 20 bytes. However commit
3f42f624fc8e ("firmware: cs_dsp: Add offset to cs_dsp read/write")
added a size check into cs_dsp_coeff_read_ctrl, causing the older
firmwares to now return an error.

Update the code to only read the amount of data appropriate for
the firmware loaded.

Fixes: f037b5620752 ("ASoC: wm_adsp: Switch to using wm_coeff_read_ctrl for compressed buffers")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220210172053.22782-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm_adsp.c