Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp313771qtb; Wed, 19 Oct 2022 02:37:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/GRGtrX6mP/Fbn4fVdzZWFQ/3eAIqDUcYLFCBc31J2ProKVowVhJFOsedcysPnfIyoSuX X-Received: by 2002:a63:6a85:0:b0:43b:dac2:ff0b with SMTP id f127-20020a636a85000000b0043bdac2ff0bmr6681119pgc.234.1666172270804; Wed, 19 Oct 2022 02:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172270; cv=none; d=google.com; s=arc-20160816; b=tJl4J1ZYPBSgFjurAB4MavMDpI27E1AtOpGAO+RSJJx8jwFq1jt9Fyfb/ZxqJD+D/1 GqBvxvgLuD474NWquVN0dVAQl0btmdz3y2dx6MumEq8OKAVGKr5S9eNaNIYl3Hepd8Zc c7zTAoJ4cMO7lBOFSr1zLkYnzV1jC/1FZPM8zs1t9PM8MDad/XIzw3xIJMKdAdUa8qDi +IkWssUVMz1LUqmScwSVKOaLAlu3V5IBtdInhyi35mfl2+uF7I5PcaqdpCm3IBnStZ/h bkJQLI2SEjeUOptz1BMBM5L0NiMvC/bG3/sD3OnDJlXX5r+8usrqxC0rK99L48NPJysW VZtg== 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=5LY1TBJ92AoAUaZ9F6o9IomwhUtkNEKZBWpz8HDN9n8=; b=bLNYiirEsT1C6b+XNjDs/AdSX3bl8Pi7hmfvUIvJO00CU2W7cLzM/gLTwuveU16FZz tjQmAMrrd3eBw5acajZmHCqsxSCw38nGBT+boIr1DbkkdhDOBVVIoPoNlh6jRE2ZDN1R IVA6MMbnrZNIQSSKgo4YINMtoNhd+UgqYASzVW7lQHu2b00fgto07lRLEh3cxFFZSllY LvLinKo8NG3Knp8kqbZurpSi4sw3mkqRKbGBevvyn0gCoIJSeHC/SNIQ481e8W9Z/nO7 NzoAs5Q5FGjyaHCLpp+1eEoaTiZdlzxupKZm/KBG1jVLY4+SYSZATjGjmvyD6UIrqXMD 4vxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZQzeNqKo; 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 m10-20020a638c0a000000b0045650af278bsi22342019pgd.817.2022.10.19.02.37.38; Wed, 19 Oct 2022 02:37:50 -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=ZQzeNqKo; 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 S232635AbiJSJK5 (ORCPT + 99 others); Wed, 19 Oct 2022 05:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbiJSJHz (ORCPT ); Wed, 19 Oct 2022 05:07:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08E7D37190; Wed, 19 Oct 2022 01:59:50 -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 9E1E161834; Wed, 19 Oct 2022 08:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6420C433C1; Wed, 19 Oct 2022 08:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169904; bh=8W+/NxM68L/g8fN9dQL5KTSadQlgiAONnvY1bNitC18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZQzeNqKokc5C6+Qts2dgd3Dxj+R9/DZtZjXqpuTGPsUHfYRY2HgCEvA+q0mWuASWL DZMAggyXX0ARRIRRloIxaC4lYUrv9xsdjKu2eJWRmtKyM5XrNZMMdIA05+B21OWpYv 5+xGx5yFQC080qtaGW7T7CtTTOex7TW8vaFFT1mQ= 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 6.0 409/862] ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe Date: Wed, 19 Oct 2022 10:28:16 +0200 Message-Id: <20221019083308.028299921@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 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 210ad662fc26..77136a521605 100644 --- a/sound/soc/codecs/wm8997.c +++ b/sound/soc/codecs/wm8997.c @@ -1161,9 +1161,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); @@ -1182,6 +1179,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