From patchwork Thu Sep 7 17:10:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 721110 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 304E1EC8742 for ; Thu, 7 Sep 2023 17:13:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 46CDFE0D; Thu, 7 Sep 2023 19:12:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 46CDFE0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1694106785; bh=fBfsFcET+MCXlOleecv+XYcgSYKwelm2evWuMi6WZt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uSKQylyOBunwBI65lvbAk2d7hHBZQQPFqzvwiqMkvNvkGnyOg0LEDHlkDGxPzQTqn 1JS3fP+6bjcGnGFSKpCpOiDAwBfMO+aT6ncmZOyGNsHIML2tP9+jcWUn4K/wT8Lskf hAAGZTdob0um9oEoR37cIMz/f0nVrbHMoKQnBnqQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 513E9F805BD; Thu, 7 Sep 2023 19:10:42 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CC495F805BE; Thu, 7 Sep 2023 19:10:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B71F8F805AB; Thu, 7 Sep 2023 19:10:36 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8EF36F80588 for ; Thu, 7 Sep 2023 19:10:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8EF36F80588 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=ouYnSJqB Received: from localhost (unknown [81.18.92.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madras.collabora.co.uk (Postfix) with ESMTPSA id EB51266072EF; Thu, 7 Sep 2023 18:10:32 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694106633; bh=fBfsFcET+MCXlOleecv+XYcgSYKwelm2evWuMi6WZt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ouYnSJqBiL0WtmQqXcb+GIFgI1feIaQxestI0hqNbsnm43sm7CDBRsbUz9Azd+Esj BEzyO+Ecunp7TmN9ZuzL9oLnw04Ndjl5SWeBfnblfWoMi0+J0l/VMDTnJ/Ls0ZTzHa or/pma/AzJ5+5deXLcWJNcmwKD4tCbO0TAExV/jrOt4KrnvP2ZwDmY0oXtWeS0E3BD iZJbFL10PN94HLaqQqP/fiHGOR+MbbfGrvj8HItjrfwvK0R+Q7I/1fJjWWFgjHctIn hDnVhH21grdtoPyfdxkjYEYF2edTdVusj+VKTt61MbQbXSwy5KMhA/0QI1nAqiwUkK eUJzH4xn+/lBg== From: Cristian Ciocaltea To: James Schulman , David Rhodes , Richard Fitzgerald , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Stefan Binding , Charles Keepax , Vitaly Rodionov Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH v2 06/11] ASoC: cs35l41: Undo runtime PM changes at driver exit time Date: Thu, 7 Sep 2023 20:10:05 +0300 Message-ID: <20230907171010.1447274-7-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230907171010.1447274-1-cristian.ciocaltea@collabora.com> References: <20230907171010.1447274-1-cristian.ciocaltea@collabora.com> MIME-Version: 1.0 Message-ID-Hash: HWAFUMOPNF7TUXCEJ6W6COY656RQEZPZ X-Message-ID-Hash: HWAFUMOPNF7TUXCEJ6W6COY656RQEZPZ X-MailFrom: cristian.ciocaltea@collabora.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: According to the documentation, drivers are responsible for undoing at removal time all runtime PM changes done during probing. Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which are necessary for undoing pm_runtime_use_autosuspend(). Note this would have been handled implicitly by devm_pm_runtime_enable(), but there is a need to continue using pm_runtime_enable()/pm_runtime_disable() in order to ensure the runtime PM is disabled as soon as the remove() callback is entered. Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode") Signed-off-by: Cristian Ciocaltea --- sound/soc/codecs/cs35l41.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index a31cb9ba7f7d..5456e6bfa242 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -1334,6 +1334,7 @@ int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg * return 0; err_pm: + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); pm_runtime_put_noidle(cs35l41->dev); @@ -1350,6 +1351,7 @@ EXPORT_SYMBOL_GPL(cs35l41_probe); void cs35l41_remove(struct cs35l41_private *cs35l41) { pm_runtime_get_sync(cs35l41->dev); + pm_runtime_dont_use_autosuspend(cs35l41->dev); pm_runtime_disable(cs35l41->dev); regmap_write(cs35l41->regmap, CS35L41_IRQ1_MASK1, 0xFFFFFFFF);