Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7426693rwi; Mon, 24 Oct 2022 14:36:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fTbdGXpl94pQ8G9JO8XUCL96TbitysWmy+E17ajdJKZ8WmnsQcelS0P/3dI7ahz0Bzzgh X-Received: by 2002:a17:907:845:b0:731:2f6c:6dbd with SMTP id ww5-20020a170907084500b007312f6c6dbdmr29237060ejb.551.1666647408538; Mon, 24 Oct 2022 14:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666647408; cv=none; d=google.com; s=arc-20160816; b=biynVvHU4FQidfIHFi6quN9eG6B95nOk0ybH5tVXrqxrGsAeMBTCHal22tg3wCGBih GBzwlTZsjHgdIUIAo/JRycE28Y6jOpCEeHeIbBBJV8rPY33RrPdFGq7zM5qviHTEodqp DD8PrhxlrI2Yfj0vOfq8uy/T4x8YLDzrldjuA4s5upC2lAlCUYmYxwe3ugu+MRVT1E1t uMDiEa4NO/ZprUh85qcOKkHjsXyZ3JbOSMSd4h+mDwojLVz3vlN3jF5VFM3LuiIqgwO1 g1bWCU+GUxnltwENUcuTpxRwlbw9DA2un3xw4TRyoih54y5lGzt/FNF95km+2l1e4Hkw W4+g== 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=UWe/0d8MWcfmz7HNB6Ulj6buLFxeGeEANw016p6IHy0=; b=oKlbps9KqJ07oZ0PaPyVq2HOXOBHWELY28CFjy7stqi6pUmc36blr/pRwLFjRryhYw XOCMrw30fI8fYd4prF/uyF5vQMj9n+ru8BeI0pqD+JF8i5+8rmbAso380hIc7Drwmx1d O8g4G8c3l+LK48AX0ef2zU0GWysnaz1cFnNkZbamwooPXWeBsB+iVO/WLHXyKG/EFv5d BwNNnoQr3GK4EVNqh7xfgUKW02MsNZYNyGYIR9JaaVcpXe6MntxoG+V8m2XTnFDm8GjL zP7+mvYZIZQJBlcnvF8dW7ryQs52cZ1Z5N3dRGRg6MU7owK9U6Km/aC7bhACsZDzghDA 1g1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XXFOCyCA; 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 e8-20020a17090658c800b0078c3197bf86si948457ejs.533.2022.10.24.14.36.22; Mon, 24 Oct 2022 14:36:48 -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=XXFOCyCA; 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 S233127AbiJXUcn (ORCPT + 99 others); Mon, 24 Oct 2022 16:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234342AbiJXUb1 (ORCPT ); Mon, 24 Oct 2022 16:31:27 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD5FA38697; Mon, 24 Oct 2022 11:43:08 -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 sin.source.kernel.org (Postfix) with ESMTPS id 85CB5CE13C0; Mon, 24 Oct 2022 12:23:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC44C433D6; Mon, 24 Oct 2022 12:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614190; bh=wF6UUJRkHf9QYtND6AvtkHRvV5GkEmtaCAcf59ra3aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXFOCyCAcIBXJGF+B4fWgoZQ87ACFp+uxZtIXSWRA72gEG8Iab+lBYYAoTpATcZ9/ TEXxybCG9FdQpc8c8rmBsiPoudjBM91/fG5ni3OI3AVzRv7ogiAR/94T2M6K7jq5GZ eVz52v/nqO+OY5Pt5g4q6SaovOUM51Sa3Hl9MzkU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Mark Brown , Sasha Levin Subject: [PATCH 5.10 166/390] ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe Date: Mon, 24 Oct 2022 13:29:23 +0200 Message-Id: <20221024113029.785635873@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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.6 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 41a736ac20602f64773e80f0f5b32cde1830a44a ] 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 wm8997_probe Fixes:40843aea5a9bd ("ASoC: wm8997: Initial CODEC driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm8997.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c index 229f2986cd96..07378714b013 100644 --- a/sound/soc/codecs/wm8997.c +++ b/sound/soc/codecs/wm8997.c @@ -1156,9 +1156,6 @@ static int wm8997_probe(struct platform_device *pdev) regmap_update_bits(arizona->regmap, wm8997_digital_vu[i], WM8997_DIG_VU, WM8997_DIG_VU); - pm_runtime_enable(&pdev->dev); - pm_runtime_idle(&pdev->dev); - arizona_init_common(arizona); ret = arizona_init_vol_limit(arizona); @@ -1177,6 +1174,9 @@ static int wm8997_probe(struct platform_device *pdev) goto err_spk_irqs; } + pm_runtime_enable(&pdev->dev); + pm_runtime_idle(&pdev->dev); + return ret; err_spk_irqs: -- 2.35.1