From patchwork Fri Jun 21 13:07:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2762851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6961A9F472 for ; Fri, 21 Jun 2013 13:08:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 578C22025B for ; Fri, 21 Jun 2013 13:08:42 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13A0520239 for ; Fri, 21 Jun 2013 13:08:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uq14v-00016r-My; Fri, 21 Jun 2013 13:08:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uq14t-0002MN-4E; Fri, 21 Jun 2013 13:08:35 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uq14o-0002L3-Iq for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2013 13:08:32 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MOQ00MMYV5JFKP0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2013 22:08:07 +0900 (KST) X-AuditID: cbfee61b-b7f8e6d00000524c-3b-51c45037aef6 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 3F.78.21068.73054C15; Fri, 21 Jun 2013 22:08:07 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MOQ00CHHV4WCH50@mmp2.samsung.com>; Fri, 21 Jun 2013 22:08:07 +0900 (KST) From: Sylwester Nawrocki To: mturquette@linaro.org Subject: [PATCH] clk: Handle CLK_GET_RATE_NOCACHE flag in clk_set_rate() Date: Fri, 21 Jun 2013 15:07:35 +0200 Message-id: <1371820055-14147-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNJMWRmVeSWpSXmKPExsVy+t9jQV3zgCOBBjN6tS3ONr1ht9j0+Bqr xeVdc9gsnk64yGZx+E07qwOrx51re9g8Ni+p9+jbsorR4/MmuQCWKC6blNSczLLUIn27BK6M gy2vmQoaOSpuLLrH2MB4nK2LkZNDQsBEYm3XD2YIW0ziwr31QHEuDiGB6YwSrT9OMkM4HUwS N372sIJUsQkYSvQe7WMEsUUEJCUefJ7OAlLELLCIUeLgm6VgRcICHhKTjz4CGsXBwSKgKrGv LwokzCvgJtF04AIrSFhCQEFiziSbCYzcCxgZVjGKphYkFxQnpeca6RUn5haX5qXrJefnbmIE B8Ez6R2MqxosDjEKcDAq8fAGKB0OFGJNLCuuzD3EKMHBrCTCG3wHKMSbklhZlVqUH19UmpNa fIhRmoNFSZz3YKt1oJBAemJJanZqakFqEUyWiYNTqoExO3e2f1D5coZmp8NHDvsIJB/T7GKb Pf+W0C4F3cVWnLovg8UeN7c/sbk03/MSi8pNdvcbLsXLnlkWnfR84uYguGfnZ8nIgFQfG9HX wc+sTrp4KNw497D03iW5yxIVC40nTjLTn/LLqrzrXfTTKW4P5Ss2bJWe+alWPiO0VW7xy7Jw 0cxkGUYlluKMREMt5qLiRADJ6Ce9/gEAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130621_090830_905238_E88E14F1 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -8.4 (--------) Cc: Kyungmin Park , Sylwester Nawrocki , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a clock has CLK_GET_RATE_NOCACHE flag set the rate needs to be recalculated, rather than referencing the cached value. Currently cached clk->rate is compared with new value to see if anything needs to be done in clk_set_rate(). This may cause required clock controller registers update to not happen when same clock frequency value is being set subsequently. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/clk/clk.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.7.9.5 diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 1144e8c..ffa304e 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1215,6 +1215,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) /* prevent racing with updates to the clock topology */ clk_prepare_lock(); + if (clk->flags & CLK_GET_RATE_NOCACHE) + __clk_recalc_rates(clk, 0); + /* bail early if nothing to do */ if (rate == clk->rate) goto out;