From patchwork Wed Dec 16 12:47:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 11977465 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 5C3D9C0018C for ; Wed, 16 Dec 2020 12:48:45 +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 0DB6D2339F for ; Wed, 16 Dec 2020 12:48:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DB6D2339F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@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 386BC17B3; Wed, 16 Dec 2020 13:47:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 386BC17B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608122920; bh=mIG8Fb4h6zepnfmZWkBRE8rYQ7FWiTM3upqhs8x6Ddk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vQNEgtRTzizpALdaLvZuomIQ/4lOq5W4Jv4oFFqhE0Tk0+KEoL+VA0l0U9Tsue8oh kGl7hJT8cvrxmy9+FXki59yQVGEJ4hsTEISCn1rzdEvlbntEBGG41GMiEor5OzL9m0 sOBUemJ5Jws168GxIGgUqBud7kuRTd69ibSJGp40= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B3767F80168; Wed, 16 Dec 2020 13:47:49 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09FD1F801F7; Wed, 16 Dec 2020 13:47:48 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 202CCF8011B for ; Wed, 16 Dec 2020 13:47:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 202CCF8011B Received: from 1.general.khfeng.us.vpn ([10.172.68.174] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kpWDN-0008Rc-4O; Wed, 16 Dec 2020 12:47:34 +0000 From: Kai-Heng Feng To: tiwai@suse.com Subject: [PATCH v2] ALSA: hda: Continue to probe when codec probe fails Date: Wed, 16 Dec 2020 20:47:24 +0800 Message-Id: <20201216124726.2842197-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214060621.1102931-1-kai.heng.feng@canonical.com> References: <20201214060621.1102931-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 Cc: "moderated list:SOUND" , Kai Vehmanen , open list , Pierre-Louis Bossart , Kai-Heng Feng , Alex Deucher , Mike Rapoport 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" Similar to commit 9479e75fca37 ("ALSA: hda: Keep the controller initialization even if no codecs found"), when codec probe fails, it doesn't enable runtime suspend, and can prevent graphics card from getting powered down: [ 4.280991] snd_hda_intel 0000:01:00.1: no codecs initialized $ cat /sys/bus/pci/devices/0000:01:00.1/power/runtime_status active So mark there's no codec and continue probing to let runtime PM to work. BugLink: https://bugs.launchpad.net/bugs/1907212 Signed-off-by: Kai-Heng Feng --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 6852668f1bcb..872a703dee43 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2328,7 +2328,7 @@ static int azx_probe_continue(struct azx *chip) if (bus->codec_mask) { err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]); if (err < 0) - goto out_free; + bus->codec_mask = 0; } #ifdef CONFIG_SND_HDA_PATCH_LOADER