From patchwork Wed Oct 19 08:28:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5502 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp336227wrs; Wed, 19 Oct 2022 06:46:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42mKS96Ayczoc5sZmfVzUPkpfg05Q4u/3S2vFoP8iVfoVi2jCR7OMZg5nv0B38FYuLqoNE X-Received: by 2002:a17:902:e952:b0:17c:7aaa:c679 with SMTP id b18-20020a170902e95200b0017c7aaac679mr8845259pll.74.1666187198634; Wed, 19 Oct 2022 06:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187198; cv=none; d=google.com; s=arc-20160816; b=iPHc5JDk2XK5NoGPXduU5RkPCX212etUNHwbgaR+XHWIOLSasY+8iEpWlq9TdLBa/t pNtyCxvdw22nargWUVdgyP1gEGRVbs7CliSVHwDOEr6eKF4FXeU8BOLsUIhbJD5LReMX YSF1ptJwNFv75xHFEx89mTfz5lQzxGsGITlsw3zegDoFbNn4V5RPPWrPDi1LOIkZJZFO PKvH53ZH2j70m55GbQn3sG7HwhhRUK8h7ohTdQ/yDYIn5eXQokudd7iI5tys9eomopoH b6VVnA9KooCB9VxmklAUk4KdLqWoB4t6rURYxc5/JW1sYXHxn6gJiEzNPsy8tzv9rsk7 1iEg== 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=78fNF2frlMch9gnhmTGEjgbTP4Ptqnvl0QatZ9VZq4k=; b=zKhBNxWenByBiKxxhxKqD27I/jAhcQg2C1G6qQWIEEs9q6zthT6ZwGGQrAtt7J1w6E Qsc5R+cQYCfQ7uB5TvnWwvrk6wokJMz8Y321Tt/wNwFCxt/WrYaSFw34ZwX8AgRxKeCl +KZIsujoWHOfxiYcNbEUc8d6tvhNRhsG8KnV4Y4onyMjxRuRSXozg847ChV6k/CLAzXo x7+/7EgqgwsY5UdWcBlqPc5dNg3z8FcqQ9SzhyQrubMifQ4NZ3VTAy17QL8JZiOV8KUy Q9U2pyQW0I0Apxjb9sokYGUopjhzqA7Bbb4vLBqVvsPJMnhD84fDORuzqfXuGBvPiGam peUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eIcNm3x0; 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 l1-20020a170902f68100b00179d2e2e690si21690834plg.332.2022.10.19.06.46.26; Wed, 19 Oct 2022 06:46:38 -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=eIcNm3x0; 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 S232227AbiJSNpw (ORCPT + 99 others); Wed, 19 Oct 2022 09:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230346AbiJSNoe (ORCPT ); Wed, 19 Oct 2022 09:44:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0659AD8B; Wed, 19 Oct 2022 06:31: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 ams.source.kernel.org (Postfix) with ESMTPS id 843E3B8241C; Wed, 19 Oct 2022 08:56:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD26FC433D6; Wed, 19 Oct 2022 08:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169787; bh=mHHiX2Vds7w034Q/10+IvKu6BhX3WEG6qDXMWNVsef8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eIcNm3x04mz+6L+fwf3zcZEzC5J37pUA4zgEcxrJX7ujP6wKuQ/WgYF4iwa55PHCc +2O7EBJ2o2A7kAXQTfT9u3ce52QS8hm225guwQbRWKhFj2u2lZPmfykjn/FVR+2Eub LiBgzOO63/j11GQypFc1vjowgNpUg5RQZD4n/YBI= 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 407/862] ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe Date: Wed, 19 Oct 2022 10:28:14 +0200 Message-Id: <20221019083307.934299755@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?1747123908022730675?= X-GMAIL-MSGID: =?utf-8?q?1747123908022730675?= From: Zhang Qilong [ Upstream commit 93618e5e05a3ce4aa6750268c5025bdb4cb7dc6e ] 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_i2s_probe. Fixes:32a956a1fadf ("ASoC: stm32: i2s: add pm_runtime support") Signed-off-by: Zhang Qilong Reviewed-by: Olivier Moysan Link: https://lore.kernel.org/r/20220927142640.64647-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/stm/stm32_i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 6aafe793eec4..ce7f6942308f 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -1136,8 +1136,6 @@ static int stm32_i2s_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(i2s->regmap), "Regmap init error\n"); - pm_runtime_enable(&pdev->dev); - ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0); if (ret) return dev_err_probe(&pdev->dev, ret, "PCM DMA register error\n"); @@ -1180,6 +1178,8 @@ static int stm32_i2s_probe(struct platform_device *pdev) FIELD_GET(I2S_VERR_MIN_MASK, val)); } + pm_runtime_enable(&pdev->dev); + return ret; error: