From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6269AC38145 for ; Wed, 7 Sep 2022 08:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbiIGIBW (ORCPT ); Wed, 7 Sep 2022 04:01:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbiIGIAt (ORCPT ); Wed, 7 Sep 2022 04:00:49 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22AE832ED4; Wed, 7 Sep 2022 01:00:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B8BB61F897; Wed, 7 Sep 2022 08:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662537646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MTS0xkpOCWUUwhJ2Fb/pObZ9XY5ZZUSzn2pLirlZ190=; b=L2usALx8nlG2n7FXPK6l8HHte8IfBqWbOU+7ruF+DFWa5w5WR7Gw7Zh9YCf4jxfUVLEdRx ss4YIQlCt78Fl4VQC/WBU1IQrzm2xArVLncGeYuZUTiv7CnFhJZ0rOGmy565N5PnYV3SGP Yd6z2pNzvoE4EvqsP4vHLDr8WcDWQZw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662537646; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MTS0xkpOCWUUwhJ2Fb/pObZ9XY5ZZUSzn2pLirlZ190=; b=mHn7DM52lTy5mR8njdQ2Muu5243mMdz5cfQimepAQG7RawghOa5f3FT1wPn4vu8hmR4YP+ 1P2830mzNLk0UyCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9290813A66; Wed, 7 Sep 2022 08:00:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tTLqIq5PGGO6CQAAMHmgww (envelope-from ); Wed, 07 Sep 2022 08:00:46 +0000 Date: Wed, 07 Sep 2022 10:00:46 +0200 Message-ID: <87czc7ehqp.wl-tiwai@suse.de> From: Takashi Iwai To: "Jason A. Donenfeld" Cc: alsa-devel@alsa-project.org, LKML , stable , =?ISO-8859-4?Q?Nikl=E0vs_Ko=B6es=F1ikovs?= <89q1r14hd@relay.firefox.com>, Wim Taymans Subject: Re: [PATCH] ALSA: usb-audio: Don't refcount multiple accesses on the single clock In-Reply-To: References: <20220905101403.1435037-1-Jason@zx2c4.com> <87sfl6jbb3.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 05 Sep 2022 14:16:39 +0200, Jason A. Donenfeld wrote: > > On Mon, Sep 5, 2022 at 1:44 PM Takashi Iwai wrote: > > When you load snd-usb-audio with dyndbg=+p option, does it show the > > new error message "Mismatched sample rate xxx"? > > No. What about the patch below? Takashi -- 8< -- --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -925,6 +925,8 @@ void snd_usb_endpoint_close(struct snd_usb_audio *chip, endpoint_set_interface(chip, ep, false); if (!--ep->opened) { + if (ep->clock_ref && !atomic_read(&ep->clock_ref->locked)) + ep->clock_ref->rate = 0; ep->iface = 0; ep->altsetting = 0; ep->cur_audiofmt = NULL;