From patchwork Wed Oct 19 08:28:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp336915wrs; Wed, 19 Oct 2022 06:48:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7i81VaJpZiNYRrKk8cGyb5ZrCdkoU6UmO9Xb0oXkUhS0XKOPXSCjTgt4w16vHXi0TGZLy5 X-Received: by 2002:a65:5886:0:b0:439:8dd3:18d4 with SMTP id d6-20020a655886000000b004398dd318d4mr7302115pgu.430.1666187283517; Wed, 19 Oct 2022 06:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187283; cv=none; d=google.com; s=arc-20160816; b=a+/HfzQtCfSNkgWPurRRAz7Eb+r+DALkwZtGuWUNf+wZQxPaxIJ3WgPR3WGey5BHHU PI+HiH8m67L9EtAU8VJRbQTyHruOPLJ2I/wctANXaXTGL7bd2HKQY/ef/mKnS1MV8TEt aGAsUMRRaeXRf2h4Ofyk0G05LKthkRy9r88SOwP1MLez+Qa+pAC3MNc0RmQi5dFBHWgE /jqr6EorlbMgAgMPLgCwWhJmVB8/4Ea/JH1tMb1IQuQNpsM5sdyNutf0iBwMC4rTIJDo nf9/ScCtUZsuZN/Vy72pbSA+U1L0rfoel0eNfPPCgzGMUJa2wqT8jKgC1u1UyA+4bYsp LnlQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 129-20020a630087000000b0045ff2a2f56csi17888953pga.546.2022.10.19.06.47.50; Wed, 19 Oct 2022 06:48:03 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747123997417906287?= X-GMAIL-MSGID: =?utf-8?q?1747123997417906287?= 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: