Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2733011rdb; Tue, 12 Sep 2023 10:19:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwEZ+dLp8lnunZn2TRwW+YiXEXLeB3lKg95XVm8X5EIeKkSLe2iYULHIh6aNqrw72Q6iqG X-Received: by 2002:a05:6a20:3d82:b0:14b:8023:33c8 with SMTP id s2-20020a056a203d8200b0014b802333c8mr61798pzi.2.1694539198755; Tue, 12 Sep 2023 10:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694539198; cv=none; d=google.com; s=arc-20160816; b=c9X16jWF48844jcYtaQ7ynd8yVibJb8y8LQVIwWt3agSBDTzUV5ZzkzXhTsZBQw4O5 /nA4K7yL5W/q/JS3ejT1jGrL+8QxLnA1Q6O0FrCOT4IQQgTax+7vvb5CLU/a+nrktGqx ykL6lKN4O+UwkCZi26Xy7EuBv5uor9P9w28dMLVirHrKm9fHHgw1EidABNE/wTJ1ODAl k9CT9PJxB/Cn9M7LRLylVrLmH81tXZWiEFMYM6dgNs7bx6025VIEcv9jgeyoKslWR1PI RRv3E4JU/FupLvX8UOfRuACODhUWOXnvY/u+UyPkP8dLSSZb2g16JaIXdwtyU9CiJ9+N 0v5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=+2q46O7efDXVGtNITaVnlXpqniY/rjlpX0v8ey8+6L0=; fh=ybquWFqC1eCiuFL6F8Ps/bpheMGbgSRDaeC0l3T7M5Q=; b=q1SSFH79+EKmnubvHk9mLgm5yeUW+DmJmVGcy/Vug+qEwjShFKrK8qFTP5iegjk6Fs NnV0kVk4gLFaqxSby5QCfazjDVEs73JjJFK+NamjdeAsk50hpEJeKfYhgcnXJDIEzpGY uBEbMv9q1O5eg6Y6WQ/4cLOp6/uqS5nBanPBIiQ61WEZhQOWtRCuqrqzbIxHUc1KQ0jH uEcoOkDIEcidR+x8xSMlBZql/ZnVWnOlDyUqRe9VkbTQeAanC3LJhhyuiFLZ66qNiewa JO+Fy2meX8jUlCpBm0GMI+SBHpj8jqyPqHkOSTTDfWXdr1wb6LQLA9bEpzVy85EaSDj6 Narg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fgFTkWWL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h17-20020a056a00219100b0064f78c32b89si8461240pfi.95.2023.09.12.10.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 10:19:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fgFTkWWL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0B1B980CBF30; Tue, 12 Sep 2023 10:18:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237030AbjILRSS (ORCPT + 99 others); Tue, 12 Sep 2023 13:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237006AbjILRSR (ORCPT ); Tue, 12 Sep 2023 13:18:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07C8310F4; Tue, 12 Sep 2023 10:18:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8967CC433C8; Tue, 12 Sep 2023 17:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694539093; bh=+2q46O7efDXVGtNITaVnlXpqniY/rjlpX0v8ey8+6L0=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=fgFTkWWLOfuQzE/RIqe1KySaJA0A6/r1GgKbxoH2HvpA9PiX4Fmq2wZ0+RIifXEFo ArgRoNDAQxa2IZjNtwQIwfwP25wDrnGaeOKu1p+6eRCIjTbuWjJVckt0t87hWvZwwn TJSM+HTmP8j6wQdDGbwVRGQuaI4wIdi/cQJNW0dKbK9+72cXNqOLqhmuRMq5kZ7P8M hU/pOqpFd121kKYuOotZJDhKqvZc85Dhcye8la7Fbim9Qfn+IB+nxo2/yVkSO0LMd+ QKHBiiuths6GeyeGXHnEuncCEkVv7Y+XckSEvHTSvjZynHvLtr+P/9Nh7vzrcZNJ08 aUdpNTF7QBH0g== Message-ID: <82adb75659e0d278e25b65b0e81df99a.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20230901091823.30242-1-quic_luoj@quicinc.com> <20230901091823.30242-5-quic_luoj@quicinc.com> <27ae3297ad161fd67706db70b402db04.sboyd@kernel.org> <16d09acf-7bdd-04ee-6faf-936c0366df03@quicinc.com> <17681a9f756cc70a190c674c51b90140.sboyd@kernel.org> <5a4805f7-f802-b1ba-9804-59c0fe6c7f26@quicinc.com> <92058c25fb11b75ee0a2298a684825e9.sboyd@kernel.org> Subject: Re: [PATCH v6 4/4] clk: qcom: add clock controller driver for qca8386/qca8084 From: Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_srichara@quicinc.com To: Jie Luo , agross@kernel.org, andersson@kernel.org, catalin.marinas@arm.com, conor+dt@kernel.org, konrad.dybcio@linaro.org, krzysztof.kozlowski+dt@linaro.org, mturquette@baylibre.com, p.zabel@pengutronix.de, robh+dt@kernel.org, will@kernel.org Date: Tue, 12 Sep 2023 10:18:11 -0700 User-Agent: alot/0.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 10:18:25 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Quoting Jie Luo (2023-09-12 05:07:02) >=20 >=20 > On 9/12/2023 4:11 AM, Stephen Boyd wrote: > > Quoting Jie Luo (2023-09-08 04:10:35) > >> > >> For example, when the uniphy works on PHY_INTERFACE_MODE_2500BASEX, th= en > >> the parent uniphy clock rate is 312.5M, which is decided by hardware a= nd > >> can't be changed. when a branch clock requires a 25M clock, the parent > >> uniphy clock maybe updated to 125M by clock framework if the flag > >> CLK_SET_RATE_PARENT is set here, but the actual hardware clock rate of > >> uniphy is still 315.5M since the uniphy still works in the interface > >> mode PHY_INTERFACE_MODE_2500BASEX. > >> > >=20 > > If the parent rate can't change because CLK_SET_RATE_PARENT is missing > > and the hardware doesn't allow it, then perhaps instead of having a > > frequency table we should have rcg clk ops for determine_rate that > > simply looks at the parent rates and finds the rate closest to what is > > desired. And for the set_rate clk_op we can have it be simple and just > > program a fixed divider. The benefit is less frequency tables that don't > > do anything and less hard-coding of the frequency. I thought we already > > had those rcg clk_ops but I couldn't find them with a quick glance. >=20 > Thanks Stephen for the suggestion. > looks you are saying the clk ops clk_dp_ops for the fix parent rate?=20 > which seems not meet the clock requirement of this clock. Yeah that is close, but the determine_rate clk_op needs to look at all possible parents. With the dp clk_ops we assume that only one parent is possible. >=20 > For the device qca8k, it is also possible to switch the interface modes=20 > between PHY_INTERFACE_MODE_2500BASEX(312.5M) and=20 > PHY_INTERFACE_MODE_SGMII(125M) during the running time, and there are=20 > multiple parent clock source(P_UNIPHY0_RX or P_UNIPHY0_TX) for the RCG=20 > clocks to select according to the current work mode. so the parent_map=20 > and freq_tbl are necessary to this clock. I still don't see why the freq_tbl is necessary.