From patchwork Fri Mar 22 07:16:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stratos Karafotis X-Patchwork-Id: 2318261 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 117C9DFE82 for ; Fri, 22 Mar 2013 07:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933131Ab3CVHQk (ORCPT ); Fri, 22 Mar 2013 03:16:40 -0400 Received: from sema.semaphore.gr ([78.46.194.137]:54462 "EHLO sema.semaphore.gr" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932853Ab3CVHQj (ORCPT ); Fri, 22 Mar 2013 03:16:39 -0400 Received: from albert.lan (unknown [79.107.237.156]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: stratosk) by sema.semaphore.gr (Postfix) with ESMTPSA id 9039582C64; Fri, 22 Mar 2013 08:16:38 +0100 (CET) Message-ID: <514C0555.1010806@semaphore.gr> Date: Fri, 22 Mar 2013 09:16:37 +0200 From: Stratos Karafotis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: "Rafael J. Wysocki" CC: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH linux-pm] cpufreq: governors: Fix calculation of wall time in get_cpu_idle_time Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org With commit 8755a8ae31ba213db196324011a0da2a85807f25 the wall in get_cpu_idle_time is not calculated, when we use ondemand with io_is_busy = 1, preventing the CPU to increase to max frequency. Properly, calculate wall time when we use io_is_busy. Signed-off-by: Stratos Karafotis Acked-by: Viresh Kumar --- drivers/cpufreq/cpufreq_governor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index b49d45d..41e5e56 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -53,7 +53,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall) u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy) { - u64 idle_time = get_cpu_idle_time_us(cpu, NULL); + u64 idle_time = get_cpu_idle_time_us(cpu, io_busy ? wall : NULL); if (idle_time == -1ULL) return get_cpu_idle_time_jiffy(cpu, wall);