From patchwork Mon Oct 24 11:30:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp431243wru; Mon, 24 Oct 2022 05:43:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SmJXu/NJoCaJPbrsYPNsPKYqAAHq9Pu+/CNnu01FHWtqBRfi5Fd8uqEo1z4HIAbiF0sx+ X-Received: by 2002:a17:903:447:b0:186:b945:c0b2 with SMTP id iw7-20020a170903044700b00186b945c0b2mr720346plb.25.1666615398610; Mon, 24 Oct 2022 05:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615398; cv=none; d=google.com; s=arc-20160816; b=voXG27E6Scf+r4Zli/0ZYQhBP8aIWOZCW39K2beZufVzID9IdwKNA4ldFIWEdic035 oQBgqVw4MYDtP4vYde4hAFjeHuqk0jNASdI26+gFu/RbCBM0ixrEYLppBVUGTaNlIMcg XfVyxsBdqnxnDdsRcU7i+Oi+PdMDRTbMMkid1onEVX3ouH28kNwzTl7FXX1BOEN43nUN DuKypblcUcUt9VKVLNLamOM6EZKSZxyNblqv4dzdAwW7ofH7JX71JmvwhCmneXDXV5Ln p2XpLprsPBIYI0VxSgDe0BROHYEdv4CtR2eiKyQbIYB8AVR9H34UBV3FrhA4RRhvsGvC KE0Q== 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=LdP1pX7Q4RS/G6DYavAQ0CodG1oBCTnAB1NudNalROo=; b=K9RuwQgsenKPaMY/zpdJzAZmnbEVLQzqB1dv2u53OW2iS4SQNzIUqZdS+IyKvNCs4t AtUJO4+nIBB0SMiMT2tm+YBEjJsIL7GR2jpOY6s7va0YplCupya+YKbIQja6osthEVAT is9yjV4dtZzFhXvuhQgQuNIBCI5bsDLyFipGDm59AB2l7tyHG0vPpjaxQ13oy1qE8srv 0egAc7xnMTdwLZ3xTx4iqg/0wBVLtZWJR471BfJy5Osi0q96dLPSiz/KqY0Kf+wa9XId kRvRumsnJ4FcCFKIe4ys9FCXireYycAE5HrbPomATaUx9T2M0qmLzJ+9LCBtixv4KXY2 kIRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b++DrnSx; 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 ot1-20020a17090b3b4100b00200acd39846si21043656pjb.63.2022.10.24.05.42.58; Mon, 24 Oct 2022 05:43:18 -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=b++DrnSx; 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 S230242AbiJXMcO (ORCPT + 99 others); Mon, 24 Oct 2022 08:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233931AbiJXM3D (ORCPT ); Mon, 24 Oct 2022 08:29:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AB7B87080; Mon, 24 Oct 2022 05:02:35 -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 92941B811B9; Mon, 24 Oct 2022 11:59:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDF58C433C1; Mon, 24 Oct 2022 11:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612751; bh=wr6A67nBo76UCUyXA2Jm2lacyvdaLQ+4zs5bCcZUDIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b++DrnSx88yKl479TLQqDNsZsGP8lHXSG8etW3agxYb5bC+vbtZtNhiXLTbhDsdMP hH28LsI3CXyxzlpp17DvRN/RWZgeAlUZcZuYIpv1IVxlePskfUDPcevIzd/noM2cA1 xoN8kzfWyrHqKaX7MIRCSDKT0e8zlh76bLfxq5nQ= 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 4.19 105/229] ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe Date: Mon, 24 Oct 2022 13:30:24 +0200 Message-Id: <20221024113002.415388124@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747572908096118455?= X-GMAIL-MSGID: =?utf-8?q?1747572908096118455?= 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 bb6a95be8726..9f819113af1e 100644 --- a/sound/soc/codecs/wm8997.c +++ b/sound/soc/codecs/wm8997.c @@ -1159,9 +1159,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); @@ -1180,6 +1177,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: