mbox series

[0/3] soundwire: revisit peripheral driver bind/unbind

Message ID 20220621225641.221170-1-pierre-louis.bossart@linux.intel.com (mailing list archive)
Headers show
Series soundwire: revisit peripheral driver bind/unbind | expand

Message

Pierre-Louis Bossart June 21, 2022, 10:56 p.m. UTC
This patchset fixes the driver bind/unbind cases which are not
well-supported today. I initially reported a race condition in March
2022 [1] and the more tests I ran the more timing assumptions crept to
the surface.

With this patchset, I've been able to bind the drivers in any order,
and when all dependencies were available the card is
created/registered. Likewise I was able to remove codec drivers while
the bus was still running. The initial suggestion to use
device_lock()/unlock() led to system hangs in suspend-resume that I
was unable to root-cause after weeks of tests, hence this patchset
relies on a SoundWire-specific lock doesn't interfere with other core
device locking.

I think it's a pretty important set of changes that would ideally be
merged in this kernel cycle, so that we can finally add the inclusive
'manager/peripheral' language change in the next kernel cycle.

Feedback and comments welcome.

[1] https://lore.kernel.org/alsa-devel/d0559e97-c4a0-b817-428c-d3e305390270@linux.intel.com/

Pierre-Louis Bossart (3):
  soundwire: revisit driver bind/unbind and callbacks
  soundwire: peripheral: remove useless ops pointer
  soundwire: intel: use pm_runtime_resume() on component probe

 drivers/soundwire/bus.c       | 75 ++++++++++++++++++++---------------
 drivers/soundwire/bus_type.c  | 30 +++++++++++---
 drivers/soundwire/intel.c     | 18 +++++++++
 drivers/soundwire/slave.c     |  3 +-
 drivers/soundwire/stream.c    | 53 ++++++++++++++++---------
 include/linux/soundwire/sdw.h |  8 +---
 6 files changed, 124 insertions(+), 63 deletions(-)

Comments

Vinod Koul July 6, 2022, 5:11 a.m. UTC | #1
On 21-06-22, 17:56, Pierre-Louis Bossart wrote:
> This patchset fixes the driver bind/unbind cases which are not
> well-supported today. I initially reported a race condition in March
> 2022 [1] and the more tests I ran the more timing assumptions crept to
> the surface.
> 
> With this patchset, I've been able to bind the drivers in any order,
> and when all dependencies were available the card is
> created/registered. Likewise I was able to remove codec drivers while
> the bus was still running. The initial suggestion to use
> device_lock()/unlock() led to system hangs in suspend-resume that I
> was unable to root-cause after weeks of tests, hence this patchset
> relies on a SoundWire-specific lock doesn't interfere with other core
> device locking.

Applied, thanks for this cleanup.