]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: kirkwood: fix device remove ordering
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 23 Oct 2019 13:46:49 +0000 (14:46 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 23 Oct 2019 17:20:55 +0000 (18:20 +0100)
commit2528590f3930a20e60205dbe57ad78be11af28bb
tree240b6e0c2acada80ac7116f2b3c31b593838c04c
parent5e7fbdb3fd8d47cb31856050b1f901d232ce942b
ASoC: kirkwood: fix device remove ordering

The devm conversion of kirkwood was incorrect; on removal, devm takes
effect after the "remove" function has returned.  So, the effect of
the conversion was to change the order during remove from:

  - snd_soc_unregister_component() (unpublishes interfaces)
  - clk_disable_unprepare()
  - cleanup resources

After the conversion, this became:

  - clk_disable_unprepare() - while the device may still be active
  - snd_soc_unregister_component()
  - cleanup resources

Hence, it introduces a bug, where the internal clock for the device
may be shut down before the device itself has been shut down.  It is
known that Marvell SoCs, including Dove, locks up if registers for a
peripheral that has its clocks disabled are accessed.

Fixes: 35cf2008e663 ("ASoC: kirkwood: replace platform to component")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1iNGyP-0004oN-BA@rmk-PC.armlinux.org.uk
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/kirkwood/kirkwood-i2s.c