]> git.itanic.dy.fi Git - linux-stable/commit
ALSA: usb-audio: Inform devices that need delayed registration
authorTakashi Iwai <tiwai@suse.de>
Wed, 25 Mar 2020 10:33:21 +0000 (11:33 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 26 Mar 2020 09:49:08 +0000 (10:49 +0100)
commita4aad5636c7298eecfb60fc9d73933336cb0c4d8
treecb0162fb546c31c825adc8fd0583209e65214dca
parentb70038ef4feae9c5c9d01de4cd799ae52ccafc08
ALSA: usb-audio: Inform devices that need delayed registration

The USB-audio driver may call snd_card_register() multiple times as
its probe function is per USB interface while some USB-audio devices
may provide multiple interfaces to assign different streams although
they belong to the same device.  This works in most cases but the
registration is racy, hence it may miss the device recognition,
e.g. PA doesn't see certain devices when hotplugged.

The recent addition of the delayed registration quirk allows to sync
the registration at the last known interface, and the previous commit
added a new module option to allow the dynamic setup for that
purpose.

Now, this patch tries to find out and notifies for such devices that
require the delayed registration.  It shows a message like:

  Found post-registration device assignment: 1234abcd:02

If you hit this message, you can pass delayed_register module option
like:

  snd_usb_audio.delayed_register=1234abcd:02

by just copying the last shown entry.  If this works, it can be added
statically in the quirk list, registration_quirks[] found at the end
of sound/usb/quirks.c.

Link: https://lore.kernel.org/r/20200325103322.2508-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c
sound/usb/stream.c
sound/usb/usbaudio.h