Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1647693rwi; Mon, 10 Oct 2022 20:46:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4r0H+hSF5/qm51ZETgHO3WpJzjSRtjPOEJVT5C4Q+Q/uf2L9gLUEW7Voj+X5jBg/+xbs0Y X-Received: by 2002:a17:907:160d:b0:782:bc5d:162e with SMTP id hb13-20020a170907160d00b00782bc5d162emr17117185ejc.291.1665459975974; Mon, 10 Oct 2022 20:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665459975; cv=none; d=google.com; s=arc-20160816; b=MkV1HKYcmPW8C7STuIhgDrT4DgkRltXucMuh6AXSgOgKXB4tpxqemDp1GciVnw5Dhv AbamHutWZ0N9DpYJJC9fxG99b+2E26bwmjL4QGe4Gv0dclurkOZJtCzDUZFkvMqKLpEo ijAkY7rgFjxNlIb0LunT0iryejfO4X7ajnV2lxDFzLsOkeqmxeF2JFHAtbgNGzLVoY79 UYcAptBnLg23ooB8/cYCE+8pdelmCti/y/aDfiz99UGnmRrk60dE/k9/5OBVxqBoXOeR pTn/78x85rnCxXyL7odk7mQUmpzh7m0SXa2R7qBURjED8Dfgb9Pxkw9Bf8A9vlhaIn2N umnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=bxa0HrQkzuVZ51l2hFXD2hZgY4L8PLAznrhILi/Wcek=; b=Pnxc2osDEF9a0YtFbBh2kfKR54dmvXkWARFDJuCP5h1befDVOB8LwB4jPWBBqXS1Q0 +tsfcIY63h3kHN3uQb4IfL2cMDAFHAxXRPopyiMFsxS5hRxw32H0lwqw0EoBER5z3g9A 4ZPqtgaJaimrYt33Vyo52sYegbfpD/5XtfaCnunXoC3JwhUHhjIlAS9MfWBw1XeDOS2k vDDTfRW7eYrYf4Jp4lMDuuwvRzLKa/k1PADyrc6MxHi0JArzgpRn2Oadn6iOBSlOMpZS viQJUdCsMEvHmb35FNMdhzbnNJ2iBM9Kv6U0KhRZgIFoo8IQ3roXYloXnDlo/CujeHcw cyjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q/a0ZeDT"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs7-20020a1709072d0700b007707e4ce2ebsi13409060ejc.234.2022.10.10.20.45.50; Mon, 10 Oct 2022 20:46:15 -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=@kernel.org header.s=k20201202 header.b="q/a0ZeDT"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229808AbiJKDnx (ORCPT + 99 others); Mon, 10 Oct 2022 23:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbiJKDnX (ORCPT ); Mon, 10 Oct 2022 23:43:23 -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 B1D8F7C756; Mon, 10 Oct 2022 20:43:22 -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 6780CB811DC; Tue, 11 Oct 2022 03:43:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19207C433C1; Tue, 11 Oct 2022 03:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665459800; bh=bxa0HrQkzuVZ51l2hFXD2hZgY4L8PLAznrhILi/Wcek=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=q/a0ZeDTowmyvsW3FarZq4eYMZn+FFNL0MSsH0WVferqYNKHpdtfXUVve78UyP3G6 YimLNz/AWNX5FEyT/8epD3bcUNf8zPyshZGuxkGfBl4V8kob762C3UWYOGOOC7T2jB yAO3JeqoFUil0CeiFK4M9TJqTC219+FXz2w9V57eM8trnCcGjNNtz6RDdDUm//Q/JF d1NPP2Y12KQKcbm7ZaTbx7ZRWUye53MooKHDYcJJTR+IBN8AxRwCWATeNiCq0NUFFn F+oe5SkSa8DzMN0u0L2a9A/XRNHY8atI+TkRAyILbhQ8kyugULfZvSHHcVxvNX4maX p8XZrBmuuwlbQ== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221010-rpi-clk-fixes-again-v1-1-d87ba82ac404@cerno.tech> References: <20221010-rpi-clk-fixes-again-v1-0-d87ba82ac404@cerno.tech> <20221010-rpi-clk-fixes-again-v1-1-d87ba82ac404@cerno.tech> Subject: Re: [PATCH 1/2] clk: Update req_rate on __clk_recalc_rates() From: Stephen Boyd Cc: linux-clk@vger.kernel.org, Mark Brown , linux-kernel@vger.kernel.org, Marek Szyprowski , Maxime Ripard To: Maxime Ripard , Michael Turquette Date: Mon, 10 Oct 2022 20:43:18 -0700 User-Agent: alot/0.10 Message-Id: <20221011034320.19207C433C1@smtp.kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Quoting Maxime Ripard (2022-10-10 07:47:38) > Commit cb1b1dd96241 ("clk: Set req_rate on reparenting") introduced a > new function, clk_core_update_orphan_child_rates(), that updates the > req_rate field on reparenting. >=20 > It turns out that that function will interfere with the clock notifying > done by __clk_recalc_rates(). This ends up reporting the new rate in > both the old_rate and new_rate fields of struct clk_notifier_data. >=20 > Since clk_core_update_orphan_child_rates() is basically > __clk_recalc_rates() without the notifiers, and with the req_rate field > update, we can drop clk_core_update_orphan_child_rates() entirely, and > make __clk_recalc_rates() update req_rate. >=20 > However, __clk_recalc_rates() is being called in several code paths: > when retrieving a rate (most likely through clk_get_rate()), when changing > parents (through clk_set_rate() or clk_hw_reparent()), or when updating > the orphan status (through clk_core_reparent_orphans_nolock(), called at > registration). >=20 > Updating req_rate on reparenting or initialisation makes sense, but we > shouldn't do it on clk_get_rate(). Thus an extra flag has been added to > update or not req_rate depending on the context. >=20 > Fixes: cb1b1dd96241 ("clk: Set req_rate on reparenting") > Link: https://lore.kernel.org/linux-clk/0acc7217-762c-7c0d-45a0-55c384824= ce4@samsung.com/ > Link: https://lore.kernel.org/linux-clk/Y0QNSx+ZgqKSvPOC@sirena.org.uk/ > Reported-by: Marek Szyprowski > Reported-by: Mark Brown > Suggested-by: Stephen Boyd > Signed-off-by: Maxime Ripard > --- Applied to clk-next