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 CF917C4332F for ; Fri, 4 Nov 2022 07:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbiKDHMS (ORCPT ); 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 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 >