From patchwork Mon Oct 24 11:29:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp447771wru; Mon, 24 Oct 2022 06:16:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7aBywu6Q92sH0HVBuHUsG6JPMTc1BWh+mo2FpDVSk/ffAc+LUaqyoL0ZEbn8mtOnJ/EfVd X-Received: by 2002:aa7:d694:0:b0:461:7638:bde5 with SMTP id d20-20020aa7d694000000b004617638bde5mr11737900edr.105.1666617399922; Mon, 24 Oct 2022 06:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666617399; cv=none; d=google.com; s=arc-20160816; b=Y4iG2xkSZ34VPCW5vVcVcMHqIbF4r6vDeouQv26ZpGM6ZzBNlIPr6idhkfVJO2EA/I mN5m7SKV6sN3acr7sLe/aWHR/NGi6mtsp0ftuJLrCwEdoVkUsaXCrNcCdL3jEGofAakr heqde4EYsJWg46kWe2rFEPPb/gAx9XT66z6DWQairrn0ZtLoe640rKyTH+yDpqQ1FMY1 p3EAS9hwxKxf6930bHOUb4hAe5CB+iQd1uE4p0qZCn7aqWnzL0DDizjz/OxmBtgu3uAa cMOe31eYUQgiS0K+tLDRmudxqQdZI7OIZye36cSFpZxaXSIyPhwXXiya+nKoh45RQDKQ qiyw== 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=jovH2cplQjJK8QwMgXDY9Qx5eVy7RkQ6rlIuBVRRFvY=; b=VOLE44ispCS2lwTLQqPbDWLZKBVQvxHkV6CsU6IYnsWnejr/NqHk/Diyh96SUj2wRa ALg1tFXHu2mZEy45PkZZS3+uSVqM+luRLOv2jFlsgjDwKbuokw4t5U/FuffMeGrNZeWv uQmJFh7DHhcHOp399Gin3enKkNS/Y77DFfAhRW7CUPZ4Ow3aINpAQ4fC8GtxeH+3TGwx PFlivu+wVtNlpNN18NjzY+6UaLoE23OleBSohVI3+tQ09e5Or9RjFi8eiU4Qs2bOMznV Wmo5Xf92AKp+R182iZ8e099BJubB2LA8w1Tf7J7xJ8AbjMz24iaoSPjecL2utKYlTYuN jSMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JT3boooO; 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 sd41-20020a1709076e2900b0078d4962a32asi28230074ejc.961.2022.10.24.06.16.14; Mon, 24 Oct 2022 06:16:39 -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=JT3boooO; 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 S235813AbiJXNNS (ORCPT + 99 others); Mon, 24 Oct 2022 09:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235353AbiJXNKh (ORCPT ); Mon, 24 Oct 2022 09:10:37 -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 91680DA4; Mon, 24 Oct 2022 05:24:22 -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 5B0B06127C; Mon, 24 Oct 2022 12:23:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BDD4C433D6; Mon, 24 Oct 2022 12:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614197; bh=kVYnYhh9JRzFzLRUaA0/sGnwR/dH2+qLzEM1yWuH8Sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JT3boooOwkwb1wXCk6CsD57FTwdzSOBtCuO30bQ73+E6IAhv+S9C/gTB5ievD6Ql1 YjNsH8PSeaM+yQ3c7v3IkrSnKoHHK2hn/wmbwf3msjAe5UKkVNuXS1Zj4+S1UVnTZB woLhcNWNrj11VhZECsEezV+YRnqmnHik4vcAQelI= 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 169/390] ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe Date: Mon, 24 Oct 2022 13:29:26 +0200 Message-Id: <20221024113029.905120363@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?1747575006712427598?= X-GMAIL-MSGID: =?utf-8?q?1747575006712427598?= From: Zhang Qilong [ Upstream commit b73f11e895e140537e7f8c7251211ccd3ce0782b ] 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 mt6660_i2c_probe. Fixes:f289e55c6eeb4 ("ASoC: Add MediaTek MT6660 Speaker Amp Driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220928160116.125020-5-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/mt6660.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c index d1797003c83d..e18a58868273 100644 --- a/sound/soc/codecs/mt6660.c +++ b/sound/soc/codecs/mt6660.c @@ -504,13 +504,17 @@ static int mt6660_i2c_probe(struct i2c_client *client, dev_err(chip->dev, "read chip revision fail\n"); goto probe_fail; } - pm_runtime_set_active(chip->dev); - pm_runtime_enable(chip->dev); ret = devm_snd_soc_register_component(chip->dev, &mt6660_component_driver, &mt6660_codec_dai, 1); + if (!ret) { + pm_runtime_set_active(chip->dev); + pm_runtime_enable(chip->dev); + } + return ret; + probe_fail: _mt6660_chip_power_on(chip, 0); mutex_destroy(&chip->io_lock);