From patchwork Sat Oct 22 07:23:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7390 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096895wrr; Sat, 22 Oct 2022 01:06:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6eeNGBfqryTiYhGOCv09CPLtBz/9qfd1khc20mSGbsbcnVifjtWJah0Z65DsKA/k+Iy4zw X-Received: by 2002:a63:1609:0:b0:45c:7c1c:4e7d with SMTP id w9-20020a631609000000b0045c7c1c4e7dmr19355672pgl.265.1666425978834; Sat, 22 Oct 2022 01:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425978; cv=none; d=google.com; s=arc-20160816; b=PhTssdy9BYJSkoGW9KbBQxhxT7Ef777ASdyE4jU9HbLRmKwtG3nmYieP/emDa9eC2H 5l6Iq3MEeGdmtZ62lgOj21abYxTxqOFXqESvnx0zLgLEK8ZBWnSb+SGTay0k78WbwY+P K+tpMMqDXp4gYK2zM7xnBDPAdXJGT/ba0TF+3MDEWbVeCSPqnYbbaFjSjqafrlbRRnvh MhpKK8FzfRE4Em2J11r4ab+MsKHINSpvdp1achIikLEEFKLG5ZntgWYDbMAfjHKILMnm K/lwFRff/iNib9zouyb6dNmCKA7hsh6iI8vzKEKIKDmOnRc0M6wR5JdlG/RSZkgGl044 fTew== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g5-20020a056a0023c500b00537fe344fa8si30450409pfc.34.2022.10.22.01.06.05; Sat, 22 Oct 2022 01:06:18 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374287186867785?= X-GMAIL-MSGID: =?utf-8?q?1747374287186867785?= 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; }