Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp520586imm; Fri, 13 Jul 2018 01:26:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfc3ax1CCEprWlrUqW5o0oJ9vwlTeDrUtbXQbJx83rp6DZEgjrMq/6YG7573aAMHXG0q+M3 X-Received: by 2002:a65:5641:: with SMTP id m1-v6mr5316317pgs.246.1531470398472; Fri, 13 Jul 2018 01:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531470398; cv=none; d=google.com; s=arc-20160816; b=l3D6ffBvyAz5bNIS4dbnyS3DVjdEl+LUDOxddarVU7YUT0OkYjDLpLdI/jGRsz0Rn+ yQN62ZuypKhBZvLfqaEWc2I8dG3H/aJAS+MKOHrExcn5W7x9b4+DdduffydqVxgMyMiK KtOsZlyM3w1W+qi0zUPECqAxXqHJkKu5wNkkM1zK9IGgQhiwl/ZMB9KAAaL8mk+9Fofa /RIwqM68lgkfuVrjUzMIZntnaXq/W0EzS6Pu0S9tt+vov5huCRmNo6bOLueqjG4XeJ+i oTDPLAgVdKkKsHfvzAJelc9vdJkqecIvslkhJ6TIgO7uuLy67u0h9G3s33JB13pozq1e ujdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=oA+TFFECh77hcXNd8dxKy6Z0ej7OQaXK7FoUkWaW1P8=; b=0b4NrsyJPcZOG3D7RDZjqrQZFphZKRw1Qsy3HDpt7XWPEwrnwgMU84KwMYPKSGho83 QkuT4RXizgN8iVpPmohA+A61HsNKQ0inHCqbAsuLomkxDYYKJS5SPNKEuH68PNe3ZY4K baJ4+cOOMl0Gu7eZ8KjS5JzaNLc9UGvu19KtZFazZo7K+lRDWkBCP/uo3uMBrkrCEIA1 Onum7Q4gSxWqNyCj+R8dKoigB1nZHuth7ng6IPnExN1r047lcC2xeb83QlHJstxJKv8J 0nYSkrMELUDzC/3mlgsdjTjER0zNCluzowZpIEMektdakuEmssfJzsmUwgwiw79S7yDp u5CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=oHkmtJ3z; dkim=pass header.i=@codeaurora.org header.s=default header.b=e2CdToz7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22-v6si23450423plo.141.2018.07.13.01.26.23; Fri, 13 Jul 2018 01:26:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=oHkmtJ3z; dkim=pass header.i=@codeaurora.org header.s=default header.b=e2CdToz7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727015AbeGMIj0 (ORCPT + 99 others); Fri, 13 Jul 2018 04:39:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59550 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbeGMIjZ (ORCPT ); Fri, 13 Jul 2018 04:39:25 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 607EC60B6B; Fri, 13 Jul 2018 08:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531470350; bh=q+9mA2cCWRUVLdfSS8fbRg3vLFgnj6Xa1Tn/se3TMIg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oHkmtJ3zvl03Bf60wnpd1of939IeC2LjmoaOLe1Vvhzgk2o0ct1y3JF1kKd/XPFcI jY/poYtaJLUL/bGdHOr4OE0DbLdIB7CAqPjslpIbxMNTm15v6+d4KcdgvClhbbpejb /leCshOmKlebXJ6grfQ/BXcP736nwxK8FNu6RVdM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id AE4366060A; Fri, 13 Jul 2018 08:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531470349; bh=q+9mA2cCWRUVLdfSS8fbRg3vLFgnj6Xa1Tn/se3TMIg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=e2CdToz76Om73zomu4SRQrHoV/mDfNR3Qd3RiwfIa7GKep8y3IOpksfLlE9Z04zXH PJ1P0CcOT8dIlWkQCLgbAUowlJTYdg1zeguj78l7EnK+UqkabrfcXBWn4UDf0ktYGc pXm0A2TA7pzZx9KnN4zo/GglwVlkHj+7OvmYAxpg= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 13 Jul 2018 13:55:49 +0530 From: spanda@codeaurora.org To: Stephen Boyd Cc: Abhinav Kumar , Michael Turquette , Taniya Das , ryadav@codeaurora.org, Andy Gross , David Brown , Rajendra Nayak , Amit Nischal , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] clk: qcom: Add display clock controller driver for SDM845 In-Reply-To: <153142449680.48062.13809855257701591509@swboyd.mtv.corp.google.com> References: <1529763567-13131-1-git-send-email-tdas@codeaurora.org> <1529763567-13131-4-git-send-email-tdas@codeaurora.org> <153109408562.143105.15954380130353645468@swboyd.mtv.corp.google.com> <10f87216-caa2-d523-e134-6cf3acd268a7@codeaurora.org> <153111701079.143105.13387458941681113476@swboyd.mtv.corp.google.com> <436cc6a3-7406-c695-7879-3b9d042262cc@codeaurora.org> <153112184177.143105.15452587215679149679@swboyd.mtv.corp.google.com> <288770be-a763-b287-f62a-72ab7616efdb@codeaurora.org> <153114876561.143105.465317097490450694@swboyd.mtv.corp.google.com> <153142449680.48062.13809855257701591509@swboyd.mtv.corp.google.com> Message-ID: <9509c88c112d59874e28459d8f87509f@codeaurora.org> X-Sender: spanda@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-07-13 01:11, Stephen Boyd wrote: > Quoting Taniya Das (2018-07-12 10:21:33) >> ++ Display driver team, >> >> On 7/9/2018 8:36 PM, Stephen Boyd wrote: >> > Quoting Taniya Das (2018-07-09 02:34:07) >> >> >> >> >> >> On 7/9/2018 1:07 PM, Stephen Boyd wrote: >> >>> Quoting Taniya Das (2018-07-09 00:07:21) >> >>>> >> >>>> >> >>>> On 7/9/2018 11:46 AM, Stephen Boyd wrote: >> >>>>>> >> >>>>>> > Why is the nocache flag needed? Applies to all clks in this file. >> >>>>>> > >> >>>>>> >> >>>>>> This flag is required for all RCGs whose PLLs are controlled outside the >> >>>>>> clock controller. The display code would require the recalculated rate >> >>>>>> always. >> >>>>> >> >>>>> Right. Why is the PLL controlled outside of the clock controller? The >> >>>>> rate should propagate upward to the PLL from here, so who's going >> >>>>> outside of that? >> >>>>> >> >>>> The DSI0/1 PLL are not part of the display clock controller, but in the >> >>>> display subsystem which are managed by the DRM drivers. When DRM drivers >> >>>> query for the rate clock driver should always return the non cached rates. >> >>> >> >>> Why? Is the DSI PLL changing rate all the time, randomly, without going >> >>> through the clk APIs to do so? >> >>> >> >> >> >> Hmm, I am afraid I do not have an answer for this, but this was the >> >> requirement to always return the non cached rates from the clock driver. >> >> >> > >> > Ok. Who knows about this requirement? Can we add someone from the >> > display driver to understand more? >> > >> As per my discussions offline with the display teams, >> >> There is a use-case where the clock framework is unaware of the PLL >> VCO >> frequency change and thus the drivers would query to get the actual HW >> frequency rather than the cached one. >> >> Do you think keeping these flags would have any impact other than >> always >> getting the non-cached rates? >> > > The flag will make it so clk_get_rate() works in spite of something > changing the frequency behind the framework's back, but I want to > understand what and why it's changing without framework involvement. We > shouldn't need the flag here, because this flag is typically for clks > that are controlled by some other entity that the kernel doesn't have > control over. In this case, it seems like we have full control of the > clk tree for the display PLL down to this clk, so it should be > perfectly > fine to not have this flag. The presence of the flag means that the > display driver is doing something wrong. These clocks are sourced from DSI PLL. In dsi command mode there is an idle use case when there is no activity on display, we switch of the source DSI PLL to save power by calling clk_disable_unprepare(). In this scenario if some client queries the clk_get_rate(), then if NO_CACHE flag is used the clk driver will return the cached rate which is some non-zero value set when we last called clk_set_rate(), before enabling the clock, whereas actually in HW this clk is disabled. So we used the NO_CACHE flag for the call to land in clk_recalc_rate and we return zero if the PLL is disabled. I remember some customer had scripts that runs through all the clocks during idle screen scenario and call clk_get_rate(), where they complained display clk_get_rate returns none zero value.