From patchwork Tue Jan 8 05:50:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajagopal Venkat X-Patchwork-Id: 1944021 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 77356DF23A for ; Tue, 8 Jan 2013 05:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750911Ab3AHFyo (ORCPT ); Tue, 8 Jan 2013 00:54:44 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:34112 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751348Ab3AHFyl (ORCPT ); Tue, 8 Jan 2013 00:54:41 -0500 Received: by mail-pb0-f44.google.com with SMTP id uo1so27597pbc.3 for ; Mon, 07 Jan 2013 21:54:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=uWh8XVG6d0wFxZY3mcjV6Ee0HoW1Bc3nZpGa3nmsC2A=; b=jlD64z4uZsnPvMvQnM6tSsIGwfeWcVvioS9WMI00uz6mkOCIGslH1gQuXG+Mkdcq/l ZWh7JdZ4511Fp6RpPzb4DM887Zvcp34nNEqV/zGPMA5iQq+O3nFIOHR2qGX1yepSu8PR 7NdJC94SwhNbQnPShRrWYbmFhzFSoPR84CihiYdKsapN6IbTrp5/OgKssQLrERt4ILdb zgdQw8YhrjJVqZHZTrtAfk2lCZDUGZtGWDCVM5EVJ1y5h4oZwF5C/wmP4Q534yU/+/Je /tevpzlsuL0cvIXTQm+WvXnzoJV+JOVwMclXQqen4PO20IBAGY9aySpi5vfYoy7Tzskg n5DA== X-Received: by 10.68.241.65 with SMTP id wg1mr197569436pbc.141.1357624480691; Mon, 07 Jan 2013 21:54:40 -0800 (PST) Received: from localhost.localdomain ([115.242.216.217]) by mx.google.com with ESMTPS id ty4sm38989248pbc.57.2013.01.07.21.54.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 21:54:40 -0800 (PST) From: Rajagopal Venkat To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, mturquette@linaro.org, rjw@sisk.pl Cc: patches@linaro.org, linaro-dev@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rajagopal Venkat Subject: [PATCH 2/3] PM / devfreq: fix stats start time stamp Date: Tue, 8 Jan 2013 11:20:38 +0530 Message-Id: <1357624239-13938-2-git-send-email-rajagopal.venkat@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357624239-13938-1-git-send-email-rajagopal.venkat@linaro.org> References: <1357624239-13938-1-git-send-email-rajagopal.venkat@linaro.org> X-Gm-Message-State: ALoCoQnnrAgBkNlMJlbc5JoN8wM9jJ3epvtWU6zwMsOUGUmGNU5JIBDvMp4IpDsEpZv29nY2D4jG Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Mark the stats start time stamp when actual load monitoring is started for accuracy. Signed-off-by: Rajagopal Venkat --- drivers/devfreq/devfreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 5782c9b..2843a22 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -254,9 +254,12 @@ static void devfreq_monitor(struct work_struct *work) void devfreq_monitor_start(struct devfreq *devfreq) { INIT_DEFERRABLE_WORK(&devfreq->work, devfreq_monitor); - if (devfreq->profile->polling_ms) + if (devfreq->profile->polling_ms) { queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms)); + + devfreq->last_stat_updated = jiffies; + } } EXPORT_SYMBOL(devfreq_monitor_start); @@ -498,7 +501,6 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) * devfreq->profile->max_state, GFP_KERNEL); - devfreq->last_stat_updated = jiffies; devfreq_set_freq_limits(devfreq); dev_set_name(&devfreq->dev, dev_name(dev));