Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4240044imw; Tue, 12 Jul 2022 04:41:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sXXyAmRDVsVc1AAUFXvtJ/eeZrx4jWcSza0FyqalQyjzIzosQLQMl7jRDijOb6Q/7JQrFi X-Received: by 2002:a63:fb01:0:b0:419:699f:a0bb with SMTP id o1-20020a63fb01000000b00419699fa0bbmr1607227pgh.4.1657626089534; Tue, 12 Jul 2022 04:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657626089; cv=none; d=google.com; s=arc-20160816; b=WBAFJnGGqLAMZjg/5bTk29Rue+ZK9J2EnPQj9jszZz0bIxtWAAkH5OwELltUdAQ7rS C9OaKDuy+GT2ILr1VRoDguNAvdvxgtzVz0lqP9mY/mbucMN9CjgGWljEawDgQPKFF1R1 9dV/yc/sCUMUVI0prmYZsRa7IymFjGbjPtuWc5GA8LEn0Bkpyf2ujERwkoeZfT+kyZgl 98kIAPadRIo9fzaxh2v7gd1Q/Ui6JdYk/IZU5V1iHJMlnZ+7m4HEBR9sPT8rTiHseMiK 06+ortTwlWF0qmpJi51Kn9Junh9j7nUy33STls5xXKBAWX8eDrP/NmHIhfm5UKBeFeWb +AsA== 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=WHpICsyByAQH93fjocLsnPpN777QDLGLHmPw1NuqSiI=; b=jCAwsJQoQL7roCBhqcaqnqpO+o0EmVqDfIty84fnFU3EoVR35+Et8Zu8v2GlqVdnYr 6Lze9QuYHfjNMifLMneUKMrM8ofFquhD4dYbtEPIAbl9eZABPQcv/NiAPVtZvGDLh801 RCz8J3UsRyfPWTWfnhltcTSIMiGZCfXG3pJCxAk30QStrBEQcgBUtmB9yFpImMFB1dfs fAxcqNF6+g2Gke+p9QaFauL7FGpAVnSM/J7J71TfafbbAMK6/zeN2h+glRX94NxqdQ+Q gdqVEkL7cah9FENWaAfd0nIWa+bVxLcb9BVdIwMrtiuG0lboIWJkWNSdcRKZMPCZjQE1 nGmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HiWiJHoI; 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 n123-20020a632781000000b00412a68c45e5si14888891pgn.316.2022.07.12.04.41.17; Tue, 12 Jul 2022 04:41:29 -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=HiWiJHoI; 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 S230502AbiGLLeU (ORCPT + 99 others); Tue, 12 Jul 2022 07:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbiGLLeN (ORCPT ); Tue, 12 Jul 2022 07:34:13 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9C0AB7C9 for ; Tue, 12 Jul 2022 04:34:13 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id 89-20020a17090a09e200b001ef7638e536so11101304pjo.3 for ; Tue, 12 Jul 2022 04:34:13 -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=WHpICsyByAQH93fjocLsnPpN777QDLGLHmPw1NuqSiI=; b=HiWiJHoIMTwU/6yayll4vWwEVSoyDhb3Rr+kWxAHJ6wVtixr58GSQ8/vOUuXyZhSBH 9UHzutDKljJGdU7Tav0qNG9aObjZYZF2PYLFh018b7wUnh1YSRW6tF+xpzHcOTxrg869 qMmLVmsVV2zjXqecmyRCvbS0iZRMn1T6s9b2Y= 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=WHpICsyByAQH93fjocLsnPpN777QDLGLHmPw1NuqSiI=; b=uqkgFDVJnay0vRdU4My8DlO3TvIVj0qsCVMz8lmkIMPdJVrpcXFYVtY64nDauzVvPO VxboIpIb60p5gFjxW6z/XVS4thry5xHaX9OxQl7Zomqr4F7JJfsMywln2GCn+0okScHN PORjdgP8ufg2t9P37zhkn65LX/xl1dvpkRkzl3Cd4nBp/CrkBqh0+5Z8tYR0PSc+oUHB EkjfsChle+XjantaAp97LTbB0jV6ifakehTv83Ptr0CtY0uDfiitUYncFFnoTWraJm7+ s14ojRX/tF9CDE9aK61dLf98GLYuaundMkUaNlU5fSwnvXvkmFYisY2Bd42KS50mifAt pheQ== X-Gm-Message-State: AJIora83SSYsIbRupt+1oR2wueSghwoQAzlSd1eQ4C6Xs6L69Fh2mRoO 2YMk8PeCxnp5DOPTkjp2CQ4sEA== X-Received: by 2002:a17:90a:4294:b0:1ee:f3f2:9cd0 with SMTP id p20-20020a17090a429400b001eef3f29cd0mr3812180pjg.79.1657625652797; Tue, 12 Jul 2022 04:34:12 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:d1a9:ca7d:e86f:cf6f]) by smtp.gmail.com with ESMTPSA id 80-20020a621653000000b0052890d61628sm6537967pfw.60.2022.07.12.04.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 04:34:12 -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 2/2] clk: core: Fix runtime PM sequence in clk_core_unprepare() Date: Tue, 12 Jul 2022 19:34:02 +0800 Message-Id: <20220712113402.871838-3-wenst@chromium.org> X-Mailer: git-send-email 2.37.0.144.g8ac04bfd2-goog In-Reply-To: <20220712113402.871838-1-wenst@chromium.org> References: <20220712113402.871838-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 b3de636eec84..87684daadedd 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -855,13 +855,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(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.144.g8ac04bfd2-goog