mbox series

[0/4] ASoC/soundwire: fix race conditions on remove

Message ID 20240410023438.487017-1-yung-chuan.liao@linux.intel.com (mailing list archive)
Headers show
Series ASoC/soundwire: fix race conditions on remove | expand

Message

Bard Liao April 10, 2024, 2:34 a.m. UTC
There is a possible rate condition when removing the soundwire driver.
When the manager becomes pm_runtime active in the remove procedure,
peripherals will become attached, and do the initialization process.
We have to wait until all the devices are fully resumed before the
cleanup, otherwise there is a possible race condition where asynchronous
workqueues initiate transfers on the bus that cannot complete. This
patchset fixes the issue by ensuring all devices are fully resumed and
SoundWire interrupt is disabled after all jobs are done.
The change is mainly on SoundWire. It would be better to go through
SoundWire tree.

Bard Liao (3):
  soundwire: intel_auxdevice: use pm_runtime_resume() instead of
    pm_request_resume()
  soundwire: intel: export intel_resume_child_device
  soundwire: intel_init: resume all devices on exit.

Pierre-Louis Bossart (1):
  ASoC: SOF: Intel: hda: disable SoundWire interrupt later

 drivers/soundwire/intel_auxdevice.c | 10 +++++-----
 drivers/soundwire/intel_auxdevice.h |  1 +
 drivers/soundwire/intel_init.c      | 14 ++++++++++++++
 sound/soc/sof/intel/hda.c           |  4 ++--
 4 files changed, 22 insertions(+), 7 deletions(-)

Comments

Vinod Koul April 11, 2024, 5:48 p.m. UTC | #1
On Wed, 10 Apr 2024 02:34:34 +0000, Bard Liao wrote:
> There is a possible rate condition when removing the soundwire driver.
> When the manager becomes pm_runtime active in the remove procedure,
> peripherals will become attached, and do the initialization process.
> We have to wait until all the devices are fully resumed before the
> cleanup, otherwise there is a possible race condition where asynchronous
> workqueues initiate transfers on the bus that cannot complete. This
> patchset fixes the issue by ensuring all devices are fully resumed and
> SoundWire interrupt is disabled after all jobs are done.
> The change is mainly on SoundWire. It would be better to go through
> SoundWire tree.
> 
> [...]

Applied, thanks!

[1/4] ASoC: SOF: Intel: hda: disable SoundWire interrupt later
      commit: 62707b56b2b47dfdc94d4b079c9f9bfe5a923e33
[2/4] soundwire: intel_auxdevice: use pm_runtime_resume() instead of pm_request_resume()
      commit: 6f4867fa57604fc898a63ee73fe890786b9f4a72
[3/4] soundwire: intel: export intel_resume_child_device
      commit: f2fa6865566483582aed4511ef603b44239b227b
[4/4] soundwire: intel_init: resume all devices on exit.
      commit: 4cd5ea6de156850d555e1af8244a530812ae6ff6

Best regards,