Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4452097rwb; Tue, 6 Sep 2022 07:44:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xhCd+moVM+KNri01Ez/ui3WXGVhjKhlfycZZk2afWnDSIgaFU/UKeQEKMZy73jWI2ncoz X-Received: by 2002:a17:903:2348:b0:175:18d6:4a83 with SMTP id c8-20020a170903234800b0017518d64a83mr36794340plh.70.1662475488399; Tue, 06 Sep 2022 07:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662475488; cv=none; d=google.com; s=arc-20160816; b=aphimXr0fEE9Cf0BEVXpv8A26DLvl2Kg4i9KL/8zenr/bWVbh6meuAwinsTKhAn8rG JvNdgKI+ujrEg0s+SnHvY/lsVzNPhyUwTWfjiUdFHQqWEWz+rv1oXVs2KE7il8zMEyOY B6USD//N9ipi6J56jMqxRGRRLmPhfDfWxGrY4xw/GsglqEqksQMcD8m8N+m4Fqt66t8m TvZ1FcL2zEaS2iZL2VJrB7vBUM8iAQFhy/VzkJicWPTuSTZNSqE97AaGseCvHI//jbH5 NaDHtZhM5d92nM0c8T2aRfLL90O0x2st7Y8z/ClxMJWP3mbcBn2w7w2XAWfluIAtRtXq mfxQ== 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=o4w9OnCMYddebBWG3T39nAGaFQ82MYohJLp6oSQ9ZC0=; b=OrlrNCsjJGPrTEHPHkYFwb2xHx721b9xQoYqUDcE93jfALAPGtuPdLETP8faMpJ/w5 /HGA9g1uyVI3YlOPVSjv6QRmVU9e2R37VtF7HahlQQh9DXm/cBL+3z3lN0DIP7g6fbPi ppEATtdFByeg6Jdatlspu7D3P1dPXLfJvmSjn35CxMaf6Rp6Gn14qLjiU4wrO5KLgRdy 96IQtg00pDv2ilQmQUaWFTbrI3gzfbdO0uHoxpAIAyEASwylQt4ZaTkpduR4HrKnY1YR qllr4y4vXNrGabhvKhiuBVqgAmOM0Vfkeb15LY933JiEO3iuWD7cY6TvrcM1CdE++82B 7Amg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yHkux88Z; 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 i16-20020a635850000000b0041bd3212b81si10153495pgm.254.2022.09.06.07.44.35; Tue, 06 Sep 2022 07:44:48 -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=yHkux88Z; 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 S240708AbiIFNfn (ORCPT + 99 others); Tue, 6 Sep 2022 09:35:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240668AbiIFNfC (ORCPT ); Tue, 6 Sep 2022 09:35:02 -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 9322576472; Tue, 6 Sep 2022 06:33:36 -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 BEDB9B81632; Tue, 6 Sep 2022 13:33:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20CECC433C1; Tue, 6 Sep 2022 13:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471212; bh=MtB4kKNXg3dgWQL89KhUjvedI2cYF2X+0wTaXWCOJbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yHkux88ZinCfFpxe40U/p1UkkSrWDo5MjETXG2i4fAolYBI9SFveqLgMbHz7w8YEl BCt8JjcL24HVkpqrmLUEu8Be8adzFTEC4gHNU/IGQCntTEaqWyk+/SCmRCdFOmcw1o REpTQkufbV+FlUdW6kGzQEbROJddCxlH79UHo1zE= 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.10 36/80] clk: core: Fix runtime PM sequence in clk_core_unprepare() Date: Tue, 6 Sep 2022 15:30:33 +0200 Message-Id: <20220906132818.490989701@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132816.936069583@linuxfoundation.org> References: <20220906132816.936069583@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 2e56cc0a3bce6..b355d3d40f63a 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -846,10 +846,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