Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7233217imm; Tue, 24 Jul 2018 10:34:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeF9SXM3X5Md78wfC9BXZYwkMox/QVGNvTKR6VICf/1Vb5EojzGOCHVDt8txAm1eWWsICeF X-Received: by 2002:a62:d34a:: with SMTP id q71-v6mr18563498pfg.17.1532453643089; Tue, 24 Jul 2018 10:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532453643; cv=none; d=google.com; s=arc-20160816; b=Ooef/kCF/Cj1gjSc+RPSm6dWcqggV8yDoLy6uEKrtHD0OzCcqLjUgpvhlFFAANSoak PkLVQJQekAcoCEyTWr3YcWVfgMt8TKg/UyZq9kngPkkjosQJ7W1YjUBPSa9vAegsceAo WQb2z4RQ3kJSFk5RvRlY4/6Ey8rJs1Ks3F94HK33868Htx67p7auEQJmPYk5nibeGoIE NsXgNLi0xK6i9UnjlcJHSAq03zqEzzAcgi+DC7OmHK0bME7xmdNx+YhDg+6DPCGYFdZw pXab7goLA07gJCG/34EO2Wr8gGowvAh2ZPGutlEKD4Wh4+gGGLM/CnWLoyU91KGtUsfZ 5LMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=Zm7rrFMI6BkVo0uvFi03/Kty9lqkKnTGrvFBQCu4A+U=; b=cIMYRd5GXe7aAohaIxF0VKBv1arglJ1AonZO79oMBXS+WOZx9FsQouFZCeqdXwRqBf gDyRIhDqc4vKOI68MKcC6vf6DocoRqPgRPWPS421Zje0WP8bDjjyKBuwiU0HH5/DQTf+ vwV3ROKDPzeiix/2FkGvFlZllki0pkUPUjlyjT4e0bA/KX1UFdIAzPh/mx9lTVSs8FWK 4TzrBPic4sa5eBVLZxMhIn7cFWLmXELHL/IRDW1Ow9oewHbXP/SvcLw8XTK/uloMFezg 6WtwAqs+Ux2vqx/ZTvrns6N2cwDcFXSwdJDXirPsdoXhA5ttUFPC56HRv/SQy6EZjNL8 hGmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OaSNnrlq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69-v6si11243646pla.288.2018.07.24.10.33.48; Tue, 24 Jul 2018 10:34:03 -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=@kernel.org header.s=default header.b=OaSNnrlq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388486AbeGXSkc (ORCPT + 99 others); Tue, 24 Jul 2018 14:40:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:52660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388382AbeGXSkc (ORCPT ); Tue, 24 Jul 2018 14:40:32 -0400 Received: from localhost (unknown [104.132.1.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8551120880; Tue, 24 Jul 2018 17:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532453579; bh=yzy0JsBmUT2FmWdtMJdo056rzr0L4oh3ywR/JCXyDNM=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=OaSNnrlqQNUszgdAynRERiyxuBzXWCKyj+hO0X1ROYgf4d/pIyaIRGcRhNIacSsmk aNW6+9zXK0xgRRUjkDs0xiUeVVUdcr9r/r2GngM2i3wULcCdFMyrjwzrjXB0uYA0qj nB5dpOM4c/H2fdJcfbm4/VA2765nS0QMr+zdoSZk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: spanda@codeaurora.org From: Stephen Boyd In-Reply-To: <9509c88c112d59874e28459d8f87509f@codeaurora.org> 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 References: <1529763567-13131-1-git-send-email-tdas@codeaurora.org> <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> <9509c88c112d59874e28459d8f87509f@codeaurora.org> Message-ID: <153245357881.48062.2111028557651634514@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v3 3/3] clk: qcom: Add display clock controller driver for SDM845 Date: Tue, 24 Jul 2018 10:32:58 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting spanda@codeaurora.org (2018-07-13 01:25:49) > 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 th= is file. > >> >>>>>> > > >> >>>>>> > >> >>>>>> This flag is required for all RCGs whose PLLs are controlled ou= tside the > >> >>>>>> clock controller. The display code would require the recalculat= ed 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 cach= ed 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 dr= iver. > >> >> > >> > > >> > 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. = If the clk is disabled in hardware it doesn't mean clk_get_rate() should return 0 Hz. The frequency of the clk is set to something, so we should return what that frequency is by reading the hardware. > 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. This is super wrong. If the PLL is disabled it still has some frequency configured.