From patchwork Wed Oct 19 08:28:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4700 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp213751wrs; Wed, 19 Oct 2022 02:11:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dEYVqtsz3+OnUVURqLigosC5xcONDMq871ffygGskG2xWNEpZI7T9vVX4T8t7gi4xaQl8 X-Received: by 2002:aa7:d454:0:b0:459:9ae7:725b with SMTP id q20-20020aa7d454000000b004599ae7725bmr6461527edr.165.1666170659982; Wed, 19 Oct 2022 02:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170659; cv=none; d=google.com; s=arc-20160816; b=i4bmjGkvbdu97EDNNGh/1Q3hIz2RbwvQ4Zo3sGUNvpikIlwlGjMjUOuDL/skvS3zgr Fzzh7cfCVtpYwdRwpiW7X+qn9f9ydJT28ySTSpCFgSWg33PVVgSHZeEVutct6DfhHEof /ZS5MaaiUB1378QKeFCsRojl4//oF5MS71jK2fff/FuKi8KK/nGgjFpS4Qlohzce5Puc O95eAFQ0oLVCbKm0EGvhXEuRk77l6/gx3sfNwxDOLRRt1CxIyZaL+moXbtqkf0PF5+eJ 1agScFOp4DoEEDDe1jASCoC+R+yNsRv6nbVY/hAf4xRQ0jv2xcjsqLTGEPLMB+6cK7Ae MGFg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m4-20020a056402430400b0045ca15afe1csi14286912edc.553.2022.10.19.02.10.33; Wed, 19 Oct 2022 02:10:59 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106566311690536?= X-GMAIL-MSGID: =?utf-8?q?1747106566311690536?= 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; }