From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411AbcGNOb1 (ORCPT ); Thu, 14 Jul 2016 10:31:27 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:51656 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750897AbcGNObX (ORCPT ); Thu, 14 Jul 2016 10:31:23 -0400 From: Arnd Bergmann To: Michael Turquette Cc: John Stultz , Olof Johansson , lkml , "arm@kernel.org" , Stephen Boyd , Rob Herring , Pawel Moll , Wei Xu , Guodong Xu , Zhangfei Gao Subject: Re: [PATCH 0/2 v3] Add pl031 RTC support for Hi6220 Date: Thu, 14 Jul 2016 16:30:59 +0200 Message-ID: <5159238.dTvZjzNLNR@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-28-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <146834751937.73491.12265160509757545340@resonance> References: <1467247725-3665-1-git-send-email-john.stultz@linaro.org> <5612350.vuApcMIIUI@wuerfel> <146834751937.73491.12265160509757545340@resonance> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:83q/layuSfZ5MPW/5N/rKb7hBRitFDx3n9oXPwHVKDXAMVsgwD4 TXDU/jiTu5obLcop38/auRhVztDuG+J7QhqFYk3QMzv1YCGaVAt1epJSY7HefpnTgWw1hZ8 6ig4PnBs6GDQJXFWXAA+IO5ao2hnKIssDuCp7m5Eua91gZwRLMg/wnIZD+0W/nMuN75YfhC C8Tryut8hH9IgMR3K9thA== X-UI-Out-Filterresults: notjunk:1;V01:K0:cMP13H22swk=:zvyhbF1JwnbPneAQO/ZqOB XKwrhpiePCiwCcdeogE+bM1bHzsqKtyMacp8Uv8mSpCCJWTsU9uONkV9dIZZPiPPXoZRfC22K V47kzrC6nzwQuRdhtFxF/dNuJIBTKjxVaitTgbzjdqpXpoHpqBU6A42siEUi3fR1dwL6wqwi+ aS3HZbRcC/Yk/TlegbiK5NW515zn5GgwieUh9MV7+XwfYPriVrqswi3X8tTKn+EzU9M6F/4I/ qdRfUf8kHUppYVJVNPCXlHuDdtiD0BRNEHHZ/Ira7wsx5be439Z2rxt3fcBC/bH2F2ljlzGez CTHG8F60K7MuxWZe5D6Qpq8mjIYzDAhyfY3zdvUS2zmlTLCYLhGaRNa/wP4f3hW4Um7BGOGhS +7+EeP3v0Nuel7v8EDMryWGrnnBI+tLErYyqJJ6nxqQr7nCCy3YiYziGJBa5FE6glOWT+q3L+ t9C9MXrv9+YdnAXI80Vi/Zs2viF1beu7AWwikylJJsjMol1cBXsoQG9vjqrIsIifI+GYaWHPb 1TU8noKsEZVZKzdwP4oz1jaeZc+dH2FXUNUcF4Cu3zQNghhdKA947nMvJ+WhzbiddEloRAU3V UJst3vaM4eT3111326KCDE4Z3aDXLNV952uoSF5pv2yE4Eia7RcjMzCGxQ2xn9xBKap4nMdTn CNAHB43mVzNoLZM33iJfdRc86P79TDcsBUVtNco2KF4RES9oJ9E4EGbZJlQPOCOQ2byLcPSlJ aVrs9VLFni/dL0tv Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, July 12, 2016 11:18:39 AM CEST Michael Turquette wrote: > Quoting Arnd Bergmann (2016-07-12 01:51:36) > > On Monday, July 11, 2016 3:00:13 PM CEST Michael Turquette wrote: > > > Quoting Arnd Bergmann (2016-07-11 13:21:17) > > > > On Thursday, July 7, 2016 7:10:30 PM CEST Michael Turquette wrote: > > A similar problem is the patch below > > that was just added: what in the world does the clk driver care about > > the settings that the bootloader sets? If something comes from the > > bootloader, the driver should get it from the DT rather than hardcode it. > > Clock drivers are hard. Strictly speaking, any clock that is consumed > and controlled by a clock consumer driver in Linux should *not* need the > kind of hack you see below in the clock consumer driver. The best fix is > for a display driver to call clk_get() and clk_set_rate() on the clock. Makes sense. > However there are two examples of where this doesn't work: > > 1) There is no consumer driver (e.g. DDR) > 2) Support is coming for the consumer driver Some Day(tm), but we want > things to work for now. I have some vague memory that we talked about initializing clocks from values in DT at some point, which would avoid the need for hardcoding them in the driver. Am I misremembering that, or is it something that just never happened? > The hi6220 clk provider driver was already setting the PLLs, and the > patch below merely tweaks the chosen rate. That's why I accepted it. > Clearly it would be better for the PLL rate to set by the display > driver. Right, my comment wasn't about the fact that you merged this patch on top, but rather about the fact that the driver started out by hardcoding clockrates that are assumed to match whatever the boot loader sets. Arnd