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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 91123C433DB for ; Thu, 4 Mar 2021 08:11:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 516E964F09 for ; Thu, 4 Mar 2021 08:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236173AbhCDILJ (ORCPT ); Thu, 4 Mar 2021 03:11:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:56644 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233819AbhCDILD (ORCPT ); Thu, 4 Mar 2021 03:11:03 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9861EAC1F; Thu, 4 Mar 2021 08:10:22 +0000 (UTC) Date: Thu, 04 Mar 2021 09:10:22 +0100 Message-ID: From: Takashi Iwai To: Kai-Heng Feng Cc: tiwai@suse.com, "moderated list:SOUND" , Olivia Mackintosh , Dylan Robinson , Greg Kroah-Hartman , Chris Wulff , "Gustavo A. R. Silva" , Joakim Tjernlund , Alexander Tsoy , Mark Brown , Joe Perches , Dmitry Panchenko , open list Subject: Re: [PATCH] ALSA: usb-audio: Disable USB autosuspend properly in setup_disable_autosuspend() In-Reply-To: <20210304043419.287191-1-kai.heng.feng@canonical.com> References: <20210304043419.287191-1-kai.heng.feng@canonical.com> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 04 Mar 2021 05:34:16 +0100, Kai-Heng Feng wrote: > > Rear audio on Lenovo ThinkStation P620 stops working after commit > 1965c4364bdd ("ALSA: usb-audio: Disable autosuspend for Lenovo > ThinkStation P620"): > [ 6.013526] usbcore: registered new interface driver snd-usb-audio > [ 6.023064] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1 > [ 6.023083] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4 > [ 6.023090] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1 > [ 6.023098] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4 > [ 6.023103] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1 > [ 6.023110] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4 > [ 6.045846] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1 > [ 6.045866] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4 > [ 6.045877] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1 > [ 6.045886] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4 > [ 6.045894] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x100, wIndex = 0x0, type = 1 > [ 6.045908] usb 3-6: cannot get ctl value: req = 0x81, wValue = 0x202, wIndex = 0x0, type = 4 > > I overlooked the issue because when I was working on the said commit, > only the front audio is tested. Apology for that. > > Changing supports_autosuspend in driver is too late for disabling > autosuspend, because it was already used by USB probe routine, so it can > break the balance on the following code that depends on > supports_autosuspend. > > Fix it by using usb_disable_autosuspend() helper, and balance the > suspend count in disconnect callback. > > Fixes: 1965c4364bdd ("ALSA: usb-audio: Disable autosuspend for Lenovo ThinkStation P620") > Signed-off-by: Kai-Heng Feng Thanks, applied. Takashi