From patchwork Sat Oct 22 07:23:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7397 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1097090wrr; Sat, 22 Oct 2022 01:06:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6THjB77HLjs08Z1fI/+fCID69TAjMBPApmLzQuGSTD0reWL6wgGCSuLFXefRAPJlCuXK1+ X-Received: by 2002:a63:6c01:0:b0:429:ea6e:486d with SMTP id h1-20020a636c01000000b00429ea6e486dmr19103478pgc.247.1666426006071; Sat, 22 Oct 2022 01:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426006; cv=none; d=google.com; s=arc-20160816; b=fVVW4+6IfjusE1TCTwJ1pGiYn65EK7G5kck3PWVvgU171Kw8y4qntI1z7mJ5aXIiKg aTnXiZohpCMumxoRZBOyOZ2FalwGekSbzMXrcsKP9V+RHDmcU3TAGg/70Xv/0v5oCVcJ mDV1eZnUXw/sEOhclJjQ17Bk3Xg3Q+jmEfRpDy/jsjGtNp/sHP2jj1x/SaiXroU7rJuw qqQvJxasE2VriPmh8myzDWpgkKuoTzXRQKObZO22u1S+XKf2zs/Uq+ARAmsDPc186t/6 U/hSocQm4KaSwrfSEBsdgQ+VOT77qagctW8SEkUvr9Creu/Juh21GRG7cEB6/YXV+T+c fIMw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a630413000000b00439d071c11fsi26441505pge.118.2022.10.22.01.06.31; Sat, 22 Oct 2022 01:06:46 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374316038901925?= X-GMAIL-MSGID: =?utf-8?q?1747374316038901925?= 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: