Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1253656rwl; Wed, 29 Mar 2023 15:08:48 -0700 (PDT) X-Google-Smtp-Source: AKy350ZLDXQ5wZHlPgTdLJ0/k8PipCEB63TLj2xl90Uka3XuPGZgAOd/7cqCvyulBl1LzvAOTLr7 X-Received: by 2002:a17:90b:3a85:b0:23c:61f:2be5 with SMTP id om5-20020a17090b3a8500b0023c061f2be5mr21735536pjb.18.1680127728018; Wed, 29 Mar 2023 15:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680127728; cv=none; d=google.com; s=arc-20160816; b=k+XsqudQQ/LQApucumS3n0r3hDiM16kmaYwvs+KK6aYo21G8TCfVX/HcbIYzhjrkKz M+l8XnNfApiF8/R46Re+EFmvt9J+YZitoKmvRdYENX7Mq8ourz6C6Lgb+U2Si6lzQw+w BCH728BjQrPy26V8yVPd84Hl4C7Y1LIgy6mlWKKxbjz4Pu27PD1OK8GARCjLvSw7n+DA +8CkohzZyDUq1/zN8mDyQEeK1EkCQH40cuOoTrsjsTtr9ujuPOW02KtThXnxhyEs9EcX rKvi4zLRhGEx2e4JR7OhvuklLRRSVMPGaJzalRI0mAB3Q9wBKFEyXil4J4OXAtL7ex5M 355A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=+ggSQSBjcGG50mVsu73/uneoIs8bSkzv42Ltqcyc8S0=; b=saAc4Q7/nlBdLSdASJXWSPeqO2ThVrZ6GB1W+s+M0NbuLwGpKhyOsM+2aWl4fA0gZa /nDJDSyB7fc4stDnOrEFedAdcpQZvUo3FyFuGDbb8F59ygmPpelWVvyvjqMRlcfES48j aNBWIuuFWd9UvdnUZeYc31+27UxK//TjwQm/uis9ACw5C/9SzULxK79duq3ddh2VHaKc 63XzlKeTO1LmmrkzvCcovtsPYGCQyMZ8iQUoQ27/reV3fZ1FdDUeD43CPlfPFlzUNxiS A7idjSUWYQ869hS7gRb6hppoK338IUamOJc3TQsxSEjjfbwlMUk3NZz98VspM999yv0x 8aGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RoY2mUim; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a17090a9dc400b00232f57260c1si2400696pjv.1.2023.03.29.15.08.34; Wed, 29 Mar 2023 15:08:47 -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=@linaro.org header.s=google header.b=RoY2mUim; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230058AbjC2WCB (ORCPT + 99 others); Wed, 29 Mar 2023 18:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjC2WCA (ORCPT ); Wed, 29 Mar 2023 18:02:00 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D05240CB for ; Wed, 29 Mar 2023 15:01:58 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id c29so22110964lfv.3 for ; Wed, 29 Mar 2023 15:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680127317; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+ggSQSBjcGG50mVsu73/uneoIs8bSkzv42Ltqcyc8S0=; b=RoY2mUim9wzp5/rgd1xcAMsFeiFU1OrUMYbM4J48chba/ykhJgS16Q6BNOmOlZp6jy rimtoJxrEbRMcRh6E+tKV/cirH8to8mokBPyG5Rb7Y0k9QEvS4K29SCtuHbXUeW8R5iw SqKlMg+YJ/2gNX7dQwVXNgVBKr/JPA8LkDAQl1N858piv5OZ+YqPyC4lDxKd2N9oQci/ 2eNLHP2ZoIyohoO+h0coF3bPX6ODplWFXa6ZhOGJHGrPj1jE6SvCmAl/xtECSrQWBMjU X4sdiwO3eMe6ivrOUW7EMIuWfaPwPXsGOggX/MM4fjIh+2SLqkQexeiBC7lwmMlBIS/h 8VUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680127317; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+ggSQSBjcGG50mVsu73/uneoIs8bSkzv42Ltqcyc8S0=; b=3NAFHBTbzTCTNBzRh92QUc+azf3UXwMrshjdOH/Q0A2yZn77F6Yc1Kf5Yxto2o0GBt IYGl7TU/0liSPYk/2dOQW2uN7cmqVhoD+FvCj0Y1vWUUZkpBVZYLtKVeQ9BD5vUZg2It TSv6IZt0BLP378TCRiCG1BZb5q5Be2TxGX70u3eZG1hcWc1tctwpdzzYrrcFpbLFODxx +wh3+gIiiWbYuZHHtSugJB66jVKh3WoeLBc8Hvore3UBimrwnNgclwMPZ8Pced1lnsYV JeiB18GOH9Gia+vH9GpVO6srHgjx3ol9KYSRMZ6uqr/574I6ER/Vz4lRar8lJ30rRh6E LoGg== X-Gm-Message-State: AAQBX9cai9UPiqx3rNoJkRPVH3sbYOrkLqepTABqki2JnCJ3XJaXVE3S 2f9+oJf60+sjLuVrRLeQ5C4XYg== X-Received: by 2002:a19:c502:0:b0:4e9:85e5:23ff with SMTP id w2-20020a19c502000000b004e985e523ffmr6928472lfe.40.1680127316641; Wed, 29 Mar 2023 15:01:56 -0700 (PDT) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id n11-20020a19550b000000b004eaf41933a4sm3413618lfe.59.2023.03.29.15.01.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Mar 2023 15:01:56 -0700 (PDT) Message-ID: <718f89ed-c9f7-57ce-a50b-300915c3660c@linaro.org> Date: Thu, 30 Mar 2023 01:01:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 4/6] clk: qcom: clk-rcg2: don't re-search config on rcg2_set_rate Content-Language: en-GB To: Stephen Boyd , 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 References: <20230117135459.16868-1-ansuelsmth@gmail.com> <20230117135459.16868-5-ansuelsmth@gmail.com> <9fe53d8ae42e381f28715aaf8d2b7ae7.sboyd@kernel.org> From: Dmitry Baryshkov In-Reply-To: <9fe53d8ae42e381f28715aaf8d2b7ae7.sboyd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 On 29/03/2023 22:52, Stephen Boyd wrote: > 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. >> >> 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. My fault, I suggested this some time ago on the basis that... "CCF switching the parent rate during the clk_set_rate() call. Then the second lookup might end up selecting different parent/mnd configuration." -- With best wishes Dmitry