Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1101693rwi; Wed, 19 Oct 2022 06:47:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yhCB3r115MngGXkNfttl6PeZ72s7McytnKukF8pGpjZ+5AfLXJxDiIlkwDKBv/eIzRoJh X-Received: by 2002:a65:6bc1:0:b0:462:4a88:4fef with SMTP id e1-20020a656bc1000000b004624a884fefmr7248181pgw.282.1666187228280; Wed, 19 Oct 2022 06:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187228; cv=none; d=google.com; s=arc-20160816; b=oZDBUW/l4Qqyk03KTChwc61Nk13I5dnShaEZXAjCHBkzV5mVBU/UNv32OpXXWTNH6S Z4g0SfLtpXV5JmAXKOT1vDgGooVv+UKvqX7qIMWdtjl7crMB/Wt14pcombcRwlQkVhYG Bu3BY7BDEooP/HCFDmYpHfc3ZlF2Qs16bv4Xv/g65YZBkSuJ/AkrBOX9SZ5NumyojjpQ FF2Xgf/aYidZbqvWLyySeUOq/2JbNMitdJERu7MSFGInMILzntB/qm1+JCiqyThZS7pQ BB9KFMIN5jafYnnkn4RjlcPgv8oQLPNy4FZ5f5iyr+a1WCk+pZBzp9jNfMbSEjicPyVw VfDg== 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 Return-Path: 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.54; Wed, 19 Oct 2022 06:47:08 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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: -- 2.35.1