From patchwork Sat Oct 22 07:23:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1113262wrr; Sat, 22 Oct 2022 02:03:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WN/KXFakbnhdkfKyblv7GHbXGsKilQwjK1x/tiN7O5qfBLCII7VE8m50muYjavwYApmJ+ X-Received: by 2002:a17:90b:1d8c:b0:212:e08d:7390 with SMTP id pf12-20020a17090b1d8c00b00212e08d7390mr2960510pjb.168.1666429362400; Sat, 22 Oct 2022 02:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666429362; cv=none; d=google.com; s=arc-20160816; b=e1XKNwMApY2sRSRadQJgnTC9aMW68TfpJHkz3ZgGRfT1XaVIISbJVIVPb0zq+HusF9 M0qRqUGsreRxyfmc+mkVxc1f3Au19EdEZdGRm9vw5SCKuqCpHYzAmxbzu435e2ZEBDhg zqX5wrfEDdBbtaM8Ehd2ni1giplW8Bj/1U8fshk0KYIW1+odVrgDxV5g8sH+UwEJ10sI MGx8/YBUU+vrZObCeCGnO5koANhTAUjpJktNtsp+nybc8GpXXK3cnV6fjQJ9Eq7szp7A 8YVeiziaetxGr4nRCUatUr+oR5o1iWFJg4iI3zpqqUqKwS3gCkQQCnQUP48VEfqknoQQ Od7w== 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=vuo8cZ4WRnrb+Ri91yCQesl98W1XkSSqVtbSDNebb4E=; b=DgCawBdsrZ5OyuRQ0lSuY3zAPcmwmVTXuWmnKkD+zHHD1lmqcHQZgU2ZOfOXbaAzUi QX1HubR/21imb4WqZ13AHLhfn+csRCH/9ktgB4mSOwBZNpXE23tn62MCa2OZ22xWf8G2 ijqwSWOtRywEoiTzmPVksfnHkulU8dIh+wDPh3pDgSGpfn819Tg2gfAVn7hN0WFa4G+o pXbgQ28CgeAW+bZPrJTR9jKHK6FKmqhtx3ZUtAVG1CswTXucrD+auOwsm5amRkBeOBqt ZxZX7uPljLwr5DgrDtcehrDMJxWhBtv9XfbtNDZ90+1bETrinLL/JJV9CxTLret2ZWu+ ax/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LqeTczgi; 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 q13-20020a63cc4d000000b0043895127033si28089079pgi.335.2022.10.22.02.02.26; Sat, 22 Oct 2022 02:02: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=LqeTczgi; 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 S235038AbiJVI6e (ORCPT + 99 others); Sat, 22 Oct 2022 04:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbiJVI5r (ORCPT ); Sat, 22 Oct 2022 04:57:47 -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 E8C6CF53FB; Sat, 22 Oct 2022 01:15:16 -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 7DC7E60AC7; Sat, 22 Oct 2022 07:49:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AD89C433C1; Sat, 22 Oct 2022 07:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424960; bh=gvy+AFjkeW4zfEWxGpVygqiYoy0/OwkUtGWZjzI5AQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqeTczgi13ZoZqZhR3tURjRbFkw7KittIIlTGBMDl0MRDoBIgqXfWSQ8oi5axfrOr /2kogDZXI7y7pkFbasMEQjLGAe34pAK8ABaf0rzZyKuk4jRiOxGmCxW7zMuJ3weOZX +n8rDsGTGyjvrsQh4DnNj6nyWikV5IrqG6BL6JQU= 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 341/717] ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe Date: Sat, 22 Oct 2022 09:23:40 +0200 Message-Id: <20221022072510.568088669@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?1747377835178524461?= X-GMAIL-MSGID: =?utf-8?q?1747377835178524461?= From: Zhang Qilong [ Upstream commit 0325cc0ac7980e1c7b744aab8df59afab6daeb43 ] 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_spdifrx_probe. Fixes:ac5e3efd55868 ("ASoC: stm32: spdifrx: add pm_runtime support") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142601.64266-3-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/stm/stm32_spdifrx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c index 6f7882c4fe6a..60be4894e5fd 100644 --- a/sound/soc/stm/stm32_spdifrx.c +++ b/sound/soc/stm/stm32_spdifrx.c @@ -1001,8 +1001,6 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) udelay(2); reset_control_deassert(rst); - pm_runtime_enable(&pdev->dev); - pcm_config = &stm32_spdifrx_pcm_config; ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0); if (ret) @@ -1035,6 +1033,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) FIELD_GET(SPDIFRX_VERR_MIN_MASK, ver)); } + pm_runtime_enable(&pdev->dev); + return ret; error: