Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp27084imm; Fri, 25 May 2018 13:32:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq+pN+IN9nqZ0MW+h8ZJdqTAcOMVx5R6e1/hUbJ+lrb/KUb2gym9rgCqw1HXs4kRDxhS5Rz X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr4163425plb.266.1527280323232; Fri, 25 May 2018 13:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527280323; cv=none; d=google.com; s=arc-20160816; b=p0vTuFYigbBUJFd6okJGsGhOGK3R24vWmbYZpkSTaa69zUR8QzFco39SdaTsCPUFmW sRS+urzhsM85VUD/nd2joCDEj4CEKeANxu3n4CJdewEuF1c0qcbw97Zku//ow1H9fGYl e6XjzOJ7fcykmtzkcoclRjFmaKmw4RwULvCAVJArBrVZlrzDiCEwTSDbUl9cqgjDnVlI GQQx+eVCj9mKMd73moASY4QnTKeBEN21FP27f1yldh4uVOtJFd83ykHXg7Jbh05VkSbi VeBo+z767P1/raUZlFRjTOK0ufKTb9QJUpZDEVaevr/C2nCXJpZotm5GFlthkIXhbdck V1HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ZuVHoDm8DRSQez9yZjT4vLwz8yPQlMYR6bI0D9dwIgw=; b=C7YQfWHBduRJ5Uovv6mpiVGjdtdsM/QDFKMTGh5E6BrM6vFxTjSsvYik9IxvldnyZX e+JSSr5NHtlbh4O+rSKYrdP8jOJAgGOvkIwaajBGScbZFtQwzI+oEe9h/T2na7qviQRQ TjENCXrt8lIEaiPrc3is84je2bl5d2SWtSCUfIeBiqR3EriRv0Ku2APKa9iJEmG40pSK BiFXX75gyQBEG1CehfZ1T/9Du6xIxeeTY1zgbos4lOQOGM9tnE+P5qFIxpou6pBiUb1M SkYIUFDI+3un5014mnbvaldM7JHKxv6P8A7uPMnHN/4ED+iVeHzSIvPvpyyq42y1lPfE iXCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12-v6si7594455pgt.175.2018.05.25.13.31.47; Fri, 25 May 2018 13:32:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030252AbeEYUbY (ORCPT + 99 others); Fri, 25 May 2018 16:31:24 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:43586 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968398AbeEYUbW (ORCPT ); Fri, 25 May 2018 16:31:22 -0400 Received: by mail-pf0-f196.google.com with SMTP id j20-v6so3082801pff.10 for ; Fri, 25 May 2018 13:31:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZuVHoDm8DRSQez9yZjT4vLwz8yPQlMYR6bI0D9dwIgw=; b=CfnFS3BSAhMOOXxW5aP/n7FOcuZekamFlr1Jfm2hUb3VZZzkkFRabFh/2lLyYAPPhS vhBdizQvqRCJSUBCmrDpUaf1UpApPtSjfEQt0q/EqqUCOcikFnN5AsrH35OAW2Vw0S0c a65YsKuOsSsLGCO57pQhX6cxqWpp/B5Ndi6o5JS7FpT9zFRcAD6K/d7IL8eF8CARuZIx 9cNkKLzR/1MMc1ph7Akidnsto6itrgRfXWIzTk6boEaMkG/ClhYtiyFgBxOeO0JcPn7X EHW5TND7BDyXPe9RppUdOrtDbd0blxI6QujEPpgM5zW31AEm7HsmGGFswk0HxFMj0GuT 8WPw== X-Gm-Message-State: ALKqPwfWqoHxVV2uIL/JymddsZHTnQy54dsVzPqkH1mcq4V5fMDFWWwV d3x9rr8voQUjSjl/+v0OzsOu5w== X-Received: by 2002:a62:d388:: with SMTP id z8-v6mr3275430pfk.8.1527280281705; Fri, 25 May 2018 13:31:21 -0700 (PDT) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id p1-v6sm42912360pfp.137.2018.05.25.13.31.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 13:31:20 -0700 (PDT) From: Matthias Kaehlcke To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Brian Norris , Douglas Anderson , Matthias Kaehlcke Subject: [PATCH 05/11] PM / devfreq: governors: Return device frequency limits instead of user limits Date: Fri, 25 May 2018 13:30:37 -0700 Message-Id: <20180525203043.249193-6-mka@chromium.org> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog In-Reply-To: <20180525203043.249193-1-mka@chromium.org> References: <20180525203043.249193-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The performance, powersave and simpleondemand governors can return df->min/max_freq, which are the user defined frequency limits. update_devfreq() already takes care of adjusting the target frequency with the user limits if necessary, therefore we can return df->scaling_min/max_freq instead, which is the min/max frequency supported by the device at a given time (depending on the enabled/disabled OPPs) Signed-off-by: Matthias Kaehlcke --- drivers/devfreq/governor_performance.c | 2 +- drivers/devfreq/governor_powersave.c | 2 +- drivers/devfreq/governor_simpleondemand.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c index 1c990cb45098..a8e3478b3c43 100644 --- a/drivers/devfreq/governor_performance.c +++ b/drivers/devfreq/governor_performance.c @@ -20,7 +20,7 @@ static int devfreq_performance_func(struct devfreq *df, * target callback should be able to get floor value as * said in devfreq.h */ - *freq = df->max_freq; + *freq = df->scaling_max_freq; return 0; } diff --git a/drivers/devfreq/governor_powersave.c b/drivers/devfreq/governor_powersave.c index 0c42f23249ef..8696efd32e5a 100644 --- a/drivers/devfreq/governor_powersave.c +++ b/drivers/devfreq/governor_powersave.c @@ -20,7 +20,7 @@ static int devfreq_powersave_func(struct devfreq *df, * target callback should be able to get ceiling value as * said in devfreq.h */ - *freq = df->min_freq; + *freq = df->scaling_min_freq; return 0; } diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index 3da7554b4837..805fee09c754 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c @@ -46,7 +46,7 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, /* Assume MAX if it is going to be divided by zero */ if (stat->total_time == 0) { - *freq = df->max_freq; + *freq = df->scaling_max_freq; return 0; } @@ -59,13 +59,13 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, /* Set MAX if it's busy enough */ if (stat->busy_time * 100 > stat->total_time * dfso_upthreshold) { - *freq = df->max_freq; + *freq = df->scaling_max_freq; return 0; } /* Set MAX if we do not know the initial frequency */ if (stat->current_frequency == 0) { - *freq = df->max_freq; + *freq = df->scaling_max_freq; return 0; } -- 2.17.0.921.gf22659ad46-goog