From: Pierre-Louis Bossart Date: Wed, 15 Jan 2020 00:08:41 +0000 (-0600) Subject: soundwire: bus: disable pm_runtime in sdw_slave_delete X-Git-Tag: libata-5.7-2020-04-09~46^2~25^2~26 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=dff70572e9a3a1a01d9dbc2279faa784d95f41b6;p=linux-block.git soundwire: bus: disable pm_runtime in sdw_slave_delete Before removing the slave device, disable pm_runtime to prevent any race condition with the resume being executed after the bus and slave devices are removed. Since this pm_runtime_disable() is handled in common routines, implementations of Slave drivers do not need to call it in their .remove() routine. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200115000844.14695-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul --- diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 57dec61142e5..33bb273454cf 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -113,6 +113,8 @@ static int sdw_delete_slave(struct device *dev, void *data) struct sdw_slave *slave = dev_to_sdw_dev(dev); struct sdw_bus *bus = slave->bus; + pm_runtime_disable(dev); + sdw_slave_debugfs_exit(slave); mutex_lock(&bus->bus_lock);