From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 983A4C77B7C for ; Fri, 5 May 2023 18:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QVU76JGkQZFtlxGIie6pO5Qy/jtjBHTb4mzuVCLnTnk=; b=HOfbKqQFgeLRhN 1Tf63VUjEaUWFBomDEnadJom9sersQ3DqNuCoWzLdj20Uv6IV3tjGxswMtEWW5VS7cOi4J2oeKdWx ItE4sgAL7KAp5CuQ4VPNKZvYi2BCWwxl9i6LnRdGuN+9xE1CoVXYqZBIkn8sc8qZCX2zIvY6CT+Dr yMtJeTlYqVbrKVEAu2+nZBuv8alosZkqkKVWG7D4kBGEGnO8Wd5icIrZhxTnQqrNUG3/wA+pPLf+o NYbSP+wGZGBmCbXts7aZIAwWf/NNE9RhIAuMj47/DQ5DO49hdN76uySX6NnFVc9r1tRMY8fDcjZmc 90/oMNjscobls1cesTYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pv0Rf-00BXlS-3A; Fri, 05 May 2023 18:46:19 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pv0Rd-00BXk7-1c for linux-arm-kernel@lists.infradead.org; Fri, 05 May 2023 18:46:18 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-50bc22805d3so3294848a12.1 for ; Fri, 05 May 2023 11:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683312374; x=1685904374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OL+1qoziu9QsKZaGAp4w2GCjNWWHE42lzOyIZ2hEKeo=; b=YIfG+3VlUPqHPZoZ5pe5sVJDjfpIkRHTnLS9nbyd28/0urK0wSthkXftlxmEmMybUw 65HtGg0JDmHhaw1+rUv1YeSAFT3N6jjdcOnPH7WfR3iSRfegj+Pf5a++8HD61opYOlln v1cUkRky/kb8cx92/+9TEMUZXbi4jXNin3VDfLCnNvi+uFdJ5+oY3nrGjqYs2PKWiZxJ +hEIy4NkaIHeeRnwBXezTnWMfK7vFykXvuDeBw6K+h9dza2sLHiCYYlEz4/BFALZKMFf A+1DasHNTCiKNRqojiyfMMlYvKD5v6xHawDrk9aZffDQpMsmaBgmU5Ivq7oKMghFiqCm kOiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683312374; x=1685904374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OL+1qoziu9QsKZaGAp4w2GCjNWWHE42lzOyIZ2hEKeo=; b=NBiHDK7x2EFRPyRuTKFMw37FAJnaL72R72LUB0T/cTDm65GFtUM017f2ZNWFqv0AQj luXHtFRDztiMiBce8EB89oQOqWHf9d/tgE2IWxZdDz/9wqtHgmZCEnCUJJK6qp5Yzfa+ 26iAOGQRN+2Gi7gckuytqzESKqw7pthe+kzcrbS5FUfmrHc4pSjRe7JDCC2fvWjL4LXM QsedaM6oMWdw9+PxPRzC9Rose6zwZZGHUsh+aANNGoMlMNSk2Vx6cqwCJrFzkqNl2Jzg W7gAkMWm19mfKyVcbVF7lgfdQ191Y/wpi0S1bM/6TNmmWgaGy3knSZIKwwatJ/a3KWnE eXYw== X-Gm-Message-State: AC+VfDw0pmBUTkuTl5Bk1+8FVgLVWaDcq28Jjm7jntKacM5T7PWSJq4Q m3FhL+FRh+ntS7jdpL2N560= X-Google-Smtp-Source: ACHHUZ5NZnESKFbkWrc+8ONER0zwRZSahRZS7mWNfc1zuF8NuHoqqlR4Oa8H1LKUwXFmtMxyRLiyAQ== X-Received: by 2002:aa7:df8e:0:b0:50b:c58a:a7ae with SMTP id b14-20020aa7df8e000000b0050bc58aa7aemr2336540edy.4.1683312374077; Fri, 05 May 2023 11:46:14 -0700 (PDT) Received: from jernej-laptop.localnet (82-149-1-233.dynamic.telemach.net. [82.149.1.233]) by smtp.gmail.com with ESMTPSA id u3-20020aa7d883000000b00504ecc4fa96sm3163911edq.95.2023.05.05.11.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 11:46:13 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-clk@vger.kernel.org, Maxime Ripard , Alessandro Zummo , Alexandre Belloni , Chen-Yu Tsai , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v4 45/68] rtc: sun6i: Add a determine_rate hook Date: Fri, 05 May 2023 20:46:12 +0200 Message-ID: <1852119.tdWV9SEqCh@jernej-laptop> In-Reply-To: <20221018-clk-range-checks-fixes-v4-45-971d5077e7d2@cerno.tech> References: <20221018-clk-range-checks-fixes-v4-0-971d5077e7d2@cerno.tech> <20221018-clk-range-checks-fixes-v4-45-971d5077e7d2@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230505_114617_541335_144FB245 X-CRM114-Status: GOOD ( 29.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dne petek, 05. maj 2023 ob 13:25:47 CEST je Maxime Ripard napisal(a): > The Allwinner sun6i RTC clock implements a mux with a set_parent hook, > but doesn't provide a determine_rate implementation. > > This is a bit odd, since set_parent() is there to, as its name implies, > change the parent of a clock. However, the most likely candidates to > trigger that parent change are either the assigned-clock-parents device > tree property or a call to clk_set_rate(), with determine_rate() > figuring out which parent is the best suited for a given rate. > > The other trigger would be a call to clk_set_parent(), but it's far less > used, and it doesn't look like there's any obvious user for that clock. > > Similarly, it doesn't look like the device tree using that clock driver > uses any of the assigned-clock properties on that clock. > > So, the set_parent hook is effectively unused, possibly because of an > oversight. However, it could also be an explicit decision by the > original author to avoid any reparenting but through an explicit call to > clk_set_parent(). > > The latter case would be equivalent to setting the determine_rate > implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no > determine_rate implementation is provided, clk_round_rate() (through > clk_core_round_rate_nolock()) will call itself on the parent if > CLK_SET_RATE_PARENT is set, and will not change the clock rate > otherwise. > > And if it was an oversight, then we are at least explicit about our > behavior now and it can be further refined down the line. > > Cc: Alessandro Zummo > Cc: Alexandre Belloni > Cc: Chen-Yu Tsai > Cc: Jernej Skrabec > Cc: Samuel Holland > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-rtc@vger.kernel.org > Cc: linux-sunxi@lists.linux.dev > Signed-off-by: Maxime Ripard Acked-by: Jernej Skrabec Best regards, Jernej > --- > drivers/rtc/rtc-sun6i.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > index dc76537f1b62..71548dd59a3a 100644 > --- a/drivers/rtc/rtc-sun6i.c > +++ b/drivers/rtc/rtc-sun6i.c > @@ -214,6 +214,7 @@ static int sun6i_rtc_osc_set_parent(struct clk_hw *hw, > u8 index) > > static const struct clk_ops sun6i_rtc_osc_ops = { > .recalc_rate = sun6i_rtc_osc_recalc_rate, > + .determine_rate = clk_hw_determine_rate_no_reparent, > > .get_parent = sun6i_rtc_osc_get_parent, > .set_parent = sun6i_rtc_osc_set_parent, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel