From patchwork Sat Oct 22 07:23:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7692 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1109200wrr; Sat, 22 Oct 2022 01:47:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5168nc2sGFKr8kvQ95stVUiEsW3UczhPwDlWdx3T5TbTL0e0vp8zVLtwpAhLOpQoVpLp/g X-Received: by 2002:a17:907:808:b0:730:54cc:b597 with SMTP id wv8-20020a170907080800b0073054ccb597mr19035911ejb.434.1666428452615; Sat, 22 Oct 2022 01:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428452; cv=none; d=google.com; s=arc-20160816; b=UNBOKZYa8Sf9CqMdRgNSoPPObS/x5Q2MaZQMcFPNnfZMBjUgXuOWgxlIpFJOk7eCAQ VzZVkhL4UPbhFCBepNywpPIpsImnuBJgub8KkYEPhhvOdw+ytEE3ZHAi/YtbZytRxA1R uTUXj7QBmYk828ZjU7Jqrfu5PI0hdgBBfyq5s55kmulGuTluEyPiXksbciCM/Sw35S+r X3K2vyg2BWf+++cOlDZAa0mfXUmpUt9cyMnr8/3RphjlaOf4NbPicmvBl0Rt8reAn5hj h2L0IK5FGeTEuPVduT6kpYIKc2Bt558Wgmp0OYYZkph5mVu2BdTxw56bd2SahZeB4hzX Re5A== 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=mgctZY9hovJ7vSONoeOa0q44K80Wcy4UrpkPL70jZXo=; b=Xhl5+5r6D66xFmA5DRvWRKB098CQfnXBuifNdy/7fwlmBP6lQLYp3lsP8DirbYpa3u a+3mNJHBTGfhAvkHfQyf3JkSlb5MW+4g43irrnRCA7on64EAlQgQ0Ln+jPJWU+e1ZMDj Jlshw8eqygQdWmMak9OviJ2vZvPMeg7LMO/wj6vFhIDAUhnVaZjKvGpbgG8qCFdEL2Pv VPYuYzrjKWNnHTpLjOcNZeQQiZ02k/aOvdB66FTozftfdDcf9sQtlZqC9GyeY91bEzXd r1AtxrhbEmwKWqlH1leSS89g814j7iUYsfpWbVlDNDcy1d+3XkJHM1n+gbNbQ11oVbtF HIxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qOjb5HI0; 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 hc42-20020a17090716aa00b0079194297b1bsi16750152ejc.815.2022.10.22.01.47.08; Sat, 22 Oct 2022 01:47:32 -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=qOjb5HI0; 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 S234198AbiJVIqO (ORCPT + 99 others); Sat, 22 Oct 2022 04:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234915AbiJVIoB (ORCPT ); Sat, 22 Oct 2022 04:44:01 -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 08A1B2E96B0; Sat, 22 Oct 2022 01:07:41 -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 8D376B82E0C; Sat, 22 Oct 2022 07:49:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF8CAC433D6; Sat, 22 Oct 2022 07:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424977; bh=/DO/MJLKGlxxqHVavgVn6SazxotEdrvId6km3FQ0/N8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qOjb5HI0DtqH/aI+BLrpGRCM+sAqU33Og9kp923XiHH6FcHPziecHbBbS9eWU8IdJ LTjuMpe6qS9OBVCHZ94pjxdA3HgXa0MoWF9TDR36TYZvFR8r2t4hSSToy+IARNaSZR 1ygnIOBVlsqN2zgpp/A+bls/VBv2rL2KimK3HOdI= 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 346/717] ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe Date: Sat, 22 Oct 2022 09:23:45 +0200 Message-Id: <20221022072510.953833349@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?1747376881262409431?= X-GMAIL-MSGID: =?utf-8?q?1747376881262409431?= 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 ba11555796ad..45e0df13afb9 100644 --- a/sound/soc/codecs/mt6660.c +++ b/sound/soc/codecs/mt6660.c @@ -503,13 +503,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);