soundwire: intel: fix race condition on system resume
Previous patches took care of the case where the master device is pm_runtime 'suspended' when a system suspend occurs. In the case where the master device was not suspended, e.g. if suspend occurred while streaming audio, Intel validation noticed a race condition: the pm_runtime suspend may conflict with the enumeration started by the system resume. This can be simply fixed by updating the status before exiting system resume. GitHub issue: https://github.com/thesofproject/linux/issues/1482 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20200817152923.3259-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
b61b8b3788
commit
cb1e6d59e8
@ -1528,6 +1528,18 @@ static int intel_resume(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* after system resume, the pm_runtime suspend() may kick in
|
||||
* during the enumeration, before any children device force the
|
||||
* master device to remain active. Using pm_runtime_get()
|
||||
* routines is not really possible, since it'd prevent the
|
||||
* master from suspending.
|
||||
* A reasonable compromise is to update the pm_runtime
|
||||
* counters and delay the pm_runtime suspend by several
|
||||
* seconds, by when all enumeration should be complete.
|
||||
*/
|
||||
pm_runtime_mark_last_busy(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user