Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1122440rwl; Wed, 29 Mar 2023 13:03:14 -0700 (PDT) X-Google-Smtp-Source: AKy350b4IE0f1pj7FVe+DGaoi0TER2hZDPlWzeHywkMUau5cq/tZ282xd5s77QXzWSCTKnf4qyCh X-Received: by 2002:a17:902:cec6:b0:19a:ad2f:2df9 with SMTP id d6-20020a170902cec600b0019aad2f2df9mr22385928plg.55.1680120193929; Wed, 29 Mar 2023 13:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680120193; cv=none; d=google.com; s=arc-20160816; b=JLIkevQTrhcmOCp4UKH94q6GsF3VFYZ1Q7anNdTi0R6ynufZJPHCtD3xN/TWDsxAgC 6MQWW6Ai3eT8wJGkJIZUP9wQ9+Ta1GT3vEP1M78drHa2v3BjmNgatdJopU0hHLg3QObO IK3ze+5HbDjemS4BgJ7uJf5z1eaDygj0GCvy3KjTmTWN4qlRAf8B2uS/kJF8bhucCi6n FtOWZhDbgJWbnP2KbJEj1n/kMU5qkA4e4+SX8TnrQ8VQk6J0ZJFlt43Z6oe/sIc2BfUk 3kq6aVMLfdLArJX8UhoHXbSDtJNyEVKddmHB2Jp2VjSZLLT+EDcbddMeYpwKBQ2F7er4 rzSQ== 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=WnVvHtUnVJH9Bw3AXFp7zZ/oifbd44PonvjIkiBETkU=; b=rEaFNaABV+NRCU78tCz5DzprQpg/i+IDfDVikWrtASEgWVJ+vJD1KOkslr5HEQRaQf M8FeAMaGIEnNfzJnyIjH1BVDOhC6n/qOZGgSgREQqxtD1zWiFzDyFg2v7xalKOPGu5yH MSRT/8vxyfHbKGeEMN7IIiYJ+mSqlCfwtmMIkc/6WH7kNid/KKpRWUBE7HPhyYBe1phT bS/o0ef7Nfso9Ywzghfi0LApOTYhMTqp/crEI5/sqb4+NvcGjgO7dFgaVlamCB5HJhJa zHmakPWwELTE/b52cxr8MvZIRrM8wky/6lmSwIflG5KsgvDwPiCwmz77PBSXxPR0rVDj cNZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mU+ah1pt; 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 n4-20020a170902d2c400b0019ca7d69673si34687285plc.196.2023.03.29.13.02.59; Wed, 29 Mar 2023 13:03:13 -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=mU+ah1pt; 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 S229937AbjC2Twy (ORCPT + 99 others); Wed, 29 Mar 2023 15:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbjC2Tww (ORCPT ); Wed, 29 Mar 2023 15:52:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48C311711; Wed, 29 Mar 2023 12:52:32 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3469D61E06; Wed, 29 Mar 2023 19:52:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8769FC433EF; Wed, 29 Mar 2023 19:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680119545; bh=xcF9CuGA0ZvQlSz1cJNgsAOmxVDDBm9VrRmsouXIeZ4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=mU+ah1ptkQ7L6P00ZxppANt2wrNejIXxnFHkVPslXsz3XjzIFNFu7LUZvL9SxHTFm a8xFcg5sGhMILcdyJsS7EBkfUD98uETjNeb4ZeweXPnid2N0Fs4YdMpOCyNwftTDmS CZnPkLP0SA+XvAvq3r7MOQLTtFIitTYST054I6c2WaXxNRCnhzIgIzKdjY3c0XjwQD BllKLQd3Gjlp0YMAsT5RpfaFIh7TemFY2TyEY7VJkSM9T2yP3ot3H5p74InozxyBbI rAZLyDJWF+nrbjSYVbiURkmBGtqxXiOsr4Oa+0zFpITHutDP3DFctKS2b2NK+j1YPL Ki6Sm3cpWsGdg== Message-ID: <9fe53d8ae42e381f28715aaf8d2b7ae7.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20230117135459.16868-5-ansuelsmth@gmail.com> References: <20230117135459.16868-1-ansuelsmth@gmail.com> <20230117135459.16868-5-ansuelsmth@gmail.com> Subject: Re: [PATCH v3 4/6] clk: qcom: clk-rcg2: don't re-search config on rcg2_set_rate From: Stephen Boyd Cc: Christian Marangi To: Andy Gross , Bjorn Andersson , Christian Marangi , Konrad Dybcio , Michael Turquette , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 29 Mar 2023 12:52:23 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Christian Marangi (2023-01-17 05:54:57) > Currently the rcg2 driver search the rate to apply 2 times. > - In _freq_tbl_determine_rate for the determine_rate function used by > core clk to understand the best rate to set with set_rate > - In rcg2_set_rate where the suggested rate is not trusted and searched > another time using a CEIL or FLOOR policy. >=20 > This is fundamentally wrong as we are ignoring what core clock is > deciding and just setting whatever clock configuration we want for the > suggested clock. The problem is in the fact that the correct clock > should have already be searched and selected with the determine_rate > function and set_rate should just apply whatever clock was provided. It sounds like you're assuming the rate coming into the set_rate clk_op is rounded? Don't make that assumption. The set_rate clk_op should round the rate again. The parent rate could have changed.