Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4142894pxv; Mon, 28 Jun 2021 23:28:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySmRY6MDDufXn8dFXA19BkAKwyR7YXkdw7dvzdCCoH8LrDBCQojKs+aqOYxSHEUdO2/27m X-Received: by 2002:a92:c5c7:: with SMTP id s7mr21468688ilt.129.1624948134884; Mon, 28 Jun 2021 23:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624948134; cv=none; d=google.com; s=arc-20160816; b=nbegRR3gKbup6A0FGlbqLJvRAhk36XVNY3nUMXTrJFijEgjUTQk5PglbiQIbJGQAsw FoD2wxM3ZuyXM/lJgyKVHW7VFUCUrLHh+maFA8BdmTX4L5zwaOXXbmoOgxerLbDZDO9n +yY6OG+pB7Cu8lLHkeVc+sVzrPzSb+hO5vElGDs22hXlm9mDRYGWAT3yA/9Rcuk+076+ TEqKq4TMwnOkizC5/Hh35GkLAmeGtruR5FnMOrM71QxZMhAO6Cd5TcwLxRsSwj41UhWH /hiAOGIfKRXn/KwRV/kMiMHrBA9VOI/AiTM6K3myAR6Vyy8yvJj5SN+SWToBjzB47Hju zvpA== 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=qpvt73psDhdHzZ6fenSdoH2WGxiLf8UaiuZK4LxkJRWlI0eHHYJ5Oq6/unkH8gr4KK HuIEEMtnoVxpm2+KpcZOieQOCtOOdFmYoppLhMKGGvZGyw2wkQPBVK6oSo/4ks8XngTK Vk/cvKChUXnepUzwd45UZaezqfi7StxVXDG9ZIlqLELy2btLQeicKzxt9DWTzV8QBxt1 RQPbBsyaFL2tNPJPwIvYETFDt2WxmDix3D4TuerpjMkXyqavVsoQe6Pullz0+p10lS6k 0T5jL1LxeTGUzZEY741tdaOBFcvdXaX399Avj7nwzkwfT03Axaf9Mon2/LLPxnpV+mfC CBxw== 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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 a11si10656818iln.136.2021.06.28.23.28.42; Mon, 28 Jun 2021 23:28:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S232041AbhF2G3p (ORCPT + 99 others); Tue, 29 Jun 2021 02:29:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbhF2G3m (ORCPT ); Tue, 29 Jun 2021 02:29:42 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97262C061766 for ; Mon, 28 Jun 2021 23:27:15 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso1350770pjx.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=nqFbYrz7JnscTqWcVZ5G5m1bNCPAhqn6rnCr8G2foZIO3ORlITROoj83OK8P/WBrvW kaoW11k4hwcrVu2vaNozwgJoueuyl6J8O9cfO1DfPMls+eBR0pm6c5I7nucVWtFYkX6v /Zwf6oUInzf33Tzpioevkoiis2H1egqQh2OLGDcjDzDbgRxmDllpw8edgW9piwdsamLd n6dJ9DIJ5lmfKElBpi6Toq/A1cO+7rMpgGwVjIwnHs2EiFhuF0yMtPDDe6pT8tug9edX AE/J+z4KlUS3y7g6Dvq5RhtXpJXzntFv4ES2F1a+BNa6j2PG3O2REmd3aBHfjq8EpFG6 bHgg== X-Gm-Message-State: AOAM532L8c8/IaH1LPGVifjVDIgKRvl7clBLPT2xQTDh13xsam/eTDtc +mgaiDocuxqTvoabK6kaVkz0LA== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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. -- 2.31.1.272.g89b43f80a514