From patchwork Mon Oct 24 11:30:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp423774wru; Mon, 24 Oct 2022 05:25:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YTjzsnG5+IX4uSXJFnF8lns+wrHhtvpemjA/GAYKtjjDaliwGOOSZkzr7gGcE/ERHh0H6 X-Received: by 2002:a17:90b:3e82:b0:20d:2fa1:d08d with SMTP id rj2-20020a17090b3e8200b0020d2fa1d08dmr75269039pjb.162.1666614343519; Mon, 24 Oct 2022 05:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614343; cv=none; d=google.com; s=arc-20160816; b=i8dclspLDn8KMt1Z2ipDP3kLzGamuFFqopda6Fkz9BkADzuS3CqFIcb872kr3iomIW auCT2KyzB+LPACyX40aPiApFF1gCd4+63ZvPIFJhXm/uxOMaGeV+1c3Egvsqm5rJ4X6z IW2gq/CGsuEJsNt3Brrf26GDLVive/EUCEP7VKD1HKRHtNRUoOJOClej76gw01xXh2Sn 7PBkJ2FMb4jFPmhsJPf34nNEUG3hqoC4eIA/ozg2f23Z5xOsE6uVIL18SCjjMiQhqzvM ckctehDEWCnpimuPvxhspyqZKLwaM4ZeP+FaJnSa/+1qGstisBzwJJrKk4cV0HMoUni9 bNlg== 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=JMJZ1lbOktFCaNNdU+Mzi7ZcIW28ncyAy8DfB8FGs+E=; b=0b3yt1nRVeIqnUENZZP26yq9cPOA2nQLNsptNrkPP8xG21d5WuXNM39mUUGVrtZgAe aBzOqDW7cQVzh3ukkcXIva8gjsODAy0126DPzMn24lujdWXq8/UQXc0M2KchgoWDqSUC SYLzejP3XGSoxnZ3yQEAChpZk/TSAP2/c8CQkPD08i7C3Y2eNCDazGDwYtq6rUWq68pp Uh+gYJpgP5lXUyhp9Hk33N9BwcIh7jXsHF0atey+LHFkisHw3uMlBl/8pALHiSbF/uEH V9ARVl7HQBrLmrMxCZNYMf0EI8isr27peWSkJL/q2AQpV4yUF41faazD3eSQaJyvmWbA pdAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o3OSMN3L; 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 u70-20020a638549000000b00457dd1b8165si11378861pgd.690.2022.10.24.05.25.30; Mon, 24 Oct 2022 05:25:43 -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=o3OSMN3L; 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 S233548AbiJXMZB (ORCPT + 99 others); Mon, 24 Oct 2022 08:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233376AbiJXMXM (ORCPT ); Mon, 24 Oct 2022 08:23:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C93F511148; Mon, 24 Oct 2022 04:59:42 -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 1E1436125A; Mon, 24 Oct 2022 11:59:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 313FDC433C1; Mon, 24 Oct 2022 11:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612756; bh=CZ7TxE+NMJnDnxO9IUXVaIiVtgKrEN7pRINPzURS98Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o3OSMN3LED6GZ6XXo1ZLYH10mouu3sh4jC849pws4D2TytQ4zcyVDEdQOQ/AKg/JR RNUFcdEl5avcoVqmoguscBWuEnFpUyLWP54c7OeH8i8WUnrjMxlMEiIA7lWb1dOql7 nTTp1+gs0zKjI9acjP66XI5YN3rxNjNXlTnu+gsE= 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 107/229] ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe Date: Mon, 24 Oct 2022 13:30:26 +0200 Message-Id: <20221024113002.475044346@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?1747571801604299217?= X-GMAIL-MSGID: =?utf-8?q?1747571801604299217?= 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 7e817e1877c2..9b33c87c2fe4 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -2085,9 +2085,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); @@ -2120,6 +2117,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: