Skip to content

Commit f903128

Browse files
plbossartvinodkoul
authored andcommitted
soundWire: intel_auxdevice: resume 'sdw-master' on startup and system resume
The SoundWire bus is handled with a dedicated device, which is placed between the Intel auxiliary device and peripheral devices, e.g. soundwire_intel.link.0/sdw-master-0/sdw:0:025d:0711:01 The functionality of this 'sdw-master' device is limited, specifically for pm_runtime the ASoC framework will not rely on pm_runtime_get_sync() since it does not register any components. It will only change status thanks to the parent-child relationship which guarantees that the 'sdw-master' device will be pm_runtime resumed before any peripheral device. However on startup and system resume it's possible that only the auxiliary device is pm_runtime active, and the peripheral will only become active during its io_init routine, leading to another occurrence of the error reported by the pm_runtime framework: rt711 sdw:0:025d:0711:00: runtime PM trying to activate child device sdw:0:025d:0711:00 but parent (sdw-master-0) is not active This patch suggests aligning the sdw-master device status to that of the auxiliary device. The difference between the two is completely notional and their pm_status shouldn't be different during the startup and system resume steps. This problem was exposed by recent changes in the timing of the bus reset, but was present in this driver since we introduced pm_runtime support. Closes: thesofproject#4328 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230803065220.3823269-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 3d71f43 commit f903128

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/soundwire/intel_auxdevice.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ int intel_link_startup(struct auxiliary_device *auxdev)
257257

258258
pm_runtime_set_active(dev);
259259
pm_runtime_enable(dev);
260+
261+
pm_runtime_resume(bus->dev);
260262
}
261263

262264
/* start bus */
@@ -294,6 +296,7 @@ int intel_link_startup(struct auxiliary_device *auxdev)
294296
* definition of Master properties.
295297
*/
296298
if (!(link_flags & SDW_INTEL_MASTER_DISABLE_PM_RUNTIME_IDLE)) {
299+
pm_runtime_mark_last_busy(bus->dev);
297300
pm_runtime_mark_last_busy(dev);
298301
pm_runtime_idle(dev);
299302
}
@@ -557,6 +560,8 @@ static int __maybe_unused intel_resume(struct device *dev)
557560
pm_runtime_mark_last_busy(dev);
558561
pm_runtime_enable(dev);
559562

563+
pm_runtime_resume(bus->dev);
564+
560565
link_flags = md_flags >> (bus->link_id * 8);
561566

562567
if (!(link_flags & SDW_INTEL_MASTER_DISABLE_PM_RUNTIME_IDLE))
@@ -592,6 +597,7 @@ static int __maybe_unused intel_resume(struct device *dev)
592597
* counters and delay the pm_runtime suspend by several
593598
* seconds, by when all enumeration should be complete.
594599
*/
600+
pm_runtime_mark_last_busy(bus->dev);
595601
pm_runtime_mark_last_busy(dev);
596602

597603
return 0;

0 commit comments

Comments
 (0)