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@linaro.org X-Patchwork-Id: 13900 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 268FD23E2A for ; Tue, 8 Jan 2013 05:54:43 +0000 (UTC) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by fiordland.canonical.com (Postfix) with ESMTP id CFC3DA18D3B for ; Tue, 8 Jan 2013 05:54:42 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id n11so29727vch.2 for ; Mon, 07 Jan 2013 21:54:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=uWh8XVG6d0wFxZY3mcjV6Ee0HoW1Bc3nZpGa3nmsC2A=; b=gVg1uQMfZUdLts6+th2TgSYzi8GH8Vqzt1vir5syrTbKijDEwuic2OyH70q3th5CT+ G9OBbdlTrxuIZSUKM9quiUcuveucMd9YUSSsUCjimMDqKDixG8FgqmKEykULsuos6py2 1piLTgt1n4mmhQLNMcmauuuDnd7TAl7jabcKoGhPDQzADIGmShazgCoyT5MHrQSEth4W hHtXj/h1bu7OgbJfVND1KeRMQ2K8XEEJ+becmekG9pJvoBIEo9wGF4Svqy4hSORSZ6OZ C0lKzMq+KTpZx5FnCo9Y4UDWJ90XfgH3avelg0m3GOcPadHfrtnpMJW/dey5Qi/iDloQ ffwQ== X-Received: by 10.58.196.196 with SMTP id io4mr88115480vec.22.1357624482269; Mon, 07 Jan 2013 21:54:42 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp95417veb; Mon, 7 Jan 2013 21:54:41 -0800 (PST) X-Received: by 10.69.0.40 with SMTP id av8mr195447781pbd.117.1357624481045; Mon, 07 Jan 2013 21:54:41 -0800 (PST) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id p7si61930471pav.79.2013.01.07.21.54.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 21:54:41 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of rajagopal.venkat@linaro.org) client-ip=209.85.220.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of rajagopal.venkat@linaro.org) smtp.mail=rajagopal.venkat@linaro.org Received: by mail-pa0-f47.google.com with SMTP id fa10so116838pad.6 for ; Mon, 07 Jan 2013 21:54:40 -0800 (PST) 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: ALoCoQk+G9afjmJNFkavecYI5IjGTUAgmAqEY10AwenpekIgcePak7yxz1kIT9ecBLyqds2PKcQk 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));