[v3,15/22] soundwire: intel: disable pm_runtime when removing a master
diff mbox series

Message ID 20191114181702.22254-16-pierre-louis.bossart@linux.intel.com
State New
Headers show
Series
  • soundwire: code hardening and suspend-resume support
Related show

Commit Message

Pierre-Louis Bossart Nov. 14, 2019, 6:16 p.m. UTC
Prevent race conditions between remove and resume by disabling
pm_runtime.

Note that this only takes care of pm_runtime at the Master level, the
same precautions are needed when removing a Slave device.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 drivers/soundwire/intel.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 69b0c8f65ad8..460e2d8cf80d 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -1275,6 +1275,8 @@  static int intel_master_remove(struct sdw_master_device *md)
 {
 	struct sdw_intel *sdw;
 
+	pm_runtime_disable(&md->dev);
+
 	sdw = md->pdata;
 
 	if (!sdw->cdns.bus.prop.hw_disabled) {