Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4482486rwb; Tue, 6 Sep 2022 08:08:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR42B8UGO6yWMwVo89SIWX9lEWX0RsiMYMaJ+M5zox1AzW26LCyWGDqTgNnAAl+Zu5UphdRa X-Received: by 2002:a17:902:76cb:b0:170:9f15:b9a1 with SMTP id j11-20020a17090276cb00b001709f15b9a1mr54513458plt.95.1662476884487; Tue, 06 Sep 2022 08:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476884; cv=none; d=google.com; s=arc-20160816; b=L9G3dXvGKurJPNK7m078RO2QivOzzVhVyNStJXe6tr4qe/cEr6DiCQi9Imvk5HgC/p QLtGtJx+ZT1IfJx/v297t1jgXO1WmEWVzIlNreM0r813yNvHxdAmHQz7DJEYrWN2T9aw N2RU5xRoQHZ0hazdVLtDXv1eFqDJom2ZPuIpOa6kjkbS5TN3eZgXpZz8UmLEKdqBhTK5 EioFMYRKjfEFL4tprTivRgjC38o62AAG6uP/kKOpTTeiJFwrUIZoEOAHePtFPyrDucUx L1Gl+/6rR6gzVS7OU4xPDg2g8Bwr77u1sgQiuFlK3KYL5DpgJy7bW7TRUGHBjV4pjtWc V3ig== 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=QC1zg3grPg4Z8ocAIoIvnh3uDVyRJ9uybXaJ8K/xrlk=; b=DYHce46++urpBFqsCqlYhwoZyb7dl661Fj44fUYR/Onwshlb3bMRCDKdzs5eEP+Pb6 /eeCbjoc5qtW0mnA68dShCco4Ui+DBopESC+dwcwgNKKt1J+tx21bRxX9yNxLJvRIqqp nTywUfHKEQ4JjQd++kIUvDK2eZ/A1hUtiCex5uwefqbPagASXGq1KS2J+X1HtmzHNwSp Vh1l22u0aCrZvaE/prTk8Z+fJ1Z31TuvHARuJq4vpKPUSoNJKhSSMIzRH0wPLgFRrd/E giZzNHb7SR2RHrkEJvb+F00YSAducBypb3Rpo6nZYFj544oFVPpQVF9TvlA1SkurnCxi kZwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FoQmupCq; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a17090301c200b00176e16b0c58si160124plh.21.2022.09.06.08.07.53; Tue, 06 Sep 2022 08:08:04 -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=FoQmupCq; 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 S241411AbiIFOMw (ORCPT + 99 others); Tue, 6 Sep 2022 10:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233286AbiIFOKm (ORCPT ); Tue, 6 Sep 2022 10:10:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C9D86FD5; Tue, 6 Sep 2022 06:47:30 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 16F2161545; Tue, 6 Sep 2022 13:45:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25770C433D7; Tue, 6 Sep 2022 13:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471934; bh=k6UwijUgcLuNRyqCBHFlNPlazW0F3BbLsT++0iS51VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FoQmupCqG1idzIuL65k6Xz3Rnw0kiXO0MVxCgPbJEzDvzfhDkUWD0a5qrT360bqSy xKtWGVRSGyuOSRGOzoDamhY2ax5sbxuryuH17O5H0OUGWaCxBkLWvFmcoDB8jUr7DQ sUmjsT5lqz7a3mmd93z3qaTcPVivNC6iH+uBPT5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , "=?UTF-8?q?N=C3=ADcolas=20F . =20R . =20A . =20Prado?=" , Stephen Boyd , Sasha Levin Subject: [PATCH 5.19 089/155] clk: core: Fix runtime PM sequence in clk_core_unprepare() Date: Tue, 6 Sep 2022 15:30:37 +0200 Message-Id: <20220906132833.203453064@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_HI,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 From: Chen-Yu Tsai [ Upstream commit 4b592061f7b3971c70e8b72fc42aaead47c24701 ] 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 Reviewed-by: NĂ­colas F. R. A. Prado Link: https://lore.kernel.org/r/20220822081424.1310926-3-wenst@chromium.org Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- 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 f00d4c1158d72..f246d66f8261f 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -840,10 +840,9 @@ 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); clk_core_unprepare(core->parent); + clk_pm_runtime_put(core); } static void clk_core_unprepare_lock(struct clk_core *core) -- 2.35.1