Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5495486rwb; Wed, 7 Sep 2022 03:55:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR4tcE/tF36NtuLsIKijTT+tUsC3HQEpfi4hV6kSs46WU7L03F0GkbF9WCY0dOsjVtr4Gthw X-Received: by 2002:a63:4714:0:b0:42b:82d9:b617 with SMTP id u20-20020a634714000000b0042b82d9b617mr2768549pga.223.1662548140332; Wed, 07 Sep 2022 03:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662548140; cv=none; d=google.com; s=arc-20160816; b=hRfSH5htb+tmUqHJ/vgQ7n31VvhN3+9t+kJKsoPXHhM3Xqz3Li/+h86bkSPN0odxs6 a7+xRrSTB3QgWnatvFtbU8Wy6J7SP8MA7nuVZzPH18foV10SBPF28HgWWk9+0cmd1+x8 hrN812pER6si/RVp1Caki1vPl5Nju9WkFGriasRirrii/v9BrtY9JgeWqPJaib5hVCX5 TaXGf/dkgWRWf6XBBguw8KVIH3kR+aBLaL7aardwOHemGC7iW3Rw+MfyCSmTBa51mgAc IZaTt/sNhegFw69141OMdk/HTLdt45St2jVl7lyjUFaAjhkXz3u+CsdJWFj/VjktXTJI 2cMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uvCPcOxnUC4wGn1S/Nv7nd9/+PzZUA4XVj1lOT3gFj8=; b=aL/pp4+Dt/WomRyxP3H8ENKqDnN/Bncmr8KZPUjx+csZgZfc0YjeJ8dX6SwPPlEa+s AqyHn64tDsy9tjqgsz6+TnepMS6424rqUlc1JZrNGnkZJaljhnyJJkJGcWh5YsaUClHi vN9RWGOuaPNJo0uCfiWX3+UCVqIMQaKS06txXbZhA4Ni1EFVEXODTOyeEjTPEdoNuPYZ aGNmf3K6b+ICW7m6nMmduzIYPR50NR87qn/3CtE/0RzzFpI+dBBXN41BDhvZvg0Hilzr r4qJytOLmZw8KvgsCjaYizisHLyBhtopxCwil83wIwLsXBxMY7D0GX+yDoNojX4Y7ICH 9IeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ZogZr9A8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056a000cc900b00536c7c210d3si14241064pfv.171.2022.09.07.03.55.28; Wed, 07 Sep 2022 03:55:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ZogZr9A8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbiIGJ3G (ORCPT + 99 others); Wed, 7 Sep 2022 05:29:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiIGJ3D (ORCPT ); Wed, 7 Sep 2022 05:29:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 468F6A3473; Wed, 7 Sep 2022 02:29:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E501DB81B8B; Wed, 7 Sep 2022 09:29:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2D9DC433C1; Wed, 7 Sep 2022 09:28:58 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ZogZr9A8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1662542937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uvCPcOxnUC4wGn1S/Nv7nd9/+PzZUA4XVj1lOT3gFj8=; b=ZogZr9A8RtJMjPkzMWOPgXLUIuyAp4smpWeF8UG8T7y3j5NvXCzINOJFhYJuekur2aQ1IV Yd2LUGDH40IXxwcgs4ooIw1jgOi+UjSbltY+FwG8OJdhqIGB0CTs4MtoPOdxjXJlEFiAMv Zzjbs78gDkMqWX7Ma8bS77RmYVILMN0= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 7e084ecb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 7 Sep 2022 09:28:57 +0000 (UTC) Date: Wed, 7 Sep 2022 11:28:54 +0200 From: "Jason A. Donenfeld" To: Takashi Iwai Cc: alsa-devel@alsa-project.org, LKML , stable , =?utf-8?B?TmlrbMSBdnMgS2/EvGVzxYZpa292cw==?= <89q1r14hd@relay.firefox.com>, Wim Taymans Subject: Re: [PATCH] ALSA: usb-audio: Don't refcount multiple accesses on the single clock Message-ID: References: <20220905101403.1435037-1-Jason@zx2c4.com> <87sfl6jbb3.wl-tiwai@suse.de> <87czc7ehqp.wl-tiwai@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87czc7ehqp.wl-tiwai@suse.de> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 07, 2022 at 10:00:46AM +0200, Takashi Iwai wrote: > 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; I think this works. Niklāvs - can you give it a try to and confirm? Jason