From patchwork Sun Jul 31 00:04:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1023232 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6V055Y1001407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 31 Jul 2011 00:05:26 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QnJWZ-0005AA-32; Sun, 31 Jul 2011 00:04:55 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QnJWY-0007NU-16; Sun, 31 Jul 2011 00:04:54 +0000 Received: from mail-iy0-f177.google.com ([209.85.210.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QnJWU-0007NB-AU for linux-arm-kernel@lists.infradead.org; Sun, 31 Jul 2011 00:04:51 +0000 Received: by iyn15 with SMTP id 15so6550560iyn.36 for ; Sat, 30 Jul 2011 17:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Ivh409hv0Ba4saByFHKsXKPkqjD3SOLLgdFiw17b9Qs=; b=s9mthOOZJCUz90SWfg5QcoRvRqRoec5v8Ud84xcOjnoFDo8+jtSWS14wjs3pYHgrLc Se4KgxgWTZ7akBqPJ60F7Zi+9XrAAMnH8RUtv9BeNdNIjFcH4MSjtqX5ZjzrpJzgaWhq nWxKVIIadO7KwHAXtrxwPGKIwR/dwxxc6ulx4= MIME-Version: 1.0 Received: by 10.231.193.137 with SMTP id du9mr1887769ibb.136.1312070687436; Sat, 30 Jul 2011 17:04:47 -0700 (PDT) Received: by 10.231.13.204 with HTTP; Sat, 30 Jul 2011 17:04:47 -0700 (PDT) In-Reply-To: References: <96781d46e41fa6ffc04b88527a25d73f5a59eda8.1311936524.git.viresh.kumar@st.com> <20110730120740.GA15791@n2100.arm.linux.org.uk> <20110730130537.GB15791@n2100.arm.linux.org.uk> Date: Sun, 31 Jul 2011 02:04:47 +0200 X-Google-Sender-Auth: ReUVCQChXnWeqb19UHNRnSCgop0 Message-ID: Subject: Re: [PATCH 07/18] dmaengine/amba-pl08x: Enable/Disable amba_pclk with channel requests From: Linus Walleij To: Russell King - ARM Linux X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110730_200450_773592_E54066D6 X-CRM114-Status: GOOD ( 17.99 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (linus.ml.walleij[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: pratyush.anand@st.com, rajeev-dlh.kumar@st.com, bhupesh.sharma@st.com, shiraz.hashim@st.com, armando.visconti@st.com, linux-kernel@vger.kernel.org, vipin.kumar@st.com, vinod.koul@intel.com, amit.virdi@st.com, vipulkumar.samar@st.com, viresh.linux@gmail.com, deepak.sikri@st.com, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 31 Jul 2011 00:05:26 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter2.kernel.org id p6V055Y1001407 2011/7/31 Linus Walleij : > 2011/7/30 Russell King - ARM Linux : >> On Sat, Jul 30, 2011 at 01:07:40PM +0100, Russell King - ARM Linux wrote: >>> It may make better sense to convert this to runtime PM.  I suspect >>> that there's core support which the amba/bus.c can do to help in that >>> respect (eg, managing the apb pclk itself) so that we don't have to >>> add the same code to every primecell driver. >> >> Something like this for the bus driver (untested): >> >>  drivers/amba/bus.c |   38 ++++++++++++++++++++++++++++++++++++-- >>  1 files changed, 36 insertions(+), 2 deletions(-) > > I think the pm_runtime_* code Rabin put in place inside > drivers/spi/spi-pl022.c would play really well with this approach, and > just work, so: > Acked-by: Linus Walleij ..and while it will just cause some double refcounts on the clock, it makes sense to delete the pclk manipulation from the PL022 driver code as part of the patch, like this: Yours, Linus Walleij diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index eba88c7..4c4c02a 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -516,7 +516,6 @@ static void giveback(struct pl022 *pl022) msg->complete(msg->context); /* This message is completed, so let's turn off the clocks & power */ clk_disable(pl022->clk); - amba_pclk_disable(pl022->adev); amba_vcore_disable(pl022->adev); pm_runtime_put(&pl022->adev->dev); } @@ -1546,7 +1545,6 @@ static void pump_messages(struct work_struct *work) */ pm_runtime_get_sync(&pl022->adev->dev); amba_vcore_enable(pl022->adev); - amba_pclk_enable(pl022->adev); clk_enable(pl022->clk); restore_state(pl022); flush(pl022); @@ -2236,10 +2234,10 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) } dev_dbg(dev, "probe succeeded\n"); /* - * Disable the silicon block pclk and any voltage domain and just - * power it up and clock it when it's needed + * Disable the silicon block voltage domain and just + * power it up when it's needed. The AMBA core code will + * enable the pclk. */ - amba_pclk_disable(adev); amba_vcore_disable(adev); return 0;