From patchwork Sat Oct 22 07:23:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096921wrr; Sat, 22 Oct 2022 01:06:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6j/PnZLyx9IcQMtmqtp6dAXKO3f7NEHg7f/LqR7/lkBsFkiayAz3SdAl8rKOVmQcnuHDYx X-Received: by 2002:a17:90b:3a86:b0:20d:616f:4bb6 with SMTP id om6-20020a17090b3a8600b0020d616f4bb6mr63230884pjb.238.1666425982750; Sat, 22 Oct 2022 01:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425982; cv=none; d=google.com; s=arc-20160816; b=Oq2zKzB5HPO8IJiuEG6Da5X4I8z5fj97SqBhZVA6RFpNSw5+HO7Rrgz3NyAjIMWL9M 3ksXZuJj7khmUJbobRzzJhlGJ+c3K840d9zPGIeL0InLZekqr5VxAUN7hkVThYavu8cu Y2aQ186lzH0MZnRMbsuw+9qGH+3bVME2LX03X1Xj+4jQahaaogUxcgUSRFo/PANhP51N QUeW+W7a+ODwFFwTMytvciNz2rsVMcVeVbGS/eGJKwZ1SgXIC0F19zQ8ww/l3zZWRIFw atVtIUveSjeLNM3CfJn3uFhjXBT62wTwBYNMwN7Sz8829McB21XlaXnsDwdfYcFts5Us X9VQ== 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=twiZxK3+TxEjl5y40j1QWKQpH3pJIVkRwesLMdO4XrI=; b=kkbBEh3YRyRzrZLeI2SOA0eNh0JZOYnQ65ejD2F7EO7vv1fMW4P9edsB84Qg3d542P My4dfkVanVgxrSmQzsX0HNwGKJ1hcsX2zkRp5zlJapapQAXr6RdWzo1dHKBLVnXmm0we 1aPO0rkV1gT/HeU5G5o1iraGnRE/d7WQO3OiZJ8oqnbw/MBJACs5H/cWihNzt04BGYxn nQxygvVQlsNaFFZo+M1KS7b3lW68Tju6/kZBHZ0OfsqDXysLZDAqo8ardNQBTP7OgNOQ +CacPA4c9TAX8imRf4UY/cVmKQRxFt6/eINLZ0iZytmgAh+3STC6IHBJsri2IFAN+dGX 3uhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y3CPSAri; 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 s6-20020a17090302c600b0017b2fe7de33si28647827plk.10.2022.10.22.01.06.08; Sat, 22 Oct 2022 01:06:22 -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=y3CPSAri; 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 S232724AbiJVIFl (ORCPT + 99 others); Sat, 22 Oct 2022 04:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbiJVH7S (ORCPT ); Sat, 22 Oct 2022 03:59:18 -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 87AFB481D5; Sat, 22 Oct 2022 00:49:37 -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 D06D6B82E11; Sat, 22 Oct 2022 07:49:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C28FC433C1; Sat, 22 Oct 2022 07:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424974; bh=aXOJd5qAGKmElHBXtL7r7fI/AuxnCb5+iFF5hnrwRjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3CPSAriFzOL1P8Xq0e/SMgxGy2y0Zas1IMB1/HPZ3ucytp/2JOgSCxwYQG8k5uJC SiYMWqW+gdWCzyDr8yl8xSOrn7JDqkWESS179JTv5+/LQImiTm50b5GzO/XRB1lSKV OcitlvZ3PQDlSrYFW14+uYNpiMV/cJDSSRO5ewQA= 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 345/717] ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe Date: Sat, 22 Oct 2022 09:23:44 +0200 Message-Id: <20221022072510.886620660@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?1747374291210109942?= X-GMAIL-MSGID: =?utf-8?q?1747374291210109942?= 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 b034df47a5ef..e92daeba11f2 100644 --- a/sound/soc/codecs/wm5102.c +++ b/sound/soc/codecs/wm5102.c @@ -2100,9 +2100,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); @@ -2135,6 +2132,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: