From patchwork Tue Jul 18 10:02:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeffy Chen X-Patchwork-Id: 9847499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E4FC602C8 for ; Tue, 18 Jul 2017 10:03:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BE8527FA6 for ; Tue, 18 Jul 2017 10:03:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40B3628542; Tue, 18 Jul 2017 10:03:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECF1F27FA6 for ; Tue, 18 Jul 2017 10:03:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbdGRKDB (ORCPT ); Tue, 18 Jul 2017 06:03:01 -0400 Received: from regular1.263xmail.com ([211.150.99.140]:46052 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751538AbdGRKC7 (ORCPT ); Tue, 18 Jul 2017 06:02:59 -0400 Received: from jeffy.chen?rock-chips.com (unknown [192.168.167.179]) by regular1.263xmail.com (Postfix) with ESMTP id 363504B93; Tue, 18 Jul 2017 18:02:55 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id A91E0389; Tue, 18 Jul 2017 18:02:53 +0800 (CST) X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <62ce78412e486cc784038d5efef3e220> X-ATTACHMENT-NUM: 0 X-SENDER: cjf@rock-chips.com X-DNS-TYPE: 0 Received: from localhost (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 91541F8XAE; Tue, 18 Jul 2017 18:02:56 +0800 (CST) From: Jeffy Chen To: linux-kernel@vger.kernel.org Cc: rui.zhang@intel.com, briannorris@chromium.org, javi.merino@kernel.org, dianders@chromium.org, lukasz.luba@arm.com, Jeffy Chen , Chanwoo Choi , Kyungmin Park , MyungJoo Ham , linux-pm@vger.kernel.org Subject: [PATCH] devfreq: simple_ondemand: Update devfreq stats when governor started Date: Tue, 18 Jul 2017 18:02:51 +0800 Message-Id: <1500372171-7194-1-git-send-email-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.1.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If governor suspends soon after started, it may not have the chance to update devfreq stats, which leaves devfreq stats' current frequence be zero. So when the thermal core tries to throttle the power, it would failed to get the correct static power of current frequence and print these warnings: [ 2.024735] core: dev_pm_opp_get_voltage: Invalid parameters [ 2.024743] mali ff9a0000.gpu: Failed to get voltage for frequency 0: -34 ... [ 2.026320] core: dev_pm_opp_get_voltage: Invalid parameters [ 2.026327] mali ff9a0000.gpu: Failed to get voltage for frequency 0: -34 Update devfreq stats when governor started to avoid that. Signed-off-by: Jeffy Chen --- drivers/devfreq/governor_simpleondemand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index ae72ba5..26e0e58 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -98,6 +98,7 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq, { switch (event) { case DEVFREQ_GOV_START: + devfreq_update_stats(devfreq); devfreq_monitor_start(devfreq); break;