From nobody Fri Dec 19 19:14:27 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AE74C433FE for ; Sat, 22 Oct 2022 08:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232655AbiJVIFi (ORCPT ); Sat, 22 Oct 2022 04:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232602AbiJVH7P (ORCPT ); Sat, 22 Oct 2022 03:59:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2365733865; Sat, 22 Oct 2022 00:49:34 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id BFE4C60B39; Sat, 22 Oct 2022 07:49:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEBF7C433C1; Sat, 22 Oct 2022 07:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424958; bh=ZFXv7aOzeRfU+Zq9neF3kSmBsWRostughYrYNDVdW2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V17xEvmmxkE/ZHgfr9/zFkGZgXM6hIG6npl65fOkqOKxHvhhq9irdUfyzXu24VgaU o1jrC2PXk6FpVeAAdW4BpKbiYtCaqZ8EeNGhEYeMYylMJFim2pvOANrmbwag1y+4Lb c+6EjxgauuLsGRw/Par/+94gBLCs545dFyD6cHUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Olivier Moysan , Mark Brown , Sasha Levin Subject: [PATCH 5.19 340/717] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe Date: Sat, 22 Oct 2022 09:23:39 +0200 Message-Id: <20221022072510.464360383@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Zhang Qilong [ Upstream commit b9a0da5b2edcae2a901b85c8cc42efc5bec4bd7b ] The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by moving pm_runtime_enable to the endding of stm32_adfsdm_probe. Fixes:98e500a12f934 ("ASoC: stm32: dfsdm: add pm_runtime support for audio") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142601.64266-2-zhangqilong3@huawei.= com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/stm/stm32_adfsdm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c index 6ee714542b84..c0f964891b58 100644 --- a/sound/soc/stm/stm32_adfsdm.c +++ b/sound/soc/stm/stm32_adfsdm.c @@ -334,8 +334,6 @@ static int stm32_adfsdm_probe(struct platform_device *p= dev) =20 dev_set_drvdata(&pdev->dev, priv); =20 - pm_runtime_enable(&pdev->dev); - ret =3D devm_snd_soc_register_component(&pdev->dev, &stm32_adfsdm_dai_component, &priv->dai_drv, 1); @@ -365,9 +363,13 @@ static int stm32_adfsdm_probe(struct platform_device *= pdev) #endif =20 ret =3D snd_soc_add_component(component, NULL, 0); - if (ret < 0) + if (ret < 0) { dev_err(&pdev->dev, "%s: Failed to register PCM platform\n", __func__); + return ret; + } + + pm_runtime_enable(&pdev->dev); =20 return ret; } --=20 2.35.1