From patchwork Mon Oct 24 11:29:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642188wru; Mon, 24 Oct 2022 13:37:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4F8kg1HrqiBqsHqlVLhCQtezfQjTLUHX0aEffDPWYx1i5GYGBnDgGbPzTxkadIsh8emDXA X-Received: by 2002:a17:902:7c14:b0:17f:6303:f40 with SMTP id x20-20020a1709027c1400b0017f63030f40mr34832511pll.1.1666643861680; Mon, 24 Oct 2022 13:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643861; cv=none; d=google.com; s=arc-20160816; b=ZGx9dQy2Xs7ac191Ib+05u2fq1k4MQsGJKtYtV3wFSFv/3iaZ002sbclj2Z396Su5b PTF9cDXfG2z4p72vTFYYS5rCAORRowtqelUYjSH0kcPHEgSoy600g8uxhLKyqMSvtBg6 Dl9KJiN6ik0y4eI5rDMIYiIS2iHRrdzpto2N8vVAE11xuelP2igDBFQfrl0rwRND6eC6 8AC0IHJ3m161wClZsEjcRtLWC9VWxOoPA2mmjiaI6vZlC34DtAPwpwgwoiWy2gWquJbV dxJoOieUXLoKePbnAJgyTDJZlnj0K9SKA83tyAuaC1SHZ5BnBfQATipR6lp3Ci4D+hN7 sChg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a17090341c800b001865d29164esi660961ple.212.2022.10.24.13.37.28; Mon, 24 Oct 2022 13:37:41 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747602754234612264?= X-GMAIL-MSGID: =?utf-8?q?1747602754234612264?= 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: