Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp6893rwl; Thu, 3 Nov 2022 18:50:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7P2OS/XUh3blNrk5EmP+DvNaaXgSYX1ViNyE0Upktosfap4c8kTyEIb2GIstibYOPnSjs9 X-Received: by 2002:a17:906:c353:b0:7ad:9f03:aa46 with SMTP id ci19-20020a170906c35300b007ad9f03aa46mr228466ejb.175.1667526607010; Thu, 03 Nov 2022 18:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667526607; cv=none; d=google.com; s=arc-20160816; b=LG2sIsoYiW67f44Sad3rbSJhV3XUljqQGutZ3ggjSrtIVuY/Q0meQHa6WAuPZc7wEC SwwUARrWepwed+kVzTEaouUAn0g6FfOFwngHqK9yjzStjTmlsYdFoangEfI6JnTnWMNe e+Gn8ha+Iy13bfdpV0l6yAdiaTZzGCRnLI6MwTBzo9m7YXyfAGqtVDJib5y5Unfix4uI L0+o4KhjspwumD77CpGx6FqUTXGyWJCm8AwY1ZmS2JRantIlVdx12eI8g+bT8hSxVfEz 9QM0dPrV6zvs5gqleRYW0M7frlejFnY9digXpyecyD2R9gP2hcx2B6MgUCw/P0h82+jV eShg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=bfyREDdihKbCsac3/aa2H7hI5XDgiP3p3dTwyiAwZOY=; b=AcRBw3wP7hNs8XBh4Fr+mHGwy0VhMPzqTzUKkR+wVuGXG6VmZNETaaCBfPSMPLbw7j YdfKQomEXTbCHke1cYOPPpQ5p81yKShcnzHi3PBNtkUYCphm0wM46xomg5zhCEIVCooW 5OwvU8PgKal08BFwsm5ULAy20O3ORNXaSeP0DR3loj1hFDKc6to+4Hxlo5Y1+uSllDTD 8nmVmBidZIRL9FDCtLv+ovBHAWUAxyUu1gzXOIDOo0lPiQfN0DJyeEypf7bif78BLpIq B6GrVEW4/v9QveLIvY+Al3FKp801psT88/C+vS3DBHmvO8JTsLZSe6zVFP7eoDW+ZZcs I5Qw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh36-20020a1709076ea400b0077f3a9c58e2si3131566ejc.6.2022.11.03.18.49.43; Thu, 03 Nov 2022 18:50:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbiKDBc7 (ORCPT + 97 others); Thu, 3 Nov 2022 21:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiKDBc5 (ORCPT ); Thu, 3 Nov 2022 21:32:57 -0400 Received: from mailgw.kylinos.cn (unknown [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443501CB0F for ; Thu, 3 Nov 2022 18:32:54 -0700 (PDT) X-UUID: a83640dbf08d42068760d5fb3362947b-20221104 X-CPASD-INFO: c880302e3dc24631910fba284e6cba80@rIhyUGBiYJVfhKV-g3l-a1liYJaSjVK Hdp9Wk5CRZFCVhH5xTV5uYFV9fWtVYV9dYVR6eGxQYmBgZFJ4i3-XblBgXoZgUZB3snpyUGNeYg== X-CLOUD-ID: c880302e3dc24631910fba284e6cba80 X-CPASD-SUMMARY: SIP:-1,APTIP:-2.0,KEY:0.0,FROMBLOCK:1,OB:0.0,URL:-5,TVAL:172. 0,ESV:0.0,ECOM:-5.0,ML:0.0,FD:0.0,CUTS:148.0,IP:-2.0,MAL:-5.0,PHF:-5.0,PHC:-5 .0,SPF:4.0,EDMS:-5,IPLABEL:4480.0,FROMTO:0,AD:0,FFOB:0.0,CFOB:0.0,SPC:0,SIG:- 5,AUF:0,DUF:7445,ACD:130,DCD:130,SL:0,EISP:0,AG:0,CFC:0.221,CFSR:0.16,UAT:0,R AF:0,IMG:-5.0,DFA:0,DTA:0,IBL:-2.0,ADI:-5,SBL:0,REDM:0,REIP:0,ESB:0,ATTNUM:0, EAF:0,CID:-5.0,VERSION:2.3.17 X-CPASD-ID: a83640dbf08d42068760d5fb3362947b-20221104 X-CPASD-BLOCK: 1000 X-CPASD-STAGE: 1 X-UUID: a83640dbf08d42068760d5fb3362947b-20221104 X-User: aichao@kylinos.cn Received: from localhost.localdomain [(112.64.161.44)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 781106644; Fri, 04 Nov 2022 09:32:50 +0800 From: aichao To: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, aichao Subject: [PATCH] ALSA: usb-audio: fix usb camero disconnect issue Date: Fri, 4 Nov 2022 09:32:36 +0800 Message-Id: <20221104013236.3480427-1-aichao@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,T_SPF_PERMERROR, UNPARSEABLE_RELAY autolearn=no 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 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. 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