Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3262688pxp; Mon, 14 Mar 2022 14:54:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH5C/r3/48iVQ8YMS266NFXgk0Z++f705smpoLnsgnG/aQlDINxiJlNH//Xs9LelisUzo7 X-Received: by 2002:a17:902:8ec7:b0:14a:c442:8ca2 with SMTP id x7-20020a1709028ec700b0014ac4428ca2mr25437057plo.12.1647294883042; Mon, 14 Mar 2022 14:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647294883; cv=none; d=google.com; s=arc-20160816; b=aHedZF6mqlW8edIoCOS4a7o5l5UkGyd7fVjH3rsUsVsA4anJzx3nLIqCpa6S8fBXiW R5AT6XJgs91t5kzc6Z+NbxuA2zsNLPKAcw+S9nMdfE8CxAQmrXezwm0sj+okos2dBcI2 VJE3bS0NUROrnOrzt+5+cNEIQd4MsmRY9l2VP3e0EkPa77Y6diYSlz/Pvs+aW/Nr4h0J NJc+/frGwlgJRFhv544ha62gj6S6pDWzsnQxyOU46Bkw4+pafAbH8+Ve2sbVfFiyGIhV JkFy0uuNCliRFXGG48abdgi+2qDoAmayRxVHR5FEP3qnH5NjxrZVlvzYSLHn30UmsBnY TXvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/sGwhFLRtiH/ykUra8RNv5VtPDl39PfWAyeMQdseV4U=; b=Xb41RtHDS4Rpd1qjMfiT+5BLzcY3FdnjfGJhZ4dJ2XsCmdsqTbj1Ym9QoblPRZZFd2 ExgN9HMPlIBXVy6hAR5vWVsKov2FDAvydEQeXqx1Qt6FpyB0aTmxPplXDVKy6swJN51J fghJYxAWYpb8k+X6qzqb22S+BuoabWJE9YW9AbVO/LOwcMaHc2rH7+qaxo0lFC723nMf RSnnYlNON2KREXvx+91Bp6OOgDxIvX9Y3TYfjx0beHfwoGoUV/eKUg3sGuGm/QMcr4D8 tcr+RyIPyrLpkez3m9b7gh+ySWlsDXQmJOOhNGAA5CPOj+4hFZATtP4/6KCudU5o2Xlp DLEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E4HfJt2l; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e29-20020a63501d000000b003739acf4e04si16786092pgb.200.2022.03.14.14.54.29; Mon, 14 Mar 2022 14:54:43 -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=@chromium.org header.s=google header.b=E4HfJt2l; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242025AbiCNN7W (ORCPT + 99 others); Mon, 14 Mar 2022 09:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237653AbiCNN7T (ORCPT ); Mon, 14 Mar 2022 09:59:19 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 137D31EEF4 for ; Mon, 14 Mar 2022 06:58:09 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id p15so34153694ejc.7 for ; Mon, 14 Mar 2022 06:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/sGwhFLRtiH/ykUra8RNv5VtPDl39PfWAyeMQdseV4U=; b=E4HfJt2lpl5yMCJkmr268M1C6Xw1SdJiBIbXECMsySpxvvMRbBTqo3MSLg3VnfahpC P7LzLbgUQFA4BE/DsfILmqLQHUV+ASwOd5AcDTChMfwhP9mK0rdOs6tf3pdCjfyIgHEm lfiSNtrZ23gznqQr7osIXvkgdlCoTI2SO5lFQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/sGwhFLRtiH/ykUra8RNv5VtPDl39PfWAyeMQdseV4U=; b=t9OjaxOsj2wsGncHgnIqLHXRUinJnJaOz3tImBY4JATu6m3NhoQvU0KD6OVoRmZLwc +ngcc6ikWrNq7odqjxC1pI7lRFKwXMwNsJc29g7CuDXc9IMfmZibZVbfVA0ZcXRvizT2 9LRI2lh9Wu5l3M0d0cw3F6Fr+2/MVBjfZ3vp0XxpW3zJeTY9N3PBjfjqjNk1TYtcw8BE 4SavzKCviVel0/rdbTke/ZIw0GdudqMRMMYoi76bRz4dYYACxqxeCet/yrhz5pagPSxD NsFQsM3BtEBUtcApCZHNQqu+aEFy2kpBOlw3Gqrx4U4arpFcqQbxmQqdmuNFsGRX5c7l 7Kzg== X-Gm-Message-State: AOAM530pwAlTGlLxC1kFPAR1/Ngr2G8HiEqMqtnXHtkeUJ/y2lofgJdq ZjF30I6P1UYKNiCyY4c5xRendMxyo1NNLQ== X-Received: by 2002:a17:906:a148:b0:6cd:50c7:8d4d with SMTP id bu8-20020a170906a14800b006cd50c78d4dmr18476993ejb.641.1647266287237; Mon, 14 Mar 2022 06:58:07 -0700 (PDT) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com. [209.85.128.45]) by smtp.gmail.com with ESMTPSA id f3-20020a1709067f8300b006ce051bf215sm6893986ejr.192.2022.03.14.06.58.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 06:58:06 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id r190-20020a1c2bc7000000b0038a1013241dso1767971wmr.1 for ; Mon, 14 Mar 2022 06:58:06 -0700 (PDT) X-Received: by 2002:a05:600c:a53:b0:38a:fc5:3a90 with SMTP id c19-20020a05600c0a5300b0038a0fc53a90mr3788786wmq.15.1647266285495; Mon, 14 Mar 2022 06:58:05 -0700 (PDT) MIME-Version: 1.0 References: <1646758500-3776-1-git-send-email-quic_vpolimer@quicinc.com> <1646758500-3776-2-git-send-email-quic_vpolimer@quicinc.com> In-Reply-To: From: Doug Anderson Date: Mon, 14 Mar 2022 06:57:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 1/5] arm64/dts/qcom/sc7280: remove assigned-clock-rate property for mdp clk To: Dmitry Baryshkov Cc: Vinod Polimera , Stephen Boyd , quic_vpolimer , "devicetree@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "freedreno@lists.freedesktop.org" , "linux-arm-msm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "robdclark@gmail.com" , quic_kalyant Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi, On Fri, Mar 11, 2022 at 1:22 AM Dmitry Baryshkov wrote: > > On Fri, 11 Mar 2022 at 11:06, Vinod Polimera wrote: > > > > > > > > > -----Original Message----- > > > From: Stephen Boyd > > > Sent: Wednesday, March 9, 2022 1:36 AM > > > To: quic_vpolimer ; > > > devicetree@vger.kernel.org; dri-devel@lists.freedesktop.org; > > > freedreno@lists.freedesktop.org; linux-arm-msm@vger.kernel.org > > > Cc: linux-kernel@vger.kernel.org; robdclark@gmail.com; > > > dianders@chromium.org; quic_kalyant > > > Subject: Re: [PATCH v5 1/5] arm64/dts/qcom/sc7280: remove assigned-clock- > > > rate property for mdp clk > > > > > > WARNING: This email originated from outside of Qualcomm. Please be wary > > > of any links or attachments, and do not enable macros. > > > > > > Quoting Vinod Polimera (2022-03-08 08:54:56) > > > > Kernel clock driver assumes that initial rate is the > > > > max rate for that clock and was not allowing it to scale > > > > beyond the assigned clock value. > > > > > > How? I see ftbl_disp_cc_mdss_mdp_clk_src[] has multiple frequencies and > > > clk_rcg2_shared_ops so it doesn't look like anything in the clk driver > > > is preventing the frequency from changing beyond the assigned value. > > > > Folowing the comment of Stephen, i have checked a bit more. it appears that clock driver is not setting the max clock from assgined clocks, dpu driver is doing that. > > i am planning to fix it as below. > > 1) assign ULONG_MAX to max_rate while initializing clock in dpu driver. > > 2) remove unnecessary checks in the core_perf library. If rate doesn't match with the entries in the opp table, it will throw error, hence furthur checks are not needed. > > 3) no changes in dt are required. (we can drop all the posted ones) > > Why? They made perfect sense. The dts assignments should be replaced > by the opp setting in the bind function, as this would also set the > performance point of the respective power domain. Right. You should still _post_ the dts patches. It's nice to avoid unneeded "assigned-clocks" in the dts. The patch description should just be clear that it relies on the driver patch and shouldn't land / be backported without the driver patch. > > Changes : > > ```--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > > @@ -284,17 +284,6 @@ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc) > > } > > } > > > > -static int _dpu_core_perf_set_core_clk_rate(struct dpu_kms *kms, u64 rate) > > -{ > > - struct dss_clk *core_clk = kms->perf.core_clk; > > - > > - if (core_clk->max_rate && (rate > core_clk->max_rate)) > > - rate = core_clk->max_rate; > > - > > - core_clk->rate = rate; > > - return dev_pm_opp_set_rate(&kms->pdev->dev, core_clk->rate); > > -} > > - > > static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) > > { > > u64 clk_rate = kms->perf.perf_tune.min_core_clk; > > @@ -405,7 +394,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, > > > > trace_dpu_core_perf_update_clk(kms->dev, stop_req, clk_rate); > > > > - ret = _dpu_core_perf_set_core_clk_rate(kms, clk_rate); > > + ret = dev_pm_opp_set_rate(&kms->pdev->dev, clk_rate); > > if (ret) { > > DPU_ERROR("failed to set %s clock rate %llu\n", > > kms->perf.core_clk->clk_name, clk_rate); > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_io_util.c > > This file has been removed in msm/next To echo Dmitry, please make sure that your patch applies to msm-next, As I understand it, that means the branch msm-next on: https://gitlab.freedesktop.org/drm/msm.git -Doug