Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3886237rwi; Sat, 22 Oct 2022 01:33:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gKzuL+zuDUopsgS/S77V+QFEYsvMt6XydwIWoTtVamMufRk5pHEfUGuCuyalqUt/W/SOy X-Received: by 2002:a05:6a00:13a1:b0:563:4c5:c3dd with SMTP id t33-20020a056a0013a100b0056304c5c3ddmr23733568pfg.5.1666427622489; Sat, 22 Oct 2022 01:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427622; cv=none; d=google.com; s=arc-20160816; b=sWpM+o8o/XxXAr7JbZmyk7w2fePp2Gdgi7WiTjPuUoUJTRaMfQs1B1jnOoGvjL2AFV ADgne/NRk1By8wmNl3jK3gzhwuvayXrs/Mwr/YX5k+OaX3MRA+J5zGTyi+Se2nahIYDH LwE4kTQGkRbtbPRj7cAMPaZBANtDNvSo1akPGnhj2RkDXsCVglQ4HLnpsmkajzmdVIDn fo5w+FDQnOBN3Rm4+M0foosFhOBRTVon6uRui/NDv3ZRkFOcoefZtjVspcsk9r9YVhDq v0zh05c5CjAdzzMwfNaOyZCrkL2s8ujF72IUcSlDslK+Xb6iH3kZuPQmCbPKjmKEHPm5 sHmQ== 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=htVDlM9O0/rYPgH0zrwyW6+et2JLuQSMWamPnGXEtpA=; b=w5Eu31Z4swH90mtYoB35Rhmq4EtIuzoLXVhiI0h9V7Hu1tyef7u2MO7zgOcMlBRTb4 0rXh8N+gz77lrZy3UOzRGzMIcaijKO2OY8B1kojMXQIoYMhERcqYY3kkv1thrMP1laDY JYMDINBqtH7U3LuK2lY0Ngn1pu+Ms5ig8aQYMhTMqXMMIYh64i7qk8grWPHM75j3RnWf fYQtaGjIObGwZbSkHXFU7oavtohItGbQuVcxG2Cl0+DH2aV3EmhlZsvCjhAdP2izowny 2FHq/7QEq3g0B7Sc9qguQ+f9NFfgl0v4MLy2bOK3nt3v4zn5iSMzkdaRCSFzARq3bPmO eWAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V17xEvmm; 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 f7-20020a056a00238700b0056391cc1e6asi27846243pfc.354.2022.10.22.01.33.27; Sat, 22 Oct 2022 01:33:42 -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=V17xEvmm; 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 S232649AbiJVIFh (ORCPT + 99 others); Sat, 22 Oct 2022 04:05:37 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 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 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 *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); @@ -365,9 +363,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