]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Intel: bdw-rt5677: fix module load/unload issues
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 22 Jun 2020 15:42:38 +0000 (10:42 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 23 Jun 2020 11:25:38 +0000 (12:25 +0100)
commitd327c9070ae602f7ac153a0839535d8dd9d20ccb
tree230b01df5f96118dfe43a9c1f55e293ceca53c37
parentf24dd7c1b50542b8baaf059f29d33ac9cc719b54
ASoC: Intel: bdw-rt5677: fix module load/unload issues

The mainline code currently prevents modules from being removed.

The BE dailink .init() function calls devm_gpiod_get() using the codec
component device as argument. When the machine driver is removed, the
references to the gpiod are not released, and it's not possible to
remove the codec driver module - which is the only entity which could
free the gpiod.

This conceptual deadlock can be avoided by invoking gpiod_get() in the
.init() callback, and calling gpiod_put() in the exit() callback.

Tested on SAMUS Chromebook with SOF driver.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bdw-rt5677.c