]> asedeno.scripts.mit.edu Git - linux.git/commit
ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Wed, 14 Nov 2018 12:58:20 +0000 (14:58 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 14 Nov 2018 22:07:52 +0000 (14:07 -0800)
commit76836fd354922ebe4798a64fda01f8dc6a8b0984
tree8d71b1b2fe78ac512ca81247d74315b5f72cb987
parent933a95496e48bde40e366a79e6dd9f9740905573
ASoC: omap-abe-twl6040: Fix missing audio card caused by deferred probing

The machine driver fails to probe in next-20181113 with:

[    2.539093] omap-abe-twl6040 sound: ASoC: CODEC DAI twl6040-legacy not registered
[    2.546630] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -517
...
[    3.693206] omap-abe-twl6040 sound: ASoC: Both platform name/of_node are set for TWL6040
[    3.701446] omap-abe-twl6040 sound: ASoC: failed to init link TWL6040
[    3.708007] omap-abe-twl6040 sound: devm_snd_soc_register_card() failed: -22
[    3.715148] omap-abe-twl6040: probe of sound failed with error -22

Bisect pointed to a merge commit:
first bad commit: [0f688ab20a540aafa984c5dbd68a71debebf4d7f] Merge remote-tracking branch 'net-next/master'

and a diff between a working kernel does not reveal anything which would
explain the change in behavior.

Further investigation showed that on the second try of loading fails
because the dai_link->platform is no longer NULL and it might be pointing
to uninitialized memory.

The fix is to move the snd_soc_dai_link and snd_soc_card inside of the
abe_twl6040 struct, which is dynamically allocated every time the driver
probes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/omap/omap-abe-twl6040.c