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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3FE1CC433EF for ; Tue, 28 Jun 2022 02:26:32 +0000 (UTC) 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 96A261655; Tue, 28 Jun 2022 04:25:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 96A261655 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1656383190; bh=Wyrba2jp9RYyqTbWeyTfGn/Km9akoyQYnL+3WQwTOWk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Xn7dViQU8Fyz4cNlwPmF2nWAvuwrTord3GhHhWa+Krhd23Q0OuTnvg672pO0g9nL9 HWID9f/CVPkWnn1KiRZDrPuduwTKLyxRUteuH7zOUBVKwQGf5gmesX2Q/SvlBEswvB pBwVh5Nim1PRULYlL2IysBChhJbOAwqE9w6MW//E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 43323F8028B; Tue, 28 Jun 2022 04:25:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B4BDF8028B; Tue, 28 Jun 2022 04:25:39 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 929BCF8052E for ; Tue, 28 Jun 2022 04:25:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 929BCF8052E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H+UWCz1Y" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EB951B81C14; Tue, 28 Jun 2022 02:25:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC1AAC385A5; Tue, 28 Jun 2022 02:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656383132; bh=Wyrba2jp9RYyqTbWeyTfGn/Km9akoyQYnL+3WQwTOWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H+UWCz1Y7Df3Ibqf4DSdVS4mSPva+9zWp+sC/ZbnQ6IvLgnvo8RSjbkFNLZLsFLlH BXSmIWsnd4vEeUTvdJwFJyVgiw+1Q5LX9Nddgr/uZpbxLo9RxkcvWBJylbektQ+0ki wD9a1vX7FOO2463GpECgnodez+orn5cfFe5mGChenxVczJX/byjyIE4vLkUSYMSQtH APRbbjmxAAnyFwV/BymkzthWD8B26vlf1mP02LCFdYRXSyz7gxPemYA74BQ646bKQK RC/QEmcLy9SZLhrCzk48tIvQNIbvUWej0XfsDGTwp7OnctI9aSk02fmKJ+oKGS/v6C ugunQB+woNzcA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 06/22] ALSA: x86: intel_hdmi_audio: enable pm_runtime and set autosuspend delay Date: Mon, 27 Jun 2022 22:25:01 -0400 Message-Id: <20220628022518.596687-6-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628022518.596687-1-sashal@kernel.org> References: <20220628022518.596687-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, jiasheng@iscas.ac.cn, Kai Vehmanen , Takashi Iwai , tiwai@suse.com, Pierre-Louis Bossart , Ranjani Sridharan , nizhen@uniontech.com, Bard Liao , gushengxian@yulong.com 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" From: Pierre-Louis Bossart [ Upstream commit e87c65aeb46ca4f5b7dc08531200bcb8a426c62e ] The existing code uses pm_runtime_get_sync/put_autosuspend, but pm_runtime was not explicitly enabled. The autosuspend delay was not set either, the value is set to 5s since HDMI is rather painful to resume. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220616222910.136854-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/x86/intel_hdmi_audio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 3841336dc9cd..0c39ab628267 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -42,6 +42,8 @@ #include #include "intel_hdmi_audio.h" +#define INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS 5000 + #define for_each_pipe(card_ctx, pipe) \ for ((pipe) = 0; (pipe) < (card_ctx)->num_pipes; (pipe)++) #define for_each_port(card_ctx, port) \ @@ -1898,8 +1900,11 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) pdata->notify_audio_lpe = notify_audio_lpe; spin_unlock_irq(&pdata->lpe_audio_slock); + pm_runtime_set_autosuspend_delay(&pdev->dev, INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS); pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_idle(&pdev->dev); dev_dbg(&pdev->dev, "%s: handle pending notification\n", __func__); for_each_port(card_ctx, port) { -- 2.35.1