Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbcKGFsS (ORCPT ); Mon, 7 Nov 2016 00:48:18 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:50772 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750954AbcKGFsQ (ORCPT ); Mon, 7 Nov 2016 00:48:16 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org CA07861254 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=rnayak@codeaurora.org Message-ID: <58201597.6010207@codeaurora.org> Date: Mon, 07 Nov 2016 11:18:07 +0530 From: Rajendra Nayak User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "'Stephen Boyd'" , Sricharan CC: mturquette@baylibre.com, linux-clk@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stanimir.varbanov@linaro.org Subject: Re: [PATCH 3/3] clk: qcom: Set BRANCH_HALT_DELAY flags for venus core0/1 clks References: <1477304297-5248-1-git-send-email-sricharan@codeaurora.org> <1477304297-5248-4-git-send-email-sricharan@codeaurora.org> <20161103203418.GA16026@codeaurora.org> <006701d2367b$19a6ba00$4cf42e00$@codeaurora.org> <20161104201836.GE16026@codeaurora.org> In-Reply-To: <20161104201836.GE16026@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2644 Lines: 59 On 11/05/2016 01:48 AM, 'Stephen Boyd' wrote: > On 11/04, Sricharan wrote: >> Hi, >>> >>> A better design would be to check if the associated GDSC is in hw >>> control mode and then skip the checks because the clocks are no >>> longer under the control of the registers. I presume we only >>> enable the clocks here to turn on parent clocks which don't turn >>> on/off automatically, i.e. the PLL. >>> >> I was thinking clocks in the powerdomain still needs to be turned >> on explicitly, these are branch clocks, irrespective of the PLLs. >> Putting the gdsc in hw_ctrl, only makes the polling on their status >> invalid. Anyways would be good to be aligned on this. > > Sure. We also need to make sure the branches are on themselves. > When the gdsc is disabled the clocks are killed though. This is > why we can't enable clocks until the gdsc is enabled. > >> >>> Given that hw control is a static decision I guess that is an >>> over-engineered solution though? The problem is that this seems >>> brittle because we have to keep two things in sync, the branches >>> and the gdsc. So I guess this is ok, but it deserves a comment >>> like "GDSC is in HW control" so we know what's going on. Also the >>> commit text could be more explicit that clocks within the gdsc >>> power domain don't work when the gdsc is off, and with hw control >>> of a gdsc we can't tell when the gdsc may be off or on. >>> >> >> ok, i will reword the commit log better as above. >> >> So i understand its ok to continue with this way of checking ? >> since we are always having a static association which never changes, >> than introducing additional fields in the clk_branch which can >> get the status of the gdsc. >> > > Well I'm also curious which case is failing. Does turning on the > clocks work after the gdsc is enabled? Does turning off the > clocks fail because we don't know when the gdsc has turned off? I > would hope that the firmware keeps the gdsc on when it's done > processing things, goes idle, and hands back control to software. > Right now I'm failing to see how the halt bits fail to toggle > assuming that firmware isn't misbehaving and the kernel driver is > power controlling in a coordinated manner with the firmware. What fails is turning ON the clocks after the gdsc is put under hardware control (by fails I mean the halt checks fail to indicate the clock is running, but register accesses etc thereafter suggest the clocks are actually running) The halt checks seem to work only while the gdsc is put in SW enabled state. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation