Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3314636imm; Tue, 29 May 2018 05:13:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLEQsY45sdfRNBwtfrYaSZBUwXc1nA/zUx44FUoli0lJvVbyvLh2mDrpPWF1t6SSZvmSxJQ X-Received: by 2002:a17:902:7d89:: with SMTP id a9-v6mr13260311plm.238.1527596027318; Tue, 29 May 2018 05:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527596027; cv=none; d=google.com; s=arc-20160816; b=b0dkQI/m7E9hVT89fr7qONORZQt0GFpPtECBCSRL4w79DS0x1ZN3iKQmAR3FCALSL3 NN+ZPgbXSG31B/7g8wh8CT0QSRNRCfFAencfmxvdzvKeP+GrvhbP3Hk4QKe5YXTN85hO pQqANOmS9HdH1/7CdCfwFC3lmBS99Elu7PxMhd8mK+YFq5YyG7F0h+HgX8RxQTebqRqC 7MjbZJ2S4nftkG//B8aMu3ZhPdlm2CqTE7bo8gXxvcgehk6oTd3B1dbV9OCCM5sCQi6m k/3kaNaXosu78kChy7lX7/XlFl6pPi6ZEt03C9f4L1J3qyfGC5wQWIWCqlOdfZxBTUgc zUPQ== 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:arc-authentication-results; bh=EYk2TxkA+MOdwhKKvTSRInBsD1VnbmM6NnKLef9JOHI=; b=xQNovTvvIk/A2PIuYGllUKzkFgKJaDLYvF/u01vnctOoKKz0Z2d+QEdouo75bCPX16 XK0QCwIoOS5OzhHx9KjQho6zGgcKAT7UOnGiGg7z2J2qEtOnlA6CD6FdSUrFeVsDa36y nqLzaz4y2OYe6rr2S8eXDBbgWVc8NgWThfeZMdMpMTJ/bX6IoPpmyMwuOhJnLbuTpZXL 7WACLgU1radz3r/VAoNyYpRMkv+NBjffEoA5aPWA4vnzO4P1xqZ/p3xGbYEWLMGbZcsd XCnJlFRs6jzmESIGjCyxd+mnrNBIkDbfQyncr/ygiJk6TTseuvO6KKirbr7eb4mhQiwA kwZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=dPZD4ZFN; 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 b17-v6si25232180pgv.196.2018.05.29.05.13.33; Tue, 29 May 2018 05:13:47 -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=@agner.ch header.s=dkim header.b=dPZD4ZFN; 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 S933949AbeE2MMm (ORCPT + 99 others); Tue, 29 May 2018 08:12:42 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:35470 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933793AbeE2MMh (ORCPT ); Tue, 29 May 2018 08:12:37 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 7FF6F5C01C2; Tue, 29 May 2018 14:12:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1527595955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EYk2TxkA+MOdwhKKvTSRInBsD1VnbmM6NnKLef9JOHI=; b=dPZD4ZFNCbrG1FO/X4zPDzbmMxXRgC0kjiyqp/5os1+3sCloNlwjjRPIv4schzNjcWaziM OQFie/dKxPm0gFPUPgc3T+WVa2JQnJCrwZ8l+5MlHocZYkKrO2JVNSuzRUBWdZihbcbhUb 9H3mTrmjUBGhQxCzsJE68vxjDXl/xvw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Tue, 29 May 2018 14:12:35 +0200 From: Stefan Agner To: Peter De Schrijver Cc: boris.brezillon@bootlin.com, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, thierry.reding@gmail.com, mturquette@baylibre.com, sboyd@kernel.org, dev@lynxeye.de, miquel.raynal@bootlin.com, richard@nod.at, marcel@ziswiler.com, krzk@kernel.org, digetx@gmail.com, benjamin.lindqvist@endian.se, jonathanh@nvidia.com, pgaikwad@nvidia.com, mirza.krak@gmail.com, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v2 4/6] clk: tegra20: init NDFLASH clock to sensible rate In-Reply-To: <20180529074804.GA6708@tbergstrom-lnx.Nvidia.com> References: <20180527215442.14760-5-stefan@agner.ch> <20180528075510.GQ6835@tbergstrom-lnx.Nvidia.com> <5665b799f763daa82dced238fb494863@agner.ch> <20180529074804.GA6708@tbergstrom-lnx.Nvidia.com> Message-ID: <90180dd9fc6e60175c54b9d70e50f0e5@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-3.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWELVE(0.00)[25]; TAGGED_RCPT(0.00)[dt]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:29691, ipnet:2a02:418::/29, country:CH]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29.05.2018 09:48, Peter De Schrijver wrote: > On Mon, May 28, 2018 at 05:53:08PM +0200, Stefan Agner wrote: >> On 28.05.2018 09:55, Peter De Schrijver wrote: >> > On Sun, May 27, 2018 at 11:54:40PM +0200, Stefan Agner wrote: >> >> From: Lucas Stach >> >> >> >> Set up the NAND Flash controller clock to run at 150MHz >> >> instead of the rate set by the bootloader. This is a >> >> conservative rate which also yields good performance. >> >> >> >> Signed-off-by: Lucas Stach >> >> Signed-off-by: Stefan Agner >> >> --- >> >> drivers/clk/tegra/clk-tegra20.c | 1 + >> >> 1 file changed, 1 insertion(+) >> >> >> >> diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c >> >> index 0ee56dd04cec..dff8c425cd28 100644 >> >> --- a/drivers/clk/tegra/clk-tegra20.c >> >> +++ b/drivers/clk/tegra/clk-tegra20.c >> >> @@ -1049,6 +1049,7 @@ static struct tegra_clk_init_table init_table[] __initdata = { >> >> { TEGRA20_CLK_GR2D, TEGRA20_CLK_PLL_C, 300000000, 0 }, >> >> { TEGRA20_CLK_GR3D, TEGRA20_CLK_PLL_C, 300000000, 0 }, >> >> { TEGRA20_CLK_VDE, TEGRA20_CLK_CLK_MAX, 300000000, 0 }, >> >> + { TEGRA20_CLK_NDFLASH, TEGRA20_CLK_PLL_P, 150000000, 0 }, >> >> /* must be the last entry */ >> >> { TEGRA20_CLK_CLK_MAX, TEGRA20_CLK_CLK_MAX, 0, 0 }, >> >> }; >> >> -- >> >> 2.17.0 >> >> >> > >> > Maybe better to specify this in the Tegra20 dtsi? See >> > "Assigned clock parents and rates" in >> > Documentation/devicetree/bindings/clock/clock-bindings.txt >> >> assigned-clocks indeed works just fine for this case. Thanks for >> bringing this up, will drop this patch and add the device tree >> properties in v3. >> >> Hm, interesting that none of the Tegra device tree make use of the >> feature so far. I guess there would be other cases where this would be >> useful as well (the one just above, VDE?). >> > > Yes, historically this feature wasn't available, so we used these init tables. > Unfortunately it's not easy to get rid of them for parent and rate > configuration, because new kernels should also work with existing DTBs, so we > can't just add assigned-clock properties and remove the existing table > entries. What we could do is use the CLK_IS_CRITICAL flag for all clocks which > are only enabled by the init table. For not yet merged blocks, this is > ofcourse not a concern. Sure I understand. Was just somewhat surprised that it isn't used at all yet (grep -r -e assigned-clock arch/arm/boot/dts/tegra* returns nothing). After all, assigned clocks bindings have been merged in 2014 :-) At least "clk: tegra: Specify VDE clock rate" merged earlier this year would have been a candidate already. -- Stefan