From c11117b634f4f832c4420d3cf41c44227f140ce1 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 16 May 2022 12:48:07 +0200 Subject: ALSA: usb-audio: Refcount multiple accesses on the single clock When a clock source is connected to multiple nodes / endpoints, the current USB-audio driver tries to set up at each time one of them is configured. Although it reads the current rate and updates only if it differs, some devices seem unhappy with this behavior and spew the errors when reading/updating the rate unnecessarily. This patch tries to reduce the redundant clock setup by introducing a refcount for each clock source. When the stream is actually running, a clock rate is "locked", and it bypasses the clock and/or refuse to change any longer. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215934 Link: https://lore.kernel.org/r/20220516104807.16482-1-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/usb/card.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/usb/card.c') diff --git a/sound/usb/card.c b/sound/usb/card.c index 376962291c4d..0fff96a5d3ab 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -635,6 +635,7 @@ static int snd_usb_audio_create(struct usb_interface *intf, INIT_LIST_HEAD(&chip->pcm_list); INIT_LIST_HEAD(&chip->ep_list); INIT_LIST_HEAD(&chip->iface_ref_list); + INIT_LIST_HEAD(&chip->clock_ref_list); INIT_LIST_HEAD(&chip->midi_list); INIT_LIST_HEAD(&chip->mixer_list); -- cgit v1.2.3