Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp468277imw; Wed, 13 Jul 2022 01:47:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqv0GS4WBcXNIf1QJLQ4V+jzNaKkJG37C7vhAiMsFTpfW2JQqHdAyMMVx/6SQgsv948l5e X-Received: by 2002:aa7:88c3:0:b0:52a:d6ee:eb5d with SMTP id k3-20020aa788c3000000b0052ad6eeeb5dmr2288398pff.63.1657702039465; Wed, 13 Jul 2022 01:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657702039; cv=none; d=google.com; s=arc-20160816; b=B1RWEGUmUazD2R7vuvOcJwp+V351IzqCSFzWd/ppdV1RzAoof3DR5BqMY5mMPNzsv5 5UCIjju+H+O/rL+qixj8fbOlszZk6Nr/eEoCw2I3Hti5Sr6GCHy1zjld1eMJ/BGtjw3G qJmSHgIlI+RxM+dU/zqHe+tP6P2xVWy1g/DgkytW+Gi2htB6of8uMeZT5axatyxlx+C6 XgIe0golbcfF3beWuST7ou0o6luwLeQhjTs9l2pNEBkhhrydM6dWPmb3uD92Gly89EaQ 1I8v35mZ1GlBz9S8FMr05BGLa0oZFh2v5ljgNZkcK4b882grRBAfl++qVUlx03QJf4ar Jusg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mHyeUQJdYIKoGxaGh8GhuqJCqLId0c4uymSzWL5ah+k=; b=n5/opur5H4Yhk9ONxTlj5RAaOws8gayZZKa+yrRiOyIZp+17v4AFO9j8C96qWmd5KP SpBf7ZHhLp39zok0O4S38RBi7Ni8ZQh/wcJR+A6PRnWxa1dKdfSBljJ+nE6oa5s868gL tsMyEuvy8GvSPzcYBDU5YYe1Z7soMivkBErD32uReXY0/Ecbc5A9ezce0RoUY/+qAwOz ckxNZ+lDVEQKvUtoGHErwlIldLiAcb7UEftq6bFT3qNV5Y7iEe6xoMeO9uCxB/MjDRl8 lLqwVpQdW4VNpGU4TpBAm9KqA3k8lVmNow0hDl4qV2DOD19ol7HM0RMkS8UxoByTqEFe yCHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DOrORcUI; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l2-20020a17090af8c200b001f0365517fesi1860413pjd.132.2022.07.13.01.47.07; Wed, 13 Jul 2022 01:47:19 -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=@chromium.org header.s=google header.b=DOrORcUI; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235559AbiGMIXw (ORCPT + 99 others); Wed, 13 Jul 2022 04:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235626AbiGMIXO (ORCPT ); Wed, 13 Jul 2022 04:23:14 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D969DFAE for ; Wed, 13 Jul 2022 01:21:21 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id v7so7553954pfb.0 for ; Wed, 13 Jul 2022 01:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mHyeUQJdYIKoGxaGh8GhuqJCqLId0c4uymSzWL5ah+k=; b=DOrORcUIpO3bIcq5mvbqgBwsoGpPNo8J5EQp4QRXgfAWhrd6BtDAXS/8u/JFee+tPn spKJNC7hu9wllOFfzrO6vyeRE6XQzZ6K6R0VoyPaa0Mi/Imd3X1QDgtvoidaPXLbCykb y4gAahfqffsMc54O+yutFBdUx6LgSi2ggp4e8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mHyeUQJdYIKoGxaGh8GhuqJCqLId0c4uymSzWL5ah+k=; b=2G2tnhE5p3YuZ8B3R5wjJxYMMTq7n7zWRhAW6Cjkg9BX3wpL84H/LomEn1WgO8udB7 UMAE4Oxhu+4V55pCx5iCZDdpzuyxSL9Z6+6VE+y97GJcJDnA7KfXWekYoSIMfRzJDEHY iL+AuveWwL7niI9TIwT/dMN8qVUzRBBykkZlTak5bbMuhXMmiEWvb7dLVTfipK2SsW2L 2iOUGrmsgP6S1ieIhhRsFZ7n6oIuRAO0DcvdEIM8U1aclmoUoV55lPoGmEMd3E+fMgCM c04zgvdQHu5+RAV2jn0T/C8sOd3xU+DgP2oN2Yzd+e3kE1Mmbq2c4vC+LWT1NuQ5cX/d v5Ew== X-Gm-Message-State: AJIora8aUwITtNsLRjVyPFZkmVz4OT5eEAGwERU2gL/9PlsZFH5w2xAO VvSvjFySqa1nipPixvnxG5eY3w== X-Received: by 2002:a62:ea18:0:b0:52a:c12b:9313 with SMTP id t24-20020a62ea18000000b0052ac12b9313mr2173174pfh.49.1657700480832; Wed, 13 Jul 2022 01:21:20 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:d1a9:ca7d:e86f:cf6f]) by smtp.gmail.com with ESMTPSA id k11-20020aa7972b000000b005281d926733sm8220461pfg.199.2022.07.13.01.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 01:21:20 -0700 (PDT) From: Chen-Yu Tsai To: Michael Turquette , Stephen Boyd Cc: Chen-Yu Tsai , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= Subject: [PATCH v2 2/2] clk: core: Fix runtime PM sequence in clk_core_unprepare() Date: Wed, 13 Jul 2022 16:21:11 +0800 Message-Id: <20220713082111.2233016-3-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.170.g444d1eabd0-goog In-Reply-To: <20220713082111.2233016-1-wenst@chromium.org> References: <20220713082111.2233016-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 In the original commit 9a34b45397e5 ("clk: Add support for runtime PM"), the commit message mentioned that pm_runtime_put_sync() would be done at the end of clk_core_unprepare(). This mirrors the operations in clk_core_prepare() in the opposite order. However, the actual code that was added wasn't in the order the commit message described. Move clk_pm_runtime_put() to the end of clk_core_unprepare() so that it is in the correct order. Fixes: 9a34b45397e5 ("clk: Add support for runtime PM") Signed-off-by: Chen-Yu Tsai --- drivers/clk/clk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 9b365cd6d14b..2e29a72c68e1 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -859,13 +859,12 @@ static void clk_core_unprepare(struct clk_core *core) if (core->ops->unprepare) core->ops->unprepare(core->hw); - clk_pm_runtime_put(core); - trace_clk_unprepare_complete(core); if (core->flags & CLK_OPS_PARENT_ENABLE) clk_core_disable_lock(core->parent); clk_core_unprepare(core->parent); + clk_pm_runtime_put(core); } static void clk_core_unprepare_lock(struct clk_core *core) -- 2.37.0.170.g444d1eabd0-goog