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 10B3AC4332F for ; Fri, 4 Nov 2022 08:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbiKDIG3 (ORCPT ); Fri, 4 Nov 2022 04:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiKDIG1 (ORCPT ); Fri, 4 Nov 2022 04:06:27 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 663CB2409D for ; Fri, 4 Nov 2022 01:06:26 -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-out2.suse.de (Postfix) with ESMTPS id 27D2E1F74A; Fri, 4 Nov 2022 08:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1667549185; 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=NAHPqz+JQ+byLy9st95AQKWD4OGH/5xZSKGvNLc2mPQ=; b=jobQ07YBlp8o1TuEKPf0S/jnKshiutGuIibFhTMYImlw9g4mrXsw3x7MLxfDrfygUP0PkQ Xv6Krg9wcP3UaolJ/fz6pVcKzFPIKPCJIH6LqFumTZY4XuAderPv7MQVDOXjt+/VIJbDYH dWrG7ZDjfNTUe9zRB/8Ck7PzFlqHyiA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1667549185; 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=NAHPqz+JQ+byLy9st95AQKWD4OGH/5xZSKGvNLc2mPQ=; b=U9PwoIxRiXolSQKXnwESJ2Sfsd9AwoTZhVWrIz9de56NkH1d+2204n2LFQcn1lz+rwutFH 43o0KkYa8jtNBIAw== 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 045DB13216; Fri, 4 Nov 2022 08:06:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ERJFAAHIZGMYUwAAMHmgww (envelope-from ); Fri, 04 Nov 2022 08:06:25 +0000 Date: Fri, 04 Nov 2022 09:06:24 +0100 Message-ID: <871qqjkutb.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 Hamedal C20 usb camero disconnect issue In-Reply-To: <20221104073518.120807-1-aichao@kylinos.cn> References: <20221104073518.120807-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 08:35:18 +0100, aichao wrote: > > 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 OK, this is more understandable than the previous one. But it doesn't look like a proper workaround, and we need to figure out the culprit more deeply. The interface is anyway reset once when the parameter is changed / re-setup. Doesn't it hit the same problem? Or it's about clearing the interface and keep it for long time? In anyway, please give lsusb -v output of the device. BTW, is aichao your full name? The sign-off must be with the real full name, and it's a legal requirement. thanks, Takashi > --- > 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 >