Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp823403rwi; Wed, 19 Oct 2022 03:30:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4u5/UAoGGCaiodgzEDJGgi0jGB66OUFU65s3SWk2BapLLyFSnOwuLZ/7ozqUuBu5pvVV6w X-Received: by 2002:a05:6402:5485:b0:459:147a:d902 with SMTP id fg5-20020a056402548500b00459147ad902mr6979564edb.263.1666175430859; Wed, 19 Oct 2022 03:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175430; cv=none; d=google.com; s=arc-20160816; b=bcF5uD4YuEJeTY2tr0j2QOMSl96Fl7IsyYdhDP7kitPOMInQdiZlSVbT1re+PgpbhJ h2eFutUcIKyzeySdJw2IH/dDeB6usZtNzAfL1t5XBLgWcYmVO2Es43do+Q1cPIbIPv0x j+PW30+EXJiKaSh8UOXHw2uvl5km3QNJZAR8O4LkYFAcEhWax8mvneD5VVH300vIJjR6 oCfQREVW2/1mBG82WsYbj2TJPgrukfGu3JcIeMa/xKP3cF+7FBMHzcj7lxfH21HQSY4T Je0mu7JoDiNj+b1t+CgnfPRjkqkcxZGMn6lY6w7R+AAWlPzLvwPZquyMhKaEp8G8slam K1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TsxYWpYrcpl7P6t3WX6++nUH623cHdMDnHdO2bFlZxs=; b=vo5qHeTDmJTISAYRVOm+/rKa8zbiJ/4JJqQot4pY5GxF8Ht8acc6wvZlcoTNrUG39U XC2nXM2KGNc6OeJkHaumE84lCLELhUyeRKEIciNqadJDN4qHhyJfxjNhk0cvPP904NZe 6JVmileB9BYItytvs/RfJdebBpad0Whijcpw04Ul0GTNyotOTVEzZ5RIJvtvyqPrG03w +kY5s8MpyhY33i6vYR5DSvUffWc+ssLEDWlCUW/Fscu8T9Rbb+Kf0SRPOvRLVgkQuBFe GuPpfLaqmojOWZNVy90w0fePt0pkEzeqDe0cipyGyfKqXDcNw0CJF6tB1VU0dQAYkURi FcDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aX3Cx31B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg7-20020a170907a40700b00779e6c93108si11673908ejc.598.2022.10.19.03.30.04; Wed, 19 Oct 2022 03:30:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aX3Cx31B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbiJSJGS (ORCPT + 99 others); Wed, 19 Oct 2022 05:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbiJSJEa (ORCPT ); Wed, 19 Oct 2022 05:04:30 -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 CEF78AE87D; Wed, 19 Oct 2022 01:57:45 -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 A394161876; Wed, 19 Oct 2022 08:56:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3F21C43142; Wed, 19 Oct 2022 08:56:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169782; bh=sByEGu5DwWG/ZQcSeCd52zZmd43PIsJ/HeVT8zR41nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aX3Cx31B2PUM5CUtZriCaIYs94GevP2Vz0PcHj8DOWRNhCcGrWRPiaDziUc730q7X z5rqfpQ8LjNJSSX8nyvLViDbGe47MnNn+h1FaOw83GtptMhkA1PrQUJyi6ywzmRuGK KTTUG4+eHr10lgJESizbcJ0z4rGSMqIRHrOYL2wM= 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 6.0 405/862] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe Date: Wed, 19 Oct 2022 10:28:12 +0200 Message-Id: <20221019083307.843102826@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 04f2912e1418..643fc8a17018 100644 --- a/sound/soc/stm/stm32_adfsdm.c +++ b/sound/soc/stm/stm32_adfsdm.c @@ -335,8 +335,6 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, priv); - pm_runtime_enable(&pdev->dev); - ret = devm_snd_soc_register_component(&pdev->dev, &stm32_adfsdm_dai_component, &priv->dai_drv, 1); @@ -366,9 +364,13 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) #endif ret = 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); return ret; } -- 2.35.1