Skip to content

Allow SoundWire devices to communicate during remove

Charles Keepax linux-sound lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 16 repliesSuperseded
  3. v12 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Added a comment in the code for the splitting of device_unregister()
- Fixed missing i++ in error path if devm_add_action_or_reset() fails during loop over links.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3soundwire: bus: Don't unassign dev_num before unregistering devicedrivers/soundwire/bus.c+13 -20 replies
2/3soundwire: bus: Expose a helper to remove devices from the busdrivers/soundwire/bus.c include/linux/soundwire/sdw.h+33 -120 replies
3/3soundwire: intel_auxdevice: Don't disable IRQs before removing childrendrivers/soundwire/intel.h drivers/soundwire/intel_auxdevice.c drivers/soundwire/intel_init.c +1 more+31 -10 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPierre-Louis Bossart
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] Allow SoundWire devices to communicate during remove

Currently on Intel systems SoundWire drivers can't communicate with the device during driver removal. This is primarily because the IRQs are disabled before the driver remove callback is run. The result of this is such transactions timeout causing a) a lot of errors in the log and b) driver remove to take a very long time.

This issue affects cs42l43 and cs42l45, primarily due to both using regmap IRQ.

soundwire_intel soundwire_intel.link.0: IO transfer timed out, cmd 3 device 6 addr 5d len 1 soundwire sdw-master-0-0: trf on Slave 6 failed:-110 write addr 5d count 0 sdca_class sdw:0:0:01fa:4245:01: Failed to sync masks in 5d

As regmap IRQ is torn down it will mask the interrupts that are removed. However, there are many valid reasons a driver might want communicate with the device during removal, others would include disabling jack detection, putting the device into the lowest possible power state to save power, etc.

This patch set attempts to address this problem trying to locate the reason interrupts are disabled, fixing that and then leaving the IRQs enabled for the remove callback.

Thanks,
Charles

Changes since v2:
- Added a comment in the code for the splitting of device_unregister()
- Fixed missing i++ in error path if devm_add_action_or_reset() fails during loop over links.

Changes since v1:
- Add a new helper to destroy the children on the bus separately, this allows the IRQs to be disabled for final cleanup.
- Split device_unregister into device_del and put_device.

Charles Keepax (3):
soundwire: bus: Don't unassign dev_num before unregistering device
soundwire: bus: Expose a helper to remove devices from the bus
soundwire: intel_auxdevice: Don't disable IRQs before removing
children

 drivers/soundwire/bus.c             | 55 ++++++++++++++++++++++-------
 drivers/soundwire/intel.h           |  1 +
 drivers/soundwire/intel_auxdevice.c |  7 +++-
 drivers/soundwire/intel_init.c      | 23 ++++++++++++
 include/linux/soundwire/sdw.h       |  1 +
 include/linux/soundwire/sdw_intel.h |  1 +
 6 files changed, 75 insertions(+), 13 deletions(-)
Signature · 1 line
2.47.3