From patchwork Mon Oct 24 11:29:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9657 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp534405wru; Mon, 24 Oct 2022 09:11:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5lMjvYZz7D1SdJv+OVKpDJtrcruPS9Tdy5Vtp4H6CBBc1706JH+M2jq8WhMnzUamgNBxl6 X-Received: by 2002:a17:906:6a04:b0:78d:ee09:d956 with SMTP id qw4-20020a1709066a0400b0078dee09d956mr27473862ejc.698.1666627864098; Mon, 24 Oct 2022 09:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627864; cv=none; d=google.com; s=arc-20160816; b=OVQJ7LKPix0Vlj10vDpgxOuy0KqQ+wWvOwB97dGRYa+OjrtYlv92P0L1FFtb7i13pO 7jlp5cy6KI38s2HoYh06Id0TLBfaeVvFFOB9+nMJIsJwvVFmgMvHBJxHRfd3Ot34GvMd Bt7QZvasYV7MqxtK23flVZF/xZ2V54YixhJWxZYZsMbFA9yoOcHscd0fwxYZfr8OZrGt LTp+7rZwA9JFFfqWna01BKl1LMUNcbPQHWgFOdXytDAEOPM8fld4it92ye+hJ1nYCZGp X7QTrgdgVlGFWwgwjGBT2Z3QtS87GWJ/ORMme6isuHKgpr5uBQwnNdpoBwDLm28jBmZs a0QA== 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=PzavDlO4tANlfJrR5jdbIHfHj4I/VXAjaZiUOuuVSM8=; b=rgV+UhPUx6zYdFKuqn2/B1TVr+fv0aN1mbg1MTlrke9BbAIY4+HXol0wcQRnPKW1dE swQxBbmGo4ht3u14nCVo2jzCSByonX3qiAx1XiTDJvsdldCIIuwZomGvAFIuOwS1l0DG LQAzMWB+X4380q2p5ahbrQFL2mIflnyRgayDxHTlvZmJLhA75ZsOFSOTJWH2VaWQ8qGe Vbr6ZJlVqIk7CrGwVLMSUesLkbdrbmqwdQTZ5e6+yf5UJgh6zEssV2XFSunSaiIqeKOK v5KaKj9bFZVOsig4YA6wa5g6PC36yfzTzKs+j78bQqs45nwIIffRFwy3csk1vwBQghql Qwew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cMMFPa6u; 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 sb8-20020a1709076d8800b0078d2a84f2f8si142532ejc.645.2022.10.24.09.10.40; Mon, 24 Oct 2022 09:11:04 -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=cMMFPa6u; 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 S233534AbiJXQI4 (ORCPT + 99 others); Mon, 24 Oct 2022 12:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233544AbiJXQEs (ORCPT ); Mon, 24 Oct 2022 12:04:48 -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 9508DDFB9; Mon, 24 Oct 2022 07:57:27 -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 7A830B8166E; Mon, 24 Oct 2022 12:23:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE165C43470; Mon, 24 Oct 2022 12:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614195; bh=wXDesccS09BJtqEdamCmB4BpWfVCFtjY6A2myTfxo5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cMMFPa6u831/GmErN4cpxqGBNDPZnY98VXo5X6DvXST6lPr9PV1nLylQ4HYYYh52R oQ3dghqcpU/HKiQnuIS+M3rM/BQ4sYLHNq3CMevtg24A3OVEoGAiGjNacu+tZGl2ax SMS0j8uqzsA4wTJSBOcssS6aJY/vTFoQrR95tzSk= 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.10 168/390] ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe Date: Mon, 24 Oct 2022 13:29:25 +0200 Message-Id: <20221024113029.863602136@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747585979414525598?= X-GMAIL-MSGID: =?utf-8?q?1747585979414525598?= 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 2ed3fa67027d..b7f5e5391fdb 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -2083,9 +2083,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); @@ -2118,6 +2115,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: