mbox series

[0/7] ALSA: Prep work for PCI rescan support

Message ID 20210518165201.24376-1-tiwai@suse.de
Headers show
Series ALSA: Prep work for PCI rescan support | expand

Message

Takashi Iwai May 18, 2021, 4:51 p.m. UTC
Hi,

this is a patch set as a prep work for the future-planned PCI rescan
support(*).  The essential part is the patch to track in-flight tasks,
and the rest are cleanups and fixes in the core code.  With those
changes, the driver can perform a sort of software suspend on the
device without the hardware intervention, which is required during the
PCI BAR movement, for example.


Takashi

(*) https://lore.kernel.org/alsa-devel/e25017c6-e5e4-7a24-e793-14a2e70a434e@amd.com/

===

Takashi Iwai (7):
  ALSA: core: Use READ_ONCE() / WRITE_ONCE() for power state change
  ALSA: control: Add power state check commonly for ioctl handlers
  ALSA: control: Drop superfluous snd_power_wait() calls
  ALSA: control: Minor optimization for SNDRV_CTL_IOCTL_POWER_STATE
  ALSA: control: Track in-flight control read/write/tlv accesses
  ALSA: pcm: Block the release until the system resume finishes
  ALSA: Drop superfluous argument from snd_power_wait()

 include/sound/core.h        | 39 +++++++++++++++++++++---
 sound/core/control.c        | 41 +++++++++++++-------------
 sound/core/control_compat.c | 17 +++++------
 sound/core/init.c           | 59 ++++++++++++++++++++++++++++++++-----
 sound/core/pcm_native.c     |  6 +++-
 sound/soc/soc-core.c        |  2 +-
 sound/usb/usx2y/us122l.c    |  2 +-
 7 files changed, 121 insertions(+), 45 deletions(-)

Comments

Takashi Iwai May 18, 2021, 6:54 p.m. UTC | #1
On Tue, 18 May 2021 20:01:33 +0200,
Jaroslav Kysela wrote:
> 
> Dne 18. 05. 21 v 18:51 Takashi Iwai napsal(a):
> 
> > +/**
> > + * snd_power_sync_ref - wait until the card power_ref is freed
> > + * @card: sound card object
> > + *
> > + * This function is used to synchronize with the pending power_ref being
> > + * released.
> > + */
> > +void snd_power_sync_ref(struct snd_card *card)
> > +{
> > +	wait_event(card->power_ref_sleep, !atomic_read(&card->power_ref));
> > +}
> > +EXPORT_SYMBOL_GPL(snd_power_sync_ref);
> 
> Perhaps, this function can be inline, too?

I thought of that, too.  Then maybe core.h needs more inclusion, but
it might be worth, yeah.


thanks,

Takashi