Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21062732ybl; Sun, 5 Jan 2020 19:04:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxlG69CWsXn1y9bWB4MOu1GL8maAHW70DgAuFDgiPXI0dbIJ/GdmDnIIR8du+aW5SJMY9fI X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr110176311otc.337.1578279843251; Sun, 05 Jan 2020 19:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578279843; cv=none; d=google.com; s=arc-20160816; b=ui4KfKTvy7j7mbi6GXmuVDkC6gkJmp8YIKkY6E0AjC7sg1Y3H3tNJH8bR/3lvCFjgP EVcDOJnGh/Q9BX+ZT6UMDfqOPE6Kld7vlYaWQSaRnCIjmGeNnGxOp1zBIqz283UMCNlo ooYdRKmp9vqRHsBWVchl+R1gKdCbU3Njs1s0mwTyX4wOKOTV8ArIeGf8LCHAMwYbkot8 KqmbEXdICI3ZQUQvJKjRfBdqGdM08I+BTKwZZP9CWO2xdCe3OVXpjcauTMnfr25KNgal LGdREKQxcsvxA3HkcCG+CWj4FDVIL4QI8/U+ekr4YU2k9m/CoK5ypYTAb294ksKTYtQF K2Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:user-agent:from:subject :to:cc:references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=MYyNyKkJLQGCOvxQ2OxJWLaTbUzCMB2sXV7HsZa1aUk=; b=TKja2Oxk71xH0+UMOfeOCB5tA1s4vCIlmGnW4UOdohc+Z3hB+2Kh/+0Vi/rJJShx+I kgdDMlAMXJ4VwpoEoGrY6xYUaXwrJ07MtlsCJ3WyWwaVes5DrVAQrT6wneLPuc/N3ICB yHwtdY3p01doWMqw4ar0qyEUGhUh/jX16tczuDq/zM8G2YfjYoBj5BbkFvd5e62ALJGq 6b9fWCF94qdzSX4HQef1iW4YZNXNpNRiPGoWUF+EyyNI1XbrfZ14pxkJboQ4SvcuWM+t cach/oI5gN6ZoqVBmiNtMu3/UME7rGUwGbgnzE8kJmBt64/hmb5BB1OfbRGUOcXPYOyM ZyPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B8jLcelH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si35298561otq.53.2020.01.05.19.03.51; Sun, 05 Jan 2020 19:04:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B8jLcelH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727377AbgAFDDM (ORCPT + 99 others); Sun, 5 Jan 2020 22:03:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:58022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727307AbgAFDDM (ORCPT ); Sun, 5 Jan 2020 22:03:12 -0500 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6538820801; Mon, 6 Jan 2020 03:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578279791; bh=CNeeKXcxdQM66JWLklaMOAzOty0uI/w8076uzZzgDRI=; h=In-Reply-To:References:Cc:To:Subject:From:Date:From; b=B8jLcelHLRRSOCy+vJWPw+k53NEYrT9FYA57S9bX/rSFrb1QnF7jiZzenQE97Bki8 bmLxQ9wbVrMV+s3MvgbJ7IelLc0T3WRD4sygIpTAo27zyJ0oW184daAwo9vXsqoCR7 UJnYZl57w2F4em23l0WDNz1ohcgOJFr4qSBL+IXY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20191226191224.3785282-3-martin.blumenstingl@googlemail.com> References: <20191226191224.3785282-1-martin.blumenstingl@googlemail.com> <20191226191224.3785282-3-martin.blumenstingl@googlemail.com> Cc: narmstrong@baylibre.com, mturquette@baylibre.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl To: Martin Blumenstingl , jbrunet@baylibre.com, linux-amlogic@lists.infradead.org Subject: Re: [PATCH v2 2/2] clk: clarify that clk_set_rate() does updates from top to bottom From: Stephen Boyd User-Agent: alot/0.8.1 Date: Sun, 05 Jan 2020 19:03:10 -0800 Message-Id: <20200106030311.6538820801@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Martin Blumenstingl (2019-12-26 11:12:24) > clk_set_rate() currently starts updating the rate for a clock at the > top-most affected clock and then walks down the tree to update the > bottom-most affected clock last. > This behavior is important for protected clocks where we can switch > between multiple parents to achieve the same output. >=20 > An example for this is the mali clock tree on Amlogic SoCs: > mali_0_mux (must not change when enabled) > mali_0_div (must not change when enabled) > mali_0 (gate) > mali_1_mux (must not change when enabled) > mali_1_div (must not change when enabled) > mali_1 (gate) > The final output can either use mali_0_gate or mali_1. To change the > final output we must switch to the "inactive" tree. Assuming mali_0 is > active, then we need to prepare mali_1 with the new desired rate and > finally switch the output to the mali_1 tree. This process will then > protect the mali_1 tree and at the same time unprotect the mali_0 tree. > The next call to clk_set_rate() will then switch from the mali_1 tree > back to mali_0. >=20 > Signed-off-by: Martin Blumenstingl > --- Acked-by: Stephen Boyd