Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DF13C4338F for ; Mon, 26 Jul 2021 06:28:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D44C60F0F for ; Mon, 26 Jul 2021 06:28:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D44C60F0F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 87DAB1654; Mon, 26 Jul 2021 08:27:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 87DAB1654 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1627280882; bh=PAS2LjBUe0jKDoN9nAMCKv9Up98G8+PvsDNTe4CHdbA=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DeSqvKGp5fDmAp15SqTde8CJ5082Z44qNHlZvEgRBcunElSe4YLTnJ6hdfDfx0Aqd M4vV33e2J/o/GYdnz6tLHtX/i1bdZujGSvZeZ5Z0b5AUj1ibV15ydk6REK2V8FdQqT +UeHBtxXuR4d9kEx2Os8grzfapEffNuHhRul5Wls= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E2D1FF80253; Mon, 26 Jul 2021 08:27:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4F45BF8025A; Mon, 26 Jul 2021 08:27:10 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0D97FF8020D for ; Mon, 26 Jul 2021 08:26:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0D97FF8020D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="q3zc4a5I"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="sWzCS872" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 8B99B21EBD; Mon, 26 Jul 2021 06:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627280816; 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=xyfBg3AaAmMHSZe0f6vdtdgOLUmJHSbDdo1yRSLAHSM=; b=q3zc4a5IBcjTXEYmoIPDiAXMADv+iUjg5p4rqBUVxXUV01fGSSWVx7bjeiWJiR4iBEehZ/ ni26M2riJ7R9aUZUSLv1XM2RJDAqOTbUVYcL7SePaeirw7W5+Lo+AReiwDGZHRQWt+LXoj 1sCbEq5h/MzTV74Rgi4VentJ2kg8vys= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627280816; 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=xyfBg3AaAmMHSZe0f6vdtdgOLUmJHSbDdo1yRSLAHSM=; b=sWzCS8720T/yXR8eJOobdWeH1U/QN7qJFv3l6zzMtu9+nYjP26UtKVDlmnSB1FX7EJTnuZ trCdsFQddrAOlfAA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 7B222A3B89; Mon, 26 Jul 2021 06:26:56 +0000 (UTC) Date: Mon, 26 Jul 2021 08:26:56 +0200 Message-ID: From: Takashi Iwai To: Kai-Heng Feng Subject: Re: [PATCH] ALSA: usb-audio: Fix superfluous autosuspend recovery In-Reply-To: References: <20210725102309.19607-1-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: "moderated list:SOUND" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 26 Jul 2021 05:09:11 +0200, Kai-Heng Feng wrote: > > On Sun, Jul 25, 2021 at 6:23 PM Takashi Iwai wrote: > > > > The change to restore the autosuspend from the disabled state uses a > > wrong check: namely, it should have been the exact comparison of the > > quirk_type instead of the logical and (&&). Otherwise it matches > > wrongly with the other quirk types. > > > > Although re-enabling the autosuspend for the already enabled device > > shouldn't matter much, it's better to fix the unbalanced call. > > > > Fixes: 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()") > > Cc: > > Signed-off-by: Takashi Iwai > > --- > > sound/usb/card.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sound/usb/card.c b/sound/usb/card.c > > index 2f6a62416c05..a1f8c3a026f5 100644 > > --- a/sound/usb/card.c > > +++ b/sound/usb/card.c > > @@ -907,7 +907,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) > > } > > } > > > > - if (chip->quirk_type & QUIRK_SETUP_DISABLE_AUTOSUSPEND) > > It was bitwise and, not logical and... Gah, the commit message was just wrong. The revised one is below. thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH v2] ALSA: usb-audio: Fix superfluous autosuspend recovery The change to restore the autosuspend from the disabled state uses a wrong check: namely, it should have been the exact comparison of the quirk_type instead of the bitwise and (&). Otherwise it matches wrongly with the other quirk types. Although re-enabling the autosuspend for the already enabled device shouldn't matter much, it's better to fix the unbalanced call. Fixes: 9799110825db ("ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend()") Cc: Signed-off-by: Takashi Iwai --- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/card.c b/sound/usb/card.c index 2f6a62416c05..a1f8c3a026f5 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -907,7 +907,7 @@ static void usb_audio_disconnect(struct usb_interface *intf) } } - if (chip->quirk_type & QUIRK_SETUP_DISABLE_AUTOSUSPEND) + if (chip->quirk_type == QUIRK_SETUP_DISABLE_AUTOSUSPEND) usb_enable_autosuspend(interface_to_usbdev(intf)); chip->num_interfaces--; -- 2.26.2