From patchwork Tue Sep 30 21:37:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 38182 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0BB62032C for ; Tue, 30 Sep 2014 21:41:28 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id d1sf1936101wiv.10 for ; Tue, 30 Sep 2014 14:41:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:to:from:in-reply-to :references:message-id:user-agent:subject:date:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=0Qm2N8Nf9dm+KUxeASf716NhXUjw1m2fOvPBfaATWis=; b=MaFX2b8viuI5aTyt5Wz87pbTiR0s9ovwAwJUYX3RxfW4bnYbysY61uhnHI+Y1G2Vdb 1oIiv9hSHmPh9lWq7q+cKlGifdL3t/JQQGJJlo0iA0J+iJXsAvBDZdPeEhXyCVy+hu5H FCeXbkzp1t9IttsSFxilkut6d4ZVm7Fx5GJ2r1YMwTvhvGiznMcABSQfXtIJ5R1fsQha bt1b8SaBSXqmsZ6i+m8j2kuGyO7vOYSPSY4ctloAsmphzmz8nAL/X66mmOHlKofUD/OF R5OiIctCMeK4HjSE7/orhQvk0hA+x1Tt4U98CyXg0WFWJA0W+dmkJyzU73bntR25rWYE GHwQ== X-Gm-Message-State: ALoCoQn5mfZi87gosFhpouLGZa7ZgAcxH3PrXadFQomab97EeCIKFeap86IEylDXoh1VVELiwYZF X-Received: by 10.180.38.11 with SMTP id c11mr1356643wik.5.1412113287995; Tue, 30 Sep 2014 14:41:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.97 with SMTP id r1ls90814lar.84.gmail; Tue, 30 Sep 2014 14:41:27 -0700 (PDT) X-Received: by 10.112.182.42 with SMTP id eb10mr48011846lbc.7.1412113287801; Tue, 30 Sep 2014 14:41:27 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id zk2si24529779lbb.51.2014.09.30.14.41.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 14:41:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so3440067lab.12 for ; Tue, 30 Sep 2014 14:41:27 -0700 (PDT) X-Received: by 10.112.167.137 with SMTP id zo9mr18800815lbb.0.1412113287659; Tue, 30 Sep 2014 14:41:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp427962lbb; Tue, 30 Sep 2014 14:41:26 -0700 (PDT) X-Received: by 10.68.68.162 with SMTP id x2mr11434737pbt.40.1412113285659; Tue, 30 Sep 2014 14:41:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id u8si28078046pdj.122.2014.09.30.14.41.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Sep 2014 14:41:25 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ586-0006yg-IT; Tue, 30 Sep 2014 21:38:42 +0000 Received: from mail-pd0-f176.google.com ([209.85.192.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ583-0006ue-NW for linux-arm-kernel@lists.infradead.org; Tue, 30 Sep 2014 21:38:40 +0000 Received: by mail-pd0-f176.google.com with SMTP id fp1so6849744pdb.21 for ; Tue, 30 Sep 2014 14:38:18 -0700 (PDT) X-Received: by 10.68.143.4 with SMTP id sa4mr72037787pbb.5.1412113098312; Tue, 30 Sep 2014 14:38:18 -0700 (PDT) Received: from localhost (pool-108-47-66-231.lsanca.fios.verizon.net. [108.47.66.231]) by mx.google.com with ESMTPSA id nk11sm16061582pdb.40.2014.09.30.14.38.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 14:38:17 -0700 (PDT) MIME-Version: 1.0 To: Thierry Reding , "Maxime Ripard" From: Mike Turquette In-Reply-To: <20140929135358.GC30998@ulmo> References: <20140829141244.GH15297@lukather> <20140902092508.GR15297@lukather> <20140927235601.19023.31593@quantum> <20140929080637.GB12506@ulmo> <20140929092301.GC4388@lukather> <20140929101805.GB26008@ulmo> <20140929104454.GD26008@ulmo> <20140929113436.GA4081@lukather> <20140929135358.GC30998@ulmo> Message-ID: <20140930213753.19023.17605@quantum> User-Agent: alot/0.3.5 Subject: Re: [linux-sunxi] Re: [PATCH 4/4] simplefb: add clock handling code Date: Tue, 30 Sep 2014 14:37:53 -0700 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140930_143839_788556_040E0E0B X-CRM114-Status: GOOD ( 26.13 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.2 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.176 listed in wl.mailspike.net] Cc: Linux Fbdev development list , Stephen Warren , Stephen Warren , Luc Verhaegen , Hans de Goede , linux-sunxi , Tomi Valkeinen , Geert Uytterhoeven , Mark Brown , Jean-Christophe Plagniol-Villard , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mturquette@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Quoting Thierry Reding (2014-09-29 06:54:00) > On Mon, Sep 29, 2014 at 01:34:36PM +0200, Maxime Ripard wrote: > > On Mon, Sep 29, 2014 at 12:44:57PM +0200, Thierry Reding wrote: > > > > >> Plus, speaking more specifically about the clocks, that won't prevent > > > > >> your clock to be shut down as a side effect of a later clk_disable > > > > >> call from another driver. > > > > > > > > > Furthermore isn't it a bug for a driver to call clk_disable() before a > > > > > preceding clk_enable()? There are patches being worked on that will > > > > > enable per-user clocks and as I understand it they will specifically > > > > > disallow drivers to disable the hardware clock if other drivers are > > > > > still keeping them on via their own referenc. > > > > > > > > Calling clk_disable() preceding clk_enable() is a bug. > > > > > > > > Calling clk_disable() after clk_enable() will disable the clock (and > > > > its parents) > > > > if the clock subsystem thinks there are no other users, which is what will > > > > happen here. > > > > > > Right. I'm not sure this is really applicable to this situation, though. > > > > It's actually very easy to do. Have a driver that probes, enables its > > clock, fails to probe for any reason, call clk_disable in its exit > > path. If there's no other user at that time of this particular clock > > tree, it will be shut down. Bam. You just lost your framebuffer. > > > > Really, it's just that simple, and relying on the fact that some other > > user of the same clock tree will always be their is beyond fragile. > > Perhaps the meaning clk_ignore_unused should be revised, then. What you > describe isn't at all what I'd expect from such an option. And it does > not match the description in Documentation/kernel-parameters.txt either. >From e156ee56cbe26c9e8df6619dac1a993245afc1d5 Mon Sep 17 00:00:00 2001 From: Mike Turquette Date: Tue, 30 Sep 2014 14:24:38 -0700 Subject: [PATCH] doc/kernel-parameters.txt: clarify clk_ignore_unused Refine the definition around clk_ignore_unused, which caused some confusion recently on the linux-fbdev and linux-arm-kernel mailing lists[0]. [0] http://lkml.kernel.org/r/<20140929135358.GC30998@ulmo> Signed-off-by: Mike Turquette --- Thierry, Please let me know if this wording makes the feature more clear. Documentation/kernel-parameters.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 10d51c2..0ce01fb 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -605,11 +605,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted. See Documentation/s390/CommonIO for details. clk_ignore_unused [CLK] - Keep all clocks already enabled by bootloader on, - even if no driver has claimed them. This is useful - for debug and development, but should not be - needed on a platform with proper driver support. - For more information, see Documentation/clk.txt. + Prevents the clock framework from automatically gating + clocks that have not been explicitly enabled by a Linux + device driver but are enabled in hardware at reset or + by the bootloader/firmware. Note that this does not + force such clocks to be always-on nor does it reserve + those clocks in any way. This parameter is useful for + debug and development, but should not be needed on a + platform with proper driver support. For more + information, see Documentation/clk.txt. clock= [BUGS=X86-32, HW] gettimeofday clocksource override. [Deprecated]