From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43B0020E035; Fri, 10 Jan 2025 15:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736523495; cv=none; b=ajPsCcRhOzeMDuCnoOKhB/cpASpVJKVtZE4MulQ1uALFaYxBVUciCaqA2r4oRUiPvV6wMCVX28ZYVZHKcUHQDs+b2yyibv7FOCgn5OdIqADkvUXH4yNiiOAx197/BokLFJsAyT/Ywn5a0tKNFPqGayzsz7VDCtsL/DFa+IOIYlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736523495; c=relaxed/simple; bh=g3zvNqD36Ly2VZ9tkKT3O7sEgisvEdurJQ6LVf2r8P8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=TnoS7pY8rh0zRPsnq92HEU8jwvA304Sy0bvCf74ZRmSj83Gd/9+nkj25up9rOq537VQj4HciTnF8RIWU2iPm1oqMkZrDszNAy1llBujOt0Ihf3Qdj4noEM2rsKQmpz8VpQ/XEOKGfQJ1odHfCzCD3e+pQfRlQi4HbkefrZjZOQU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=il0RCBZt; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="il0RCBZt" Received: by mail.gandi.net (Postfix) with ESMTPSA id AF21660005; Fri, 10 Jan 2025 15:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1736523491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g3zvNqD36Ly2VZ9tkKT3O7sEgisvEdurJQ6LVf2r8P8=; b=il0RCBZtzS8MM8CP4vxI7ia+4m8a8on3dAjyRA714QxWf1h7Cemz9TvNjcwrsEsXeM+0fo 2GlfKRiqgDw0g6LFkFFsene205lRx/b1e2AnEsNq8nmkc5vA7INqPqwhgo14eNUtnvnKc2 wBgsGEKC09Aymfm+L7iAn3Rj8OIMS6X7ImxVv4TMlEIK3DZoFbsGvAf+7ftNkoQ50zmUuJ f7Syqi7PfIWaV5uT85CZja6zaC+3yMaGQdMyIPtpmBMJSKdHur+CpJI5L1KkOv95v0/U90 10O/L9AgIj/PgbDAGZSZQkr6o9KeWd2T0Nd14/0S/BMnDJHEn1AIZSuN+MTneQ== From: Miquel Raynal To: Stephen Boyd Cc: Maxime Ripard , Abel Vesa , Peng Fan , Michael Turquette , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Ying Liu , Marek Vasut , Laurent Pinchart , linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Abel Vesa , Herve Codina , Luca Ceresoli , Thomas Petazzoni , Ian Ray Subject: Re: [PATCH 4/5] clk: Add flag to prevent frequency changes when walking subtrees In-Reply-To: (Stephen Boyd's message of "Mon, 30 Dec 2024 17:22:56 -0800") References: <20241121-ge-ian-debug-imx8-clk-tree-v1-0-0f1b722588fe@bootlin.com> <20241121-ge-ian-debug-imx8-clk-tree-v1-4-0f1b722588fe@bootlin.com> <20241217-brown-wapiti-of-promotion-e3bec6@houat> <87bjx2tf3y.fsf@bootlin.com> User-Agent: mu4e 1.12.7; emacs 29.4 Date: Fri, 10 Jan 2025 16:38:09 +0100 Message-ID: <87msfy8yse.fsf@bootlin.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi Stephen, >> The idea is: if the flag is set, instead of accepting the new upstream >> rate and recalculate the downstream rate based on a previously set >> divider value, we change our divider value to match the same frequency >> as before. But if we cannot, then we just keep the old way. >>=20 > > The exclusive rate code could support this if it doesn't already do so. > If you call clk_set_rate_exclusive(child, ) followed by > clk_set_rate(parent, ) the core code should try to keep the > child at the constant rate, or fail the clk_set_rate() call on the > parent. It should be possible to confirm this with some KUnit tests for > clk_set_rate_exclusive(). Similarly, if another child, child_B, of the > parent changes the parent rate, we should speculate the new rate of the > child_A that's protected and fail if we can't maintain the rate. We need > to start generating a list of clks that we operate a rate change on to > support this though, because right now we rely on the stack to track the > clks that we change the rate of. > > Initially we thought that we could do this with clk notifiers. That may > work here, but I suspect it will be clunky to get working because clk > notifiers operate on struct clk. I see, thanks a lot for the feedback, I'll have a look. Thanks, Miqu=C3=A8l