Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7388611rwi; Mon, 24 Oct 2022 14:00:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ZMAdPezQ0DeG7UKUKXmdE1zd9u5+JQVjaMPoP4dvM4RpBJuTXnzBmWJeY6sgHUG5TGZHQ X-Received: by 2002:a17:907:1c17:b0:78d:df89:26c6 with SMTP id nc23-20020a1709071c1700b0078ddf8926c6mr31050454ejc.20.1666645232323; Mon, 24 Oct 2022 14:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645232; cv=none; d=google.com; s=arc-20160816; b=niy1ICW8hMvHelFhr83feWbx8eQtSuRkVdUUjSVeVmhvqfApQXJy53+nYLl4ePdwrG 6z70Ywkj9NZztBnbcriJb3cXGykyeeIUeRa3ZuIUp2+bdNpL9UPP7guzSLmChyYehpsD FrmVaHpUoPdkxQwZVpSR3wPXu9XamQwDeomeyUTHQMzvsZjjkGfnsSdeDNKElPxtqhB/ yE1i3cl0n/oLBGyKKIH2TcdpDNz73S+LZF0pLQL7nMLodEbWa+JFURi+RRhU+uSZl5LR 1DANtCfAqmI3dWQd4Z3u1aB3GjVXc0sXylwA/OVsyio7dsI/XBP5LPKgdbxp/2/2kobZ aogA== 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=K8fQ7XLkNkGDrAfrRebbITaBt8E9B5LJ24tRuP2NiTw=; b=oZXWKAQoScMEDIYQC/gF7VA+eAp2lmPs2/L/qde6tbiuN+RPNEkffQooEycPj15PIF 6rFQKDlkIxHKAngdcHHcLlo3HpP0u+YXjjJDQpgTS54/DqKVqa1HcJplpO0Y785VmdqA h3ZxQV57AJuWY30P+Z31ljAkHvte6camCkBWBBVgEP+p6MjLuTgHgfQLtnjIpF/7EDce zU7jUw6yJjaljMpcKOZet31mcX9ryPSXTUh/v+G3pq3q6u00dA2QH3t2atZE069cmrf9 0GtP8olCMHnWWg9EiEE7JRW2S/ZAIOmV7FjO9HqvR/cP/Ao4rhnzYwt5o+ffIDWQ1ufu jY4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RE3Ll/kk"; 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 z66-20020a509e48000000b0045c9dbe290csi691843ede.406.2022.10.24.14.00.06; Mon, 24 Oct 2022 14: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="RE3Ll/kk"; 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 S235119AbiJXUqH (ORCPT + 99 others); Mon, 24 Oct 2022 16:46:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235564AbiJXUpG (ORCPT ); Mon, 24 Oct 2022 16:45:06 -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 5A3F918C942; Mon, 24 Oct 2022 11:52:29 -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 59D89B819AA; Mon, 24 Oct 2022 12:43:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A81B1C433D6; Mon, 24 Oct 2022 12:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615416; bh=5DPq8quTcRFNe6hitrL+3zKyCXpM8J1RY/qwMK/2jnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RE3Ll/kkiLAk2lNQcPhpVcFFxyQUlL9MtrZoF+9fujklmb5RmDPrzSd4b+R6XIRYz 0aUQLuEi4pXO+Zmd6CDoK8nBrCDj/pLtOYvnyO4a+oVz4/hSGO0TkNHjkG+m0aUIBU qLaOp+QGSEV+HqqEv9hgjbRWfYLRPR8cjMxlVZvI= 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 5.15 243/530] ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe Date: Mon, 24 Oct 2022 13:29:47 +0200 Message-Id: <20221024113056.105559527@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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.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 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 621598608bf0..c8adce8936bc 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -2087,9 +2087,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); @@ -2122,6 +2119,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