Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp362911rwl; Fri, 4 Nov 2022 01:01:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CUG8UN4seWSU8EhZZTQV+w+ZnABNN2R88NQ7pbENs3qrTHViZ/14MLu4Y/bEmBCv4Fh9w X-Received: by 2002:aa7:dd17:0:b0:463:a4a6:efc2 with SMTP id i23-20020aa7dd17000000b00463a4a6efc2mr19796285edv.393.1667548893728; Fri, 04 Nov 2022 01:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667548893; cv=none; d=google.com; s=arc-20160816; b=gs+a2n2YQSChhJxyOFzZixwZJY15+kdLjh+gVV3Lc1muLV3xeExfoNU1ggeTTy4Lbc pJMzIpgjQjBeMqr+Iu79IGQ325GtTPE98L38L7cay1iW34m1q2uTYWRypCKQ+swKA2// e4+9HkvNS+PghHWIeNy2OhEh9GJGpoG/1lK/M3+nIDAZl7xynLO7r3MrhMaemZqC9SQj AP1EAl20zOZTB2BUh5YDtJ5DNgQDcxlIEQedcbP0a/FDyZKmsv3V34oWMesCqh0arHcG aO5ttnLyp9CPqode6A06JxkIGg+G4+vrCwaiYFqW5ZOvxJP1ZMoB1KMzE5uQzYC2bPIG wTAQ== 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=qv7OkCdepLkYMkYQcNJufJIj9E8Dsr++msCszS/8lFQ=; b=fvfd9LzB/dgnDdlu9cA2q1uchxPsLDzfIN0y+NIog7Oc419kvi/COX4IATHSjmiLjY Mo/aDnJAxbH+UYE6UQl1WS4l/BLXtZSXztZYhJBKrsPlD+C4O38TKXiHrZCeouFgwUob 2RX4QhCt7J26c3bcGs5d5q2iVwRn388cKShJBkG0cbtHifGYSpUIoHO8XsUNrNk9VsTh VNDnb9oVeDLKIQZHeF6gvWbhVWKCEjHycTFGhDysKZEplrrfLclvcXZcdhyxJ2ekxTL2 rkECy2fAYKwgblZJCR9dLEOdnYjXAg1c8y+P4ekE5YGdqiqzGKbiSkh9kgdD+uiSq5+p oOFQ== 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 q6-20020a056402518600b00457f31c1a10si4898272edd.584.2022.11.04.01.01.09; Fri, 04 Nov 2022 01:01:33 -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 S230460AbiKDHfa (ORCPT + 96 others); Fri, 4 Nov 2022 03:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbiKDHf2 (ORCPT ); Fri, 4 Nov 2022 03:35:28 -0400 Received: from mailgw.kylinos.cn (unknown [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EC4165D2 for ; Fri, 4 Nov 2022 00:35:25 -0700 (PDT) X-UUID: 1f4c790098d84c258246e053a3af6d50-20221104 X-CPASD-INFO: ae1fd406ff49445a8bea0bddb1cba13d@qrVrhpFmXmaShnaFg3eAm1iTlZFgjoS zpGuDko9hX4SVhH5xTV5uYFV9fWtVYV9dYVR6eGxQYmBgZFJ4i3-XblBgXoZgUZB3sKdrhpRiYA== X-CLOUD-ID: ae1fd406ff49445a8bea0bddb1cba13d X-CPASD-SUMMARY: SIP:-1,APTIP:-2.0,KEY:0.0,FROMBLOCK:1,OB:0.0,URL:-5,TVAL:161. 0,ESV:0.0,ECOM:-5.0,ML:0.0,FD:0.0,CUTS:99.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:1,DUF:7502,ACD:131,DCD:131,SL:0,EISP:0,AG:0,CFC:0.278,CFSR:0.087,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: 1f4c790098d84c258246e053a3af6d50-20221104 X-CPASD-BLOCK: 1000 X-CPASD-STAGE: 1 X-UUID: 1f4c790098d84c258246e053a3af6d50-20221104 X-User: aichao@kylinos.cn Received: from localhost.localdomain [(112.64.161.44)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1062749013; Fri, 04 Nov 2022 15:35:29 +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 Hamedal C20 usb camero disconnect issue Date: Fri, 4 Nov 2022 15:35:18 +0800 Message-Id: <20221104073518.120807-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 For Hamedal C20, the 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/endpoint.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 533919a28856..c19e420b1780 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -825,7 +825,9 @@ void snd_usb_endpoint_close(struct snd_usb_audio *chip, usb_audio_dbg(chip, "Closing EP 0x%x (count %d)\n", ep->ep_num, ep->opened); - if (!--ep->iface_ref->opened) + if (!--ep->iface_ref->opened + && (le16_to_cpu(chip->dev->descriptor.idVendor) != 0x0525) + && (le16_to_cpu(chip->dev->descriptor.idProduct) != 0xa4ad)) endpoint_set_interface(chip, ep, false); if (!--ep->opened) { -- 2.25.1