From patchwork Wed Sep 2 09:06:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 52959 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id E867822E23 for ; Wed, 2 Sep 2015 09:07:34 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf1430237lbc.1 for ; Wed, 02 Sep 2015 02:07:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=R+YKFkZfL7te+JqUwbAySIHj34EcITD4Oh9uoukUXsw=; b=X+QTHg+7l0aP92Cc8fz5gtIGd4/e3xofRrYCevZ/aOm4glcfmwLpEJP4PPo5Pu0W53 z3VlRZ1xKhubjg37MD9oUttF+QKM19v8oup0Ef98guJhKiIZo/UZH0MYk6ok3ZGuMKnz aPNyr5+q8gWxIEKW38/SGFLeDoncYrl7NY4uRxRk429yfmVSOqG2sySaAb8d1U/BT4df 8gy2XFY7lswEFOE0SIfb8BqJuBf+wmRmEj7fUhugPMADonqDhsU8AOlP2jYDm/nEuvn7 FDExXF1a29be2innguvYwJftullzjR+aZEHpT0yy34TwH8h/QEG3aWi4eRepoZsJ+Zv3 CKPw== X-Gm-Message-State: ALoCoQmIoEhuF7Ui6QSwuykEufVf+dSZZCC6Op4+0IBCN7CvzQxWkBJaiGVk43ot3WP7ux9Ybvil X-Received: by 10.194.57.44 with SMTP id f12mr3250739wjq.0.1441184853867; Wed, 02 Sep 2015 02:07:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.168 with SMTP id o8ls41304lae.47.gmail; Wed, 02 Sep 2015 02:07:33 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr15476733lag.86.1441184853678; Wed, 02 Sep 2015 02:07:33 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id bh10si19049963lbc.100.2015.09.02.02.07.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 02:07:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbpo4 with SMTP id o4so2226593lbp.2 for ; Wed, 02 Sep 2015 02:07:33 -0700 (PDT) X-Received: by 10.152.44.196 with SMTP id g4mr15352423lam.56.1441184853553; Wed, 02 Sep 2015 02:07:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp402366lbb; Wed, 2 Sep 2015 02:07:32 -0700 (PDT) X-Received: by 10.66.160.231 with SMTP id xn7mr474983pab.137.1441184852536; Wed, 02 Sep 2015 02:07:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pe6si34453431pdb.62.2015.09.02.02.07.31; Wed, 02 Sep 2015 02:07:32 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753706AbbIBJHU (ORCPT + 28 others); Wed, 2 Sep 2015 05:07:20 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36139 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753501AbbIBJHQ (ORCPT ); Wed, 2 Sep 2015 05:07:16 -0400 Received: by pacwi10 with SMTP id wi10so5059013pac.3 for ; Wed, 02 Sep 2015 02:07:15 -0700 (PDT) X-Received: by 10.67.15.36 with SMTP id fl4mr52756327pad.152.1441184835508; Wed, 02 Sep 2015 02:07:15 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id im2sm20832664pbc.34.2015.09.02.02.07.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Sep 2015 02:07:14 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , Lucas Stach , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/3] cpufreq: dt: Tolerance applies on both sides of target voltage Date: Wed, 2 Sep 2015 14:36:50 +0530 Message-Id: <4166ff63e1992adefd757cd3774e841e137024f9.1441184706.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Tolerance applies on both sides of the target voltage, i.e. both min and max sides. But while checking if a voltage is supported by the regulator or not, we haven't taken care of tolerance on the lower side. Fix that. Cc: Lucas Stach Fixes: 045ee45c4ff2 ("cpufreq: cpufreq-dt: disable unsupported OPPs") Signed-off-by: Viresh Kumar Reviewed-by: Lucas Stach --- drivers/cpufreq/cpufreq-dt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index b1131cf89757..3b64c203bf99 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -303,7 +303,8 @@ static int cpufreq_init(struct cpufreq_policy *policy) rcu_read_unlock(); tol_uV = opp_uV * priv->voltage_tolerance / 100; - if (regulator_is_supported_voltage(cpu_reg, opp_uV, + if (regulator_is_supported_voltage(cpu_reg, + opp_uV - tol_uV, opp_uV + tol_uV)) { if (opp_uV < min_uV) min_uV = opp_uV;