Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1094328imu; Fri, 21 Dec 2018 12:28:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7i7MQ0labwGULRSvyJeXJ+Tfpt8eZUYg1ZzGi/s5GKfeujKqZBF9EKUgN3uuBfEtHR4R4z X-Received: by 2002:a63:5664:: with SMTP id g36mr3722977pgm.313.1545424137494; Fri, 21 Dec 2018 12:28:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545424137; cv=none; d=google.com; s=arc-20160816; b=Hv/Y1I7ca5AqRsPXnDR1MTHFG2VNyr2BYK2IAnwM+dkWwExw35uDNTZi4Z97ZPTZwS 7yegIGRIbfumTpakih5KUqON1CzGpNHo2kM4mlQ2RXCufMAgKpL4lSE0YVVCcxz4yQGy E+j4nZopCI8+/ltGWTwBVXr+2vFVZydqjqHYBGt6yrsodKKs4aFDx91NYvs1yhCXvmTf qC2biowud9CbnoOmji+10LVDD85Wk7GLcEV6BobyO1zZH4iY3qkpxkuDRwxdh7OIpEa3 fw/rug8IEie6DOQNbpvsaq4JXtB6EOJRuXBpJx9hkWIm8d+DqAa/52U3JQS9JB0syW+5 qJJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=TBeYpA+ZER3k/7FfAniVy3+DDhg63t94WdSvWr+H9BM=; b=tCfHROAupwGHTtW633b7607IzRpLBEUb4Cod64mgYbiB+F4ZKh8ehThYa7q0TJ4Yix MeMKRaVx7zfUo3wgNpMNmJ3dtjbw8koRlfQHVMfb3OwdIcSqiZ8Dn4Px55c7l4yXgGEk Gxatf9GZNvonO3ueUcIJWh8O48Rbfu/Z8r4F2uzkUW0RDhcNATZvnd3r1WDdwv+4e7zq beGM5A1EMzEqnlZGbQt0PmIb8kYFtAoOgE4VkaTkfTi+iAyMx2+ErMekW1euYcb9WCEe q4Qlu+3+snaFEPCS9yy+fRp1vTIc8PT7DqwG1eJCdKbPuqiItawm/RrYX4MgEzhSpaCu D2aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VBD9sojf; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si21946110pgi.99.2018.12.21.12.28.41; Fri, 21 Dec 2018 12:28:57 -0800 (PST) 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=@linaro.org header.s=google header.b=VBD9sojf; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390376AbeLUMgt (ORCPT + 99 others); Fri, 21 Dec 2018 07:36:49 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35854 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731197AbeLUMgt (ORCPT ); Fri, 21 Dec 2018 07:36:49 -0500 Received: by mail-wm1-f68.google.com with SMTP id p6so5561435wmc.1 for ; Fri, 21 Dec 2018 04:36:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=TBeYpA+ZER3k/7FfAniVy3+DDhg63t94WdSvWr+H9BM=; b=VBD9sojfwuff9TQd3cCRJZqV+/JLU472daO5wi/nmLsk1/qtxnXGa8nL1C3xrgIvf4 CokE6JYhoN1NMDqHXEx7CVSq3NztiYyoxzw+aWqpZqllRjqFVhTpMHUL6OSDBWzPfk1q 7OREXHISVJkfJsapbuZWmv3G7kxXFqt2uNQpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=TBeYpA+ZER3k/7FfAniVy3+DDhg63t94WdSvWr+H9BM=; b=IMfrh39ADAorfo4EtvehL3l+kzKcydhQLXhUn3mV5Uje1q9m4Hct3/sweih6aFrkri ci8FIVNJI3EBgoSa17ml3X3Jav4qMgGCE+Sv1i5WpALQXicYJGUu0IX6jyihSA+Bpia7 Rm8EuhfStaW46mRqBMgQe7csx7ZfBL7E6juzi0QmqpkuV9vubv0s0FwFfleHNcOt1NJ2 I2r/I2namfZo5LxMFB/KL4mydwEs/3qByNI19FPqzCNfAiqfdV8iw+d//qRO5s4KOVoR paxTMmRFBRXiCFjDVltn90neRu4unCnFkIO6Ixko9BModfabIarRswskn5wTY/a1up9Y kWnw== X-Gm-Message-State: AA+aEWZq1YAZ9trxb8XJIp93+RXVCDKajvawyVUt+zVDsN4hZwTkX5Vz Mwj+f6q1qCRLZOXJwnu7Nwa2aA== X-Received: by 2002:a1c:d74a:: with SMTP id o71mr2708065wmg.73.1545395807382; Fri, 21 Dec 2018 04:36:47 -0800 (PST) Received: from [192.168.1.2] (119.red-79-146-81.dynamicip.rima-tde.net. [79.146.81.119]) by smtp.gmail.com with ESMTPSA id k135sm17256615wmd.42.2018.12.21.04.36.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 04:36:46 -0800 (PST) Subject: Re: [PATCH 01/13] clk: qcom: gcc: limit GPLL0_AO_OUT operating frequency To: Taniya Das , robh+dt@kernel.org, mark.rutland@arm.com, andy.gross@linaro.org, david.brown@linaro.org, sboyd@kernel.org, will.deacon@arm.com, mturquette@baylibre.com, jassisinghbrar@gmail.com Cc: bjorn.andersson@linaro.org, vkoul@kernel.org, niklas.cassel@linaro.org, sibis@codeaurora.org, georgi.djakov@linaro.org, arnd@arndb.de, horms+renesas@verge.net.au, heiko@sntech.de, enric.balletbo@collabora.com, jagan@amarulasolutions.com, olof@lixom.net, amit.kucheria@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org References: <1545039990-19984-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <1545039990-19984-2-git-send-email-jorge.ramirez-ortiz@linaro.org> From: Jorge Ramirez Message-ID: <6814777f-1e5f-bd99-db63-a0050dcdd930@linaro.org> Date: Fri, 21 Dec 2018 13:36:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/21/18 12:19, Taniya Das wrote: > > > On 12/17/2018 3:16 PM, Jorge Ramirez-Ortiz wrote: >> Limit the GPLL0_AO_OUT_MAIN operating frequency as per its hardware >> specifications. >> >> Co-developed-by: Niklas Cassel >> Signed-off-by: Niklas Cassel >> Signed-off-by: Jorge Ramirez-Ortiz >> --- >>   drivers/clk/qcom/gcc-qcs404.c | 6 ++++++ >>   1 file changed, 6 insertions(+) >> >> diff --git a/drivers/clk/qcom/gcc-qcs404.c >> b/drivers/clk/qcom/gcc-qcs404.c >> index 64da032..833436a 100644 >> --- a/drivers/clk/qcom/gcc-qcs404.c >> +++ b/drivers/clk/qcom/gcc-qcs404.c >> @@ -304,10 +304,16 @@ static struct clk_alpha_pll gpll0_out_main = { >>       }, >>   }; >>   +static const struct pll_vco gpll0_ao_out_vco[] = { >> +    { 800000000, 800000000, 0 }, >> +}; >> + >>   static struct clk_alpha_pll gpll0_ao_out_main = { >>       .offset = 0x21000, >>       .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], >>       .flags = SUPPORTS_FSM_MODE, >> +    .vco_table = gpll0_ao_out_vco, >> +    .num_vco = ARRAY_SIZE(gpll0_ao_out_vco), > > Could you please help as to why this is required? This is a fixed PLL > and we do not require a VCO table for it. Hi Taniya, this patch - the additional information that it provides about the hardware - helps to select the right parent clock for a given frequency. On the qcs404 this clock is one of the two parent clocks of the apcs clock controller (the other one being the high frequency pll) When cpufreq sets a target frequency, there is an iteration through the list of parents to select the one that delivers the best match. When attempting to set the clock for an alpha_pll, the operation does a sanity check to validate that the requested frequency is in fact reachable using the vco range: trying to set a value that is not in range will fail. This patch makes sure that its range is explicitly defined. It also helps making sure there are no rounding issues when setting its value: without it the clock was being read at 799MHz > >>       .clkr = { >>           .enable_reg = 0x45000, >>           .enable_mask = BIT(0), >> >