From patchwork Mon Oct 24 11:29:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642421wru; Mon, 24 Oct 2022 13:38:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ibqFu7U/PnPd3+hetRjc2qvV2OFJ7q1Jvw5UAifydXrJRV311Bk8AUsVrTR4VBoVWUzkm X-Received: by 2002:a17:903:1245:b0:178:9234:3768 with SMTP id u5-20020a170903124500b0017892343768mr35447541plh.146.1666643904997; Mon, 24 Oct 2022 13:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643904; cv=none; d=google.com; s=arc-20160816; b=WDGueshL8WpI1/ey4fP2DzKLBodfueSYtOkDg6uovqg4+kjBGhpCbLBwezcKd3UQQ3 3A8gz/T05lBl5Ke13sWonZYd8blZOMNbfKvSxEdBvAbEu96chsMU/F+FWa4sUZ7Bm7hp 3NhZ81Xj6a0AMOxYd61OCF4+peI57fhUU4I8PvrxAXi/KD0qRTAvfrd3TvZ5o3I6UGUH Ql6WdEzmHHBAQDsRN3bkMKZpeq+u2KFMlFY2x8sAka9QAr99x98En1Vqj90korPv0j51 Dtc1WdHBZWnHubsOGNDPjMaRVUyGWIW7Knt8EDdiyatKCiEdsd5V8Pe0Jlqj4XuH56qV Drag== 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=4eIONYfxAqgCTGYhMrXldkshzdP+UQjNAmI6UVnKk2Q=; b=CXc7ZTNLfNwZJKJvaRCaZqi/ceVjsJ72wKvBQuZd1R/92avxm6XmUVtY2on2utWRFd V8IBYro59Way3ndNvChcOvVGcEZv0X1ImwbuXjb8MvqkdQNbrbrib6nbcMx707C5bDVu EaUmk+gqOCaQeUiRvI0Y7n3wFRRDkKDdqMNR9alNbGnbaU9zqzWBvMyhZtowSOzIP1yt q329p9+U9ZAQ+IOpBeWOCFmsXR+wdsieMdCC1qqURsPqqnVzl9jJ5RFoQ6SerSpBixn0 /ZIPkvcmMQboLxH+tY0hwLZZUbrmxCGHbJKLXrHyRkMTo3/7HzcZrfIbIyxskvmgGOsj OzQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g+pCMv9I; 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 j8-20020a170902690800b0017f57787a52si521442plk.194.2022.10.24.13.38.12; Mon, 24 Oct 2022 13:38:24 -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=g+pCMv9I; 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 S234173AbiJXUgv (ORCPT + 99 others); Mon, 24 Oct 2022 16:36:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233230AbiJXUgR (ORCPT ); Mon, 24 Oct 2022 16:36:17 -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 055BA1B1572; Mon, 24 Oct 2022 11:48:08 -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 DE0A9B819AB; Mon, 24 Oct 2022 12:43:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B25CC433D6; Mon, 24 Oct 2022 12:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615418; bh=ZrkEGWId4ZhNj0J5PD/RwxU0pxiFWSFrDgAXTQr1kA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g+pCMv9I9OGokHTpOCpAirNiBYNwS8UhuUfkXUT7RCM/g9gv6OFOEODHCurKaTyGe 6sdjHWG2P8CUqR/qQMV00q4uG72mm+hRz3nn0CGpYEF0NQESTAyWW9DpkKHgD5T4FO dF2JZWkuvS6IeGahd/anDBm/WFVRzrQlOBXAG5g8= 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.15 244/530] ASoC: mt6660: Fix PM disable depth imbalance in mt6660_i2c_probe Date: Mon, 24 Oct 2022 13:29:48 +0200 Message-Id: <20221024113056.156167635@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747602799018119592?= X-GMAIL-MSGID: =?utf-8?q?1747602799018119592?= 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 358c500377df..a0a3fd60e93a 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);