Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3881091rwi; Sat, 22 Oct 2022 01:28:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FbceCcuSH5NVD6hibwpaMyS9JLXywLf3OjyMGtVBRcvsi0LAQozw7GCwdQUinEAIjnn/4 X-Received: by 2002:a17:906:478d:b0:798:1c8f:5bc0 with SMTP id cw13-20020a170906478d00b007981c8f5bc0mr10808078ejc.67.1666427310234; Sat, 22 Oct 2022 01:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427310; cv=none; d=google.com; s=arc-20160816; b=TVdiR/ehGySRSJPOoCaDpFyK6TEwO8EqzeJJpGLEvv+WmXEpQY5ngjznu2syg4P1ey Dldug/8p6Alu2ysnImaiitBi9yfqVbMsivYG+mtcSDxW/CqIp6dgJhpXxe/wQtYH3Osp fw5mggptVsGYPZtQ8ADc/FYcCa4piTXigl3nebnBgHO5KUud/32VvEen6dPIJQe0SAFs 6kbk8iBcQ1c7EHKGJdT/oCxKBeFUcidrNBzTrWLoaspyBmLNBLUz2NcoTHwwNyWC4oGc Mk82FoPZbl3Ro/owK4yDtVHptnH6DqZoi3NGW0knfiGcGSdlFV+j58btNX5ZBIVMpA3d 1uzQ== 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=eJ1xBfSDiLxLA79EM2qP/YWCwwrrhzC/RUlyHFhO/vI=; b=LvENbc85DeseHRlg8WBilW6vl3ODRIqE2E2xpgabltQl57qQ1qcIS+TDxhlBnxknlN EX7TL3fQcEOx+zHuDm2zMEYkuzBAZuFE3pSD61/wxd5JqFjVci/qf71kKW1p6bllDtMG T1AzNfQkX31E5ExDovklWcXQ+ndUWVR1r+azg95LRnnXV2iNacC5ZTVObk4/MPu16Brj aE5UF0k22ACRKuWNPBaX7tfbBoEW5aQ3bXnvILYngpudy3Jr7Pk5xZpg/tijSQnF/O08 ldi0DJ0YhqsIFrNQRmI3D+mI15VW9YktMIk53gtSncLCBKRsfkjLQAhu1a4iCVuhfzq7 hCiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uDlCMbge; 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 x17-20020aa7cd91000000b0045cad599362si4097138edv.530.2022.10.22.01.28.05; Sat, 22 Oct 2022 01:28:30 -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=uDlCMbge; 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 S232762AbiJVIF4 (ORCPT + 99 others); Sat, 22 Oct 2022 04:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232665AbiJVH73 (ORCPT ); Sat, 22 Oct 2022 03:59:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 716D255C4B; Sat, 22 Oct 2022 00:49:46 -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 0F30260B09; Sat, 22 Oct 2022 07:49:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 111F3C433D6; Sat, 22 Oct 2022 07:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424966; bh=WUE8FJWJv8eYvKiyEOnorlpexel6MZMk7An450XUA2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uDlCMbge/2EcMOKu1PYFX1ifvMDDL7wKBJZdjz7pUrWU+kuUeCcRBp8nZOaiwZfCS iG6tP0/uofGmxBq4WbYeTcb8b8nVlmSkzUleB04SKxeumHjq5NOS3qe+q/zu6bN+VJ HYo9pODsguY1va95e8smvvhQfBkblO9/8XTCUnaY= 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.19 343/717] ASoC: wm8997: Fix PM disable depth imbalance in wm8997_probe Date: Sat, 22 Oct 2022 09:23:42 +0200 Message-Id: <20221022072510.723567530@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@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.3 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 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 38ef631d1a1f..c8c711e555c0 100644 --- a/sound/soc/codecs/wm8997.c +++ b/sound/soc/codecs/wm8997.c @@ -1162,9 +1162,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); @@ -1183,6 +1180,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: -- 2.35.1