From patchwork Tue Jun 29 06:27:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 468296 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4666417jao; Mon, 28 Jun 2021 23:27:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEzFqvXw8wtHLU7QfL8IDH8uy6WFCZeKBs76Mt2DdLp0cyBSKBgB+ZV67UsRfccF6VX7I8 X-Received: by 2002:a05:6638:190e:: with SMTP id p14mr2832239jal.70.1624948041827; Mon, 28 Jun 2021 23:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624948041; cv=none; d=google.com; s=arc-20160816; b=rhCN0sydGx/XNrRJuiABBKm+0vUqfIqeak3V6o+kRjnwIy3ymZBt7peFR4i+QQ0JCL KoLmJCIeNVwh76eoj2HYKhI2kOw3BSk5TCvCb1D8PSSZvJZN/ald6uJYNdY8hKflVt/E XguwT8UBjbl8wfEaOlL6p1olijUMBSS3RAtpsuAGMyaocXqYuBchD2JMxi/HQhu572Z5 usW5qvvW+ezoBsfZqQnpTTQ51nDNig41T6g33pERvWJm56fJj2zZ4VK59iWmAnFYUyPm jtyGxqpxX57UDqC8aP+wt43PWpKPSK42iJBD9BeCMe7yBx9WaG0EguzUxlx9KoWyZH34 CVKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HmWe9Vq21X/jj7YIMqM+Ctm/Lrcx68BGlGSe9RyB0yA=; b=0cdg1c21jcd1GIyEpmXDBR+dxiHYygzdgqHs0urozqZSYZOSeBRV1bYXkVGpYE5cgR G1wF4DOuHOxQGiPpK3xzsZHfPl1QesD6BSvKJkZSHHYFEsfzdQ4PsrM733q0yPOz0WiI qK9S2VfICi5t7VdwYxVBC3I8wV8jO0X+At4GEeG1Q25kfQdW2pld3SgjY91coNXabm8i Eq/Hdj+i9idMb7lkYVlgIsOzNjZsseyCAqj+r8hhY3pr2W5YgHNkFfC11EAVG9Cv9bjQ 0U7LBrtXQreWcHLQFMwX3DuZvPdN8EZzfq8LgfqZ3AnR1oZqvJesAO9uFbdhOgpiQeYI RlCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XQzjX7G8; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id t14si21310638jan.114.2021.06.28.23.27.21; Mon, 28 Jun 2021 23:27:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XQzjX7G8; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 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 S232126AbhF2G3r (ORCPT + 8 others); Tue, 29 Jun 2021 02:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232142AbhF2G3p (ORCPT ); Tue, 29 Jun 2021 02:29:45 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96598C061760 for ; Mon, 28 Jun 2021 23:27:15 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso1350769pjx.1 for ; Mon, 28 Jun 2021 23:27:15 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=HmWe9Vq21X/jj7YIMqM+Ctm/Lrcx68BGlGSe9RyB0yA=; b=XQzjX7G8XcUa1PnQduhgk9ecZYXbeD6UMiCM2ToFSNyNgUmZJH8eksfL1TIlf62zcX NfMJPjmrKVYJNeg/7Yhuu/BDz8YN8oBglqN0MHY4yOMr2sfYh0+LGbWh+q9VubeffoHF lYoEkYLbXHaE/jmGRH9drn0INiuonzvqrndJABwZpsUuctr5YtadyJ+Fg5/jAFp30mN9 dCjuaIXZQohOcf78pIlW8HwJyUF/udVzdWg2sJRSpoo1Gd5bMDYWdSvgnKJw4QjTHX3a tuGosY89PCEgJnoIWwRqdPvtUbpmd9DGmavsL/VSsrkYDZgoA8EgBYXsDtD5gEbThTIJ BS7g== 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:mime-version:content-transfer-encoding; bh=HmWe9Vq21X/jj7YIMqM+Ctm/Lrcx68BGlGSe9RyB0yA=; b=QzmI3k1Cq7+mHEWs5ws8mhGvSkf69wwQab/AKYsZJ8IdlVGdCLhqEGw0gI+Ge9TjxN 1DtPtdFer+msYJeDxdLAImZw6NPnpUsbv49jYFefqtEyWBMbBSj1O/F3OQL7UNEl9mNL QwqW+6T3dywhWhHFKek65POXkQ596/8AS9jdmzG368QFEbZfwHhrmxDIKkitE937jS2S sVmSthXcChHWha4lGfCbXWX1YkER2vnZ5Z9tPfFFJuF4gkp3FCuIJ+gEqU0/SRzio3DC pYuweKFLchG2+IK8mdF3mA69ht9owG0sTZh5wLZpbLFg3gMtW5tFAX0sIFaklXPZWNfb URHQ== X-Gm-Message-State: AOAM531pfnNvZ4pGr+458kuDYKvQZnEMXOFl3DaK3x3qEpyGpC5ItARt fkiuuqksSz/88UL25HTGiyQFOg== X-Received: by 2002:a17:903:1243:b029:ed:8298:7628 with SMTP id u3-20020a1709031243b02900ed82987628mr25923101plh.11.1624948035163; Mon, 28 Jun 2021 23:27:15 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id b126sm16705885pfg.176.2021.06.28.23.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 23:27:14 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Jonathan Corbet , Alex Shi Cc: linux-pm@vger.kernel.org, Vincent Guittot , TungChen Shih , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] cpufreq: Remove ->resolve_freq() Date: Tue, 29 Jun 2021 11:57:08 +0530 Message-Id: <759b9ad35a011e36f3b203fb01ac3d505269befa.1624946983.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org commit e3c062360870 ("cpufreq: add cpufreq_driver_resolve_freq()") introduced this callback, back in 2016, for drivers that provide the ->target() callback. The kernel haven't seen a single user of the same in the past 5 years and there is little hope that it will be used anytime soon. Lets remove it for now. Signed-off-by: Viresh Kumar --- Documentation/cpu-freq/cpu-drivers.rst | 3 --- .../zh_CN/cpu-freq/cpu-drivers.rst | 2 -- drivers/cpufreq/cpufreq.c | 21 +++++++------------ include/linux/cpufreq.h | 9 -------- 4 files changed, 8 insertions(+), 27 deletions(-) -- 2.31.1.272.g89b43f80a514 diff --git a/Documentation/cpu-freq/cpu-drivers.rst b/Documentation/cpu-freq/cpu-drivers.rst index a697278ce190..5ee49820d48a 100644 --- a/Documentation/cpu-freq/cpu-drivers.rst +++ b/Documentation/cpu-freq/cpu-drivers.rst @@ -58,9 +58,6 @@ And optionally .driver_data - cpufreq driver specific data. - .resolve_freq - Returns the most appropriate frequency for a target - frequency. Doesn't change the frequency though. - .get_intermediate and target_intermediate - Used to switch to stable frequency while changing CPU frequency. diff --git a/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst b/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst index 0ca2cb646666..f906a4e5a3ac 100644 --- a/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst +++ b/Documentation/translations/zh_CN/cpu-freq/cpu-drivers.rst @@ -64,8 +64,6 @@ 并且可选择 .driver_data - cpufreq驱动程序的特定数据。 - .resolve_freq - 返回最适合目标频率的频率。不过并不能改变频率。 - .get_intermediate 和 target_intermediate - 用于在改变CPU频率时切换到稳定 的频率。 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d691c6c97c79..b106191d84b1 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -527,22 +527,17 @@ EXPORT_SYMBOL_GPL(cpufreq_disable_fast_switch); static unsigned int __resolve_freq(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { - target_freq = clamp_val(target_freq, policy->min, policy->max); - policy->cached_target_freq = target_freq; + unsigned int idx; - if (cpufreq_driver->target_index) { - unsigned int idx; - - idx = cpufreq_frequency_table_target(policy, target_freq, - relation); - policy->cached_resolved_idx = idx; - return policy->freq_table[idx].frequency; - } + target_freq = clamp_val(target_freq, policy->min, policy->max); - if (cpufreq_driver->resolve_freq) - return cpufreq_driver->resolve_freq(policy, target_freq); + if (!cpufreq_driver->target_index) + return target_freq; - return target_freq; + idx = cpufreq_frequency_table_target(policy, target_freq, relation); + policy->cached_resolved_idx = idx; + policy->cached_target_freq = target_freq; + return policy->freq_table[idx].frequency; } /** diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 353969c7acd3..18f0ddf7347a 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -330,15 +330,6 @@ struct cpufreq_driver { unsigned long target_perf, unsigned long capacity); - /* - * Caches and returns the lowest driver-supported frequency greater than - * or equal to the target frequency, subject to any driver limitations. - * Does not set the frequency. Only to be implemented for drivers with - * target(). - */ - unsigned int (*resolve_freq)(struct cpufreq_policy *policy, - unsigned int target_freq); - /* * Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION * unset.