Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3182C433FE for ; Sun, 6 Nov 2022 17:06:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fdmXL7bpdeULTeDIluvooBAEn965XgIrk5KI9RQsT6s=; b=McfxmY3xaaHCnnCmvL+/qbGgRQ GzjMarqURRspu0oUohEZjSGXzhOHSPM124rT/3JZkzNTcuIbjIwtJYuhxfXHMFMvsx3fbnhfk2iww 3+upQNVZn8u6w16ujPWFBWLsHb8CevRHnn1YLUurLssflFfYLG3jmJEU226R2Moj4zIAS/iGVXTFl ZHN2qrKq7BeRH0FxDWCnB0v9c3pCh8bqurgUETo/Jvo6Ef5lmyvTIuZGV3E/UIekWM7OMa7zVxd+B fOVSNqPSuYWd8cT2Ix2vUvVvCeuhXV+zzv+uszlLD6vEMBfS01n828vADiqpRVSKJ6/3ZKkM0R0Pa NF8MBDBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1orj6F-008x2I-M7; Sun, 06 Nov 2022 17:06:23 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orj62-008wuf-0X; Sun, 06 Nov 2022 17:06:11 +0000 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 70D54B80C71; Sun, 6 Nov 2022 17:06:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CB8EC433D6; Sun, 6 Nov 2022 17:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667754367; bh=6xSy77Aw6z0fpoypOrp9uPxk6VC+ci3iUBhretptsqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KCBpoIQpuuZ6roWHzRXTIZTm2c2nqNrVbAEh76hj4mJtpSwswmqnrjHWZdl2t6K/O NJYNthEfhbJyx6Ws2oPnzn5Onew961h9gz3+9zBNGjxOT69lNuIfoVyrs5MVTWfC7K wUllWVdaOxpSHWXMSXxBMIBXiX8+nY3matK6U/EriVVfnHb2OpT0EidJWDCxdi7MNE wqvHquGrONJvxQR2EmP9sju/lGZyJiU32AsYq/JlfvUSMXzKzwJNG4AzCwu/PwuwLm gJaOVr+QlojbYHMR2aX6gLgiry+GVFYvd5IaKJfGEvdPYPHOdj7gpt0bD0PYcFkdw3 oD8w9AJjtwapQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zhang Qilong , AngeloGioacchino Del Regno , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, chi.minghao@zte.com.cn, ckeepax@opensource.cirrus.com, steve@sk2.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 04/16] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Date: Sun, 6 Nov 2022 12:05:41 -0500 Message-Id: <20221106170555.1580584-4-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221106170555.1580584-1-sashal@kernel.org> References: <20221106170555.1580584-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221106_090610_223544_9DC22F0D X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Zhang Qilong [ Upstream commit c4ab29b0f3a6f1e167c5a627f7cd036c1d2b7d65 ] It would be better to keep the pm_runtime enables before the IRQ and component stuff. Both of those could start triggering PM runtime events. Signed-off-by: Zhang Qilong Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221008140522.134912-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/mt6660.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c index e18a58868273..3cee2ea4b85d 100644 --- a/sound/soc/codecs/mt6660.c +++ b/sound/soc/codecs/mt6660.c @@ -504,14 +504,14 @@ 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); - } + if (ret) + pm_runtime_disable(chip->dev); return ret; -- 2.35.1