From patchwork Tue Oct 22 10:17:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 177151 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp4639390ill; Tue, 22 Oct 2019 03:18:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7z4SKP2m0zSAYAO8zfISocyTbNrKJBwEGBwTqk39KWhoxpgUbZl1kERJLJOY90nzWMNIe X-Received: by 2002:a17:906:2ada:: with SMTP id m26mr26280913eje.87.1571739486638; Tue, 22 Oct 2019 03:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571739486; cv=none; d=google.com; s=arc-20160816; b=DIhFbrHMiF0rrcYusgsEh55HXeoN77zmWt37U0yyUEvtKV4LmyYZQxn8pYagApQ7QF d+j9c+MhcTfoVw7SwSwgII6xZRXYw1G19Fey9Zb6HgeDnVt5JLGhvd2ndziaYVfCWlRi aL9zfDxJVFRcg/Snp/RDPcZAC19RpokO17PqwsZLjSuLq2yTpwLBMwfbIQ7Rg+svsvWC nt63P28EXD1DV81tmI+O6VX+f8uve0FtmJYcro89nIG4eG2rVbRlDwZ9xmMWZU8BrxpL 4FOiWnomPAJpFz6zMtHN6b/YErqhYh9Nk938wEgNSn98iaQ27yfopRt6Hu97K2VJt3cS 5/mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HpkkrItQ+QjSSXD1R7+2N7PNQALjVcaxdlDmgQHtPgg=; b=Unli+FVBgp/VhFal93p/VxGhyXuADYg6ZYxLkEVkujnblkmN7Rw2YPJTc+Np2lpCqu vN6OwH6sIDSOhafazikvsigwwiF9UOy7h4qCT1j0ZyD1EW+mQFGh7TYLaGPTcSO72JqS 1Oa1Hku5k404Zxd3NWCEXBDJZuzmIOWG9tdt35uTfPiqndmi3kZBfcfSRAAjwGlCGiur 6OE1sjb0rBX8rfPL1WirY+/mK8y4Gw4f/eM6YYM+grclEJwZY+Gioq3l1UF7OFkUxqGP OxpgQqxeK3VhLBoy02lzPFH6M2UbnapYQBUOtpwTQR37XqGxNfH0UsF02RxrKw2r/y5J KVIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wxMNbwKN; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c36si5656404edb.58.2019.10.22.03.18.06; Tue, 22 Oct 2019 03:18:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wxMNbwKN; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730405AbfJVKSE (ORCPT + 10 others); Tue, 22 Oct 2019 06:18:04 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45215 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731753AbfJVKSD (ORCPT ); Tue, 22 Oct 2019 06:18:03 -0400 Received: by mail-pf1-f195.google.com with SMTP id b4so1436368pfr.12 for ; Tue, 22 Oct 2019 03:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HpkkrItQ+QjSSXD1R7+2N7PNQALjVcaxdlDmgQHtPgg=; b=wxMNbwKNAg8unVy4Cmds8Y8rrdJW1Z1gcgp6tTY6kM95cEY36ArDfsIgK+Y2Jdq59T Cng5f1tYOjcoF9LcXV6lZjlbK8jZMEaqxzu8N/7BWcRXrmFyFrbR8+aEIWoHoHmwaB6Y bSIvhA6jGg0xOoeOpSZSbenFJRa+6oe+xdWVXY5hq9ohDZFDBHJAIndIax1UKZJ/goh1 igUNe0mMij128BRtJjS7101BcDstkxo9OZJWIcTBpYr3XOT+le4jUomGT7EWXZuBfvAB 7g+cWJpwZM70TmEx3crq0dmzvT58vZvbC4R26e3gdKYfQw1vBMw0Ki8LgUTMu/3T3oaG WtMA== 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:mime-version :content-transfer-encoding; bh=HpkkrItQ+QjSSXD1R7+2N7PNQALjVcaxdlDmgQHtPgg=; b=oqHwAqBQWLBG+RGUujlHvOW0eSKaQFTA16IVyC+c02izSSZ0RxUanK9MFyMGYj2zNy rvhEIf5lax2N0lPUEjWQ30TcZ03eB7zvRhvwU6u47us5KrwHTcZFRbFa+EDUkq3NXiBL RiN90OjFo6VYEZIPGdMMKGCYbVEAr92v/BEaIh9oJLCKnHt+stzXLc5nCoB1cTeCTIw8 AHVc/5eULjVL9hoE57HLzwNmv1JsJ78RzelkBseKBFIM8ElFBn/BSczIn6vzfZdDuPYF MXBS/K8paZgi/5zmgAqEZLM1OhZI2jFefiWwJwmB1a7wwG51WFrWH1P3XLiEoUmaIFvZ bncg== X-Gm-Message-State: APjAAAWqg2mQoi/QbcQfNX2HHgQT/U45meu32O3dhECXT7hwBk90mEUB fThN4L6vRDHYBQU4V3Iw5xzqWg== X-Received: by 2002:aa7:8ece:: with SMTP id b14mr3399428pfr.205.1571739482892; Tue, 22 Oct 2019 03:18:02 -0700 (PDT) Received: from localhost ([122.172.151.112]) by smtp.gmail.com with ESMTPSA id q143sm19247365pfq.103.2019.10.22.03.18.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2019 03:18:01 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: Clarify the comment in cpufreq_set_policy() Date: Tue, 22 Oct 2019 15:47:57 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org One of the responsibility of the ->verify() callback is to make sure that the policy's min frequency is <= max frequency as this isn't guaranteed by the QoS framework which gave us those values. Update the comment in cpufreq_set_policy() to clarify that. Suggested-by: Rafael J. Wysocki Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.21.0.rc0.269.g1a574e7a288b diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2e698b5f0f80..b4b5f11c2f1e 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2384,7 +2384,10 @@ int cpufreq_set_policy(struct cpufreq_policy *policy, new_policy->min = freq_qos_read_value(&policy->constraints, FREQ_QOS_MIN); new_policy->max = freq_qos_read_value(&policy->constraints, FREQ_QOS_MAX); - /* verify the cpu speed can be set within this limit */ + /* + * Verify that the cpu speed can be set within this limit and make sure + * min <= max. + */ ret = cpufreq_driver->verify(new_policy); if (ret) return ret;