Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1119685rwi; Wed, 19 Oct 2022 07:00:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78zRFImF846wyekHSDcN7tcakrTIVJBE/cgj4QYK5B+/pYm4Saewu//WPe95Zb+rxZxbvN X-Received: by 2002:a17:906:fe46:b0:73d:939a:ec99 with SMTP id wz6-20020a170906fe4600b0073d939aec99mr7024646ejb.169.1666188032990; Wed, 19 Oct 2022 07:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188032; cv=none; d=google.com; s=arc-20160816; b=C1OcIZR7WyLQtl+2Hgj7Aae+7vvlnzpKIHiqGhafffzo7rlNGbr+rfyINFg8FH52pg NCgSfkW8KMG03/p0p3T0fOj2gKyzMZ2JnPKu3V0J6Va2pJeS6Y1iDQJTqD2nOVrZshxl chUS8nW+qIeIy5/VVQsXs6xfebegflxpnBKtzyStlO7+RKVQT9qKU/+1DGhDVB4HgBGr B4kg4r03SyIBpMQPPIJIwRf0qAc1SGAWC56zLUmT8I/Ii1yH6pnFrR1QRAhLHoqNvM2a Msql/S5753+0sOt91A7p602HdrhOxe17CobPEOMhAJlVmbkjxkyPiboXjhnqWGHaFwNj upfw== 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=gCqDLxCWDnbm7o3xud6Kk3H9sqnuTU4nATxEAIdAl1o=; b=jRXkG+JUs5bm+gLsDwwvqKJx0hgpr6ztAWf3aCDK4Xzvi18loMhn+gRYXa730Sloas aZW2tjNY05pW3ccUXXxAJYBxhbcuPns8135sU2G40eynd5hoZpMA2E5yJlaItLmtprqF 1d0dl17ZOtzkvEyPeSW29DRgpxWtZJa0TaA1YWGQRP/0DVtT0pzc0ver2TtIHPM76X8o r+F8sRmHTZ3bP7QpqMaDjfBtw04dJXELbFNr+s3b69ItIzcX9QeLFL/2SImqeCahcBT0 se8bnBQSTa2Fpld5izXtLaJ8eOwCjNhjgwbt2k+HQI9GOOIE1J0DZ8LlsxmeazemiNvc 9yjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NsIsPX/B"; 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 ti5-20020a170907c20500b0078266dc4b97si10680586ejc.735.2022.10.19.07.00.06; Wed, 19 Oct 2022 07:00:32 -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="NsIsPX/B"; 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 S231496AbiJSNrU (ORCPT + 99 others); Wed, 19 Oct 2022 09:47:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232627AbiJSNqH (ORCPT ); Wed, 19 Oct 2022 09:46:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1EDA17251F; Wed, 19 Oct 2022 06:32: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 ams.source.kernel.org (Postfix) with ESMTPS id D9098B8242F; Wed, 19 Oct 2022 08:57:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DE70C433D6; Wed, 19 Oct 2022 08:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169839; bh=AkyAu0v2j0W7eNhRoo3d/AmvDM+tLyRjv53VS/uc3LE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NsIsPX/BsdinMtfZ02r91UANbrEo0KJsfFR5hPuG3qF3hH8QlKK1GpGxOiTpenHwq R2nQ1T+rqhN7WzaSioPSgCZZEsRwGU1J33F9EOUnj7FwR8KzDwnUX+lU8BKIwT2dFZ sjGptK7Tp59CzesjpeD/kpzCKVLBOmyrmdwOuNdE= 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 411/862] ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe Date: Wed, 19 Oct 2022 10:28:18 +0200 Message-Id: <20221019083308.124021930@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 fcbb60820cd3008bb44334a0395e5e57ccb77329 ] 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 wm5102_probe. Fixes:93e8791dd34ca ("ASoC: wm5102: Initial driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-4-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm5102.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c index af7d324e3352..c09c9ac51b3e 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -2099,9 +2099,6 @@ static int wm5102_probe(struct platform_device *pdev) regmap_update_bits(arizona->regmap, wm5102_digital_vu[i], WM5102_DIG_VU, WM5102_DIG_VU); - pm_runtime_enable(&pdev->dev); - pm_runtime_idle(&pdev->dev); - ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, "ADSP2 Compressed IRQ", wm5102_adsp2_irq, wm5102); @@ -2134,6 +2131,9 @@ static int wm5102_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