From patchwork Fri May 8 08:10:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 6363371 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4893D9F373 for ; Fri, 8 May 2015 08:14:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E23120149 for ; Fri, 8 May 2015 08:14:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 440F920148 for ; Fri, 8 May 2015 08:14:35 +0000 (UTC) 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 1YqdOE-0004gU-0v; Fri, 08 May 2015 08:12:10 +0000 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqdOB-0004ej-Ix for linux-arm-kernel@lists.infradead.org; Fri, 08 May 2015 08:12:08 +0000 Received: by pdea3 with SMTP id a3so71408721pde.3 for ; Fri, 08 May 2015 01:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=eS8CxMBYDEaUzl3j6fuR+N16O9gVmgwNvhycHtI5D5s=; b=bJ35xaArgXqo0ZBGZt3AIW2G2XcQ1MFMdRfvxiuuLzhWpwk2viy5PGKlDwjl5Gg7hS tgYspTHFoM6swhzIYLEVvWRQaSisuVdAxBrVHsMSl0kJJIX+tb0YVw58h0fdGaAs4KAM r/ieHjLyhmPuViYkHf8qMwpgwaizgQQiM7QgIcMzWjCwwtz9iOe44sWhhVUQDcz3PrpN oSSOMBXw/3E5ely4Tg5MaM5XQaVHnJSAtMNewPZfVVs36iat4h4iZnxcoTns+q79qjfQ LMXMpLKw1spMXpphN4Q6mxoHcifecAhlv5Steo3vEbzYe94l16HF3e+bLNEYMvJg8+ad 8wBQ== X-Received: by 10.70.0.201 with SMTP id 9mr4618416pdg.4.1431072685999; Fri, 08 May 2015 01:11:25 -0700 (PDT) Received: from localhost.localdomain ([110.227.55.149]) by mx.google.com with ESMTPSA id x2sm4338803pdm.40.2015.05.08.01.11.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 May 2015 01:11:24 -0700 (PDT) From: Anand Moon To: Bartlomiej Zolnierkiewicz , Sylwester Nawrocki , Tomasz Figa , Mike Turquette , Stephen Boyd , Kukjin Kim Subject: [PATCHv2] clk samsung exynos5420 add CLK_RECALC_NEW_RATES flag to mout_apll and mout_kpll clock. Date: Fri, 8 May 2015 17:40:05 +0930 Message-Id: <1431072605-12234-1-git-send-email-linux.amoon@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150508_011207_664566_89B994EF X-CRM114-Status: GOOD ( 11.49 ) X-Spam-Score: -0.8 (/) Cc: Anand Moon , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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: , 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=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 Addition of CLK_RECALC_NEW_RATES flag to support Exynos5420 cpu clk so that correct divider values are re-calculated after both pre/post clock notifiers had run for mout_apll clock and mout_kpll clock. Below is the output of cpupower utility. Observation their is considreable improvement in cpufreq stats after applying this patch. Before this patch applied below is the output of cpupower. ---------------------------------------------------------- root@odroidxu3:/usr/src/odroidxu3-4.y-testing# echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor performance root@odroidxu3:/usr/src/odroidxu3-4.y-testing# root@odroidxu3:/usr/src/odroidxu3-4.y-testing# root@odroidxu3:/usr/src/odroidxu3-4.y-testing# cpupower -c 1 frequency-info analyzing CPU 1: driver: arm-big-little CPUs which run at the same hardware frequency: 1 2 3 4 CPUs which need to have their frequency coordinated by software: 1 2 3 4 maximum transition latency: 154 us. hardware limits: 200 MHz - 1.80 GHz available frequency steps: 200 MHz, 300 MHz, 400 MHz, 500 MHz, 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz, 1.50 GHz, 1.60 GHz, 1.70 GHz, 1.80 GHz available cpufreq governors: ondemand, conservative, userspace, powersave, performance current policy: frequency should be within 200 MHz and 1.80 GHz. The governor "performance" may decide which speed to use within this range. current CPU frequency is 1.80 GHz (asserted by call to hardware). cpufreq stats: 200 MHz:22.07%, 300 MHz:1.08%, 400 MHz:0.17%, 500 MHz:0.24%, 600 MHz:0.37%, 700 MHz:0.20%, 800 MHz:0.09%, 900 MHz:0.05%, 1000 MHz:0.02%, 1.10 GHz:0.12%, 1.20 GHz:0.05%, 1.30 GHz:0.07%, 1.40 GHz:0.04%, 1.50 GHz:0.02%, 1.60 GHz:0.00%, 1.70 GHz:0.00%, 1.80 GHz:75.43% (137) After applied this patch below is the output of cpupower. --------------------------------------------------------- root@odroidxu3:~# echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor performance root@odroidxu3:~# cpupower -c 1 frequency-info analyzing CPU 1: driver: arm-big-little CPUs which run at the same hardware frequency: 1 2 3 4 CPUs which need to have their frequency coordinated by software: 1 2 3 4 maximum transition latency: 154 us. hardware limits: 200 MHz - 1.80 GHz available frequency steps: 200 MHz, 300 MHz, 400 MHz, 500 MHz, 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz, 1.50 GHz, 1.60 GHz, 1.70 GHz, 1.80 GHz available cpufreq governors: ondemand, conservative, userspace, powersave, performance current policy: frequency should be within 200 MHz and 1.80 GHz. The governor "performance" may decide which speed to use within this range. current CPU frequency is 1.80 GHz (asserted by call to hardware). cpufreq stats: 200 MHz:46.57%, 300 MHz:8.18%, 400 MHz:1.93%, 500 MHz:3.51%, 600 MHz:2.13%, 700 MHz:0.88%, 800 MHz:1.69%, 900 MHz:1.02%, 1000 MHz:2.55%, 1.10 GHz:1.17%, 1.20 GHz:0.88%, 1.30 GHz:0.38%, 1.40 GHz:0.27%, 1.50 GHz:0.00%, 1.60 GHz:0.15%, 1.70 GHz:0.44%, 1.80 GHz:28.26% (95) --------------------------------------------------------- PATCHv2 Fixed the commit log with stats. Depend on https://lkml.org/lkml/2015/4/3/388 Tested on OdroidXU3 Board --------------------------------------------------------- Reviewed-by: Krzysztof Kozlowski Signed-off-by: Anand Moon --- drivers/clk/samsung/clk-exynos5420.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 462aaee..6c7458c 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -618,10 +618,10 @@ static struct samsung_mux_clock exynos5x_mux_clks[] __initdata = { MUX(0, "mout_mspll_cpu", mout_mspll_cpu_p, SRC_TOP7, 12, 2), MUX_F(0, "mout_apll", mout_apll_p, SRC_CPU, 0, 1, - CLK_SET_RATE_PARENT, 0), + CLK_SET_RATE_PARENT | CLK_RECALC_NEW_RATES, 0), MUX(0, "mout_cpu", mout_cpu_p, SRC_CPU, 16, 1), MUX_F(0, "mout_kpll", mout_kpll_p, SRC_KFC, 0, 1, - CLK_SET_RATE_PARENT, 0), + CLK_SET_RATE_PARENT | CLK_RECALC_NEW_RATES, 0), MUX(0, "mout_kfc", mout_kfc_p, SRC_KFC, 16, 1), MUX(0, "mout_aclk200", mout_group1_p, SRC_TOP0, 8, 2),