Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp378243rwl; Fri, 4 Nov 2022 01:15:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM59zNLyc41AttAyaeiv9uHtYz53zt+VVifqU5JaUSHy0IwLK+A4vuW33GMWnShz6Mi8pbZH X-Received: by 2002:a17:907:3f13:b0:799:6aef:9837 with SMTP id hq19-20020a1709073f1300b007996aef9837mr33584977ejc.296.1667549713620; Fri, 04 Nov 2022 01:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667549713; cv=none; d=google.com; s=arc-20160816; b=pYcn4geD6Pe78EwRXMgOmtwx3Gr1e9/q5vcNDiORUQLG432Hc6cwG30KSFvOAIWdNr 560SV0U87jvofkNxoxFUbEAISheliRgRRtdXAFvC7tlg9Kei3D0bp+eLUmCyDOUrAQ8Q EFLB1efpirRrjqFpSBSywhd/LMooBDU72mzgRFNYfGAOApQ1pzraBNJGoq/M1PG56fmZ f7QeWuhqKWYa5uvGPuPun0goN9iNNbYEYQiyETXX8mSniVzydAVNJtQI4Jc4QGgruNB4 0uQz28mPw15p1FZApbsqlKl88So8uOYbpwxneXInIUnVfgnQecQG4eHE0CnCR3zvyt7e jTXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=LL81uK+aN/ZrKn6tbUNDzuG9HRl0DQASNkhSw6+aLmc=; b=gHDswn9IW9AMhxnmIOMNm38wv3XBC1wfdb95spkmzIpWTHxz3Rtjbh+ldWc011EYpV xwZ4ryD+Dc4yPw2+exJ1eiuDdKRru5D8wkVX8B6Yq94cbEA8Gt8kCd9IB0pDKJmeP8xy mOOTiHzQ+paoAsM6ys+X/xWG/kFNjBjvf0ykKdu1g+B9pTqe/N5oN9q9CZFPmv0521YC 8wWLs5P2Pb3BfdRPUEBAToQ1pJvaNWdRJmTsE6b6NJ9ZNCG74At+Z556opWkuUMEUsvO ja6eHqo4iL39678P/Mgzdyl/K/lu8zTDoBjlhhtrrKZlr37DkDhqZwOTbGG1D4jKI2Wc sLUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=BY2yVzAC; dkim=neutral (no key) header.i=@suse.de header.b=qLts6ezm; 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=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn22-20020a17090794d600b007827639faffsi4452100ejc.760.2022.11.04.01.14.49; Fri, 04 Nov 2022 01:15:13 -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=@suse.de header.s=susede2_rsa header.b=BY2yVzAC; dkim=neutral (no key) header.i=@suse.de header.b=qLts6ezm; 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=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbiKDHMS (ORCPT + 96 others); Fri, 4 Nov 2022 03:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbiKDHMP (ORCPT ); Fri, 4 Nov 2022 03:12:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDA45275ED for ; Fri, 4 Nov 2022 00:12:10 -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-out1.suse.de (Postfix) with ESMTPS id 74189218EC; Fri, 4 Nov 2022 07:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667545929; 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=LL81uK+aN/ZrKn6tbUNDzuG9HRl0DQASNkhSw6+aLmc=; b=BY2yVzACwB90mWdPCYz9d1X1ku3aW2bk2FO9Yu5vxQm6npnMNtZl1aYwbb46dxqr/FgZlY qe4rb+eRmnHQesf5UrL3l9qvYiug0UFfIBRMNIwJF5toSpNzXV64vnzE+kHQWu7g8quftc 5UiY/nexb4sebI8xITrB4AJA/b55EoE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667545929; 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=LL81uK+aN/ZrKn6tbUNDzuG9HRl0DQASNkhSw6+aLmc=; b=qLts6ezm1XNxQFDyHqVvR55kcHURKxjLzrqNpVRIWPX+eU9HMhpsCjEX8BY9VrA7qrs3HA oIsnsCVCxOJqU1Dg== 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 53FFC1346F; Fri, 4 Nov 2022 07:12:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EkfRE0m7ZGMwOgAAMHmgww (envelope-from ); Fri, 04 Nov 2022 07:12:09 +0000 Date: Fri, 04 Nov 2022 08:12:08 +0100 Message-ID: <874jvfkxbr.wl-tiwai@suse.de> From: Takashi Iwai To: aichao Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: usb-audio: fix usb camero disconnect issue In-Reply-To: <20221104013236.3480427-1-aichao@kylinos.cn> References: <20221104013236.3480427-1-aichao@kylinos.cn> 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Fri, 04 Nov 2022 02:32:36 +0100, aichao wrote: > > When current rate is different from the runtime rate, > snd_usb_endpoint stop and close endpoint to resetting rate. > if snd_usb_endpoint close the endpoint, sometimes usb will > disconnect the device. What do you mean...? snd_usb_endpoint_close() never disconnects the device by itself. Please elaborate the problem. Takashi > > Signed-off-by: aichao > --- > sound/usb/pcm.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c > index 5dc9266180e3..2ae4a55cbaa8 100644 > --- a/sound/usb/pcm.c > +++ b/sound/usb/pcm.c > @@ -517,7 +517,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, > if (snd_usb_endpoint_compatible(chip, subs->data_endpoint, > fmt, hw_params)) > goto unlock; > - close_endpoints(chip, subs); > } > > subs->data_endpoint = snd_usb_endpoint_open(chip, fmt, hw_params, false); > @@ -546,9 +545,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, > ret = configure_endpoints(chip, subs); > > unlock: > - if (ret < 0) > - close_endpoints(chip, subs); > - > snd_usb_unlock_shutdown(chip); > stop_pipeline: > if (ret < 0) > @@ -574,7 +570,6 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream) > if (!snd_usb_lock_shutdown(chip)) { > if (stop_endpoints(subs)) > sync_pending_stops(subs); > - close_endpoints(chip, subs); > snd_usb_unlock_shutdown(chip); > } > > -- > 2.25.1 >