From patchwork Fri Nov 4 01:32:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ai Chao X-Patchwork-Id: 15271 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp107345wru; Thu, 3 Nov 2022 18:48:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6AArGRKmaWKmMHN2BamUp33L8lRwPwoIC7xxuSR0rhpG56Op1r5tgduQps+7pLerXQAoGn X-Received: by 2002:a17:907:9804:b0:78e:676:f1a1 with SMTP id ji4-20020a170907980400b0078e0676f1a1mr31824514ejc.744.1667526508221; Thu, 03 Nov 2022 18:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667526508; cv=none; d=google.com; s=arc-20160816; b=LVYQGR4/Ox/JUsECG0agEa8L4l6b9y8RcPWj3i0qCrVV3qXstRdfz4wR9JowKsVeVF CLQ1U0WSIy3LvW/J4PqXBQ+jG62ilUBzO/SAX2SyMby95gS3g9z9kCid3W6cVtAdH6O3 DK7kN/FP0jefhYCS8qubePtFBoXTPB8wClq1BUrbUd/LVtAeJwfvXGIjhsooJshv/zGs rI50C/W0tYOl4cwSK7BrkMs0I6NO4Oc1jq76sH02uICWnvJUMCqKagULYlPLQJBx8GL5 Fsx2B0hdiMKiWSHebTmZ2kLS6F75vLGiLKZk+N8q+URtEt51lkD6BdArQz4ApA3S0b0b VDAg== 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 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.47.58; Thu, 03 Nov 2022 18:48:28 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748528275802594197?= X-GMAIL-MSGID: =?utf-8?q?1748528275802594197?= 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); }