Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3366076pxt; Tue, 10 Aug 2021 01:44:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD+kr7Wn/2eFImdXarb7uJW8WYs/OKQf7RG6mAfvmMDCyIyLE0M7uXiQ2h6Z6r0+Xo8WDz X-Received: by 2002:a17:906:4f97:: with SMTP id o23mr26857714eju.418.1628585079175; Tue, 10 Aug 2021 01:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628585079; cv=none; d=google.com; s=arc-20160816; b=de40HEVwGnzwroVK9sJiONaCFFPMKFG9Uwx3a2awfRFD9zl/sAMN85dXjUBbv/q8jH mYBgq/cd7IeyI8qwIwii60Gg5Uu42COv/E4GCjcReNonc4VxJGChoXbFUtYsb7ZWMAVH wN49r58XkR84g6T27uY2WFk5djAXWX2wzvsbdcMAzsDUrooljzZLAY9t7aj0fsIcW2lz SmgsXgxwWTiA60PoWb3MMwWqY0sI2YkaIX2fvKD+CYYvRx5Vwx0CJGTxdSQVAJkQItA4 lB/VsIOg1g9xwQkz5L42vHwr062tdqo03hw3622TUWgpSS+iqCIbB5TXLjRUw+2dM28/ FvSg== 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=S0ESkgRNa4vkozA2GQvSw915d4fLi0hlNoHicBPRN6s=; b=c/T0TmstDaPBQtItS5RGW/i4bP/icBiE5Yc9g1tpUE6HniHLO+ZIWrClJBkoTGXzlv eYxm4kgOA/zdNvZOX5VIpH+eb1f8BeXDYeoby36XNZOklhNW+uNVPy76DZ5FCMQSLoV6 Z/+wL3TPggiq/p563sW/BZxPMBsaa9iiNZQlgyrlXVg4aiPPRN/obTQAmEyI1mDYNn0m Pj4rGh/R+pT9IEG5MZaiuB1IxtWsmhwSN2Qzyv2061qKolPinuaGvTOHOB5/050LXv2F l+5btd928Vc9b5kZT2j37TlZnYfjcxoTgtXPECU9RYxhLuHtNTd3VF0/RWTGlW9mLVpL Ju1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nyujgk1y; 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 de57si24709650ejc.433.2021.08.10.01.44.14; Tue, 10 Aug 2021 01:44:39 -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=Nyujgk1y; 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 S236398AbhHJHh4 (ORCPT + 99 others); Tue, 10 Aug 2021 03:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236680AbhHJHhx (ORCPT ); Tue, 10 Aug 2021 03:37:53 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D95C061796 for ; Tue, 10 Aug 2021 00:37:31 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id q2so19795305plr.11 for ; Tue, 10 Aug 2021 00:37:31 -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=S0ESkgRNa4vkozA2GQvSw915d4fLi0hlNoHicBPRN6s=; b=Nyujgk1yu+B3QJtPf5p7mSBmBFCEaQpPsLB59ms9WRoRqV3eLEa842gRWTBEv2X1U9 DHA9hNmS8GqvMQpR9KcSDwQctHDJvWygUdbdyvUwIH39Qrl56Gv2LQAFWty1biwLcA0J G0lWIQpVq5raGE8mPlFoc0Dr0x3dhAUUE+J5ja+wEgxMVjirZjxt2GMMq3/4G5g8r/+G +/a4XwLO9LfacMwqbUusG6SKOWuGz37wADkRImTe7GlkGCF98b6tqr3orw8QMocBaF88 IrSwTVMYqvBxotei9lxjwdLUcqk1ovA3aj3bEUfdo4IGlDXf1JyM76tcRYC0LwL7jvDb VPZQ== 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=S0ESkgRNa4vkozA2GQvSw915d4fLi0hlNoHicBPRN6s=; b=te7+olPEtHesOpQ8zhIldAFRXsz+8pTxugNbDEHmTnSAWDSkg+88SebLAeVXWNYw8d sgKaYAE7quKAJJaIrlWQ21iMrd/cLL5qCwfOzyXdKQwQwMRv1i5zY7ZH1kd04NS/wx99 gXrZEBp+QQayFqNvl6lbVkJa5Ym/Oau4qCbvWiqoitJn97KLJgmUmBBB0dTEu1ncS6MK CRqPiH6rtDOAcfZfeovylTg5clv3uRmHbLScCmwCD1MSpxN6qspsWXWSpOhSop508HHg dyoA6eaT8M7dw5fOaKQZ2KE/sVOcIljKF1SOj5GaCsVaYV95FoQm7FZuIpHOGAZLJ4wU xEyw== X-Gm-Message-State: AOAM533zCLFM3YrAIgAJhJ3HDx+sDFPWknCi5Jv0nFKhfQyz3RBaJ7fR UDf+fxU3UORYYTd4u3Ldc437xA== X-Received: by 2002:a17:90b:4c03:: with SMTP id na3mr3445658pjb.222.1628581051473; Tue, 10 Aug 2021 00:37:31 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id q1sm23396172pfn.6.2021.08.10.00.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:31 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar , Sudeep Holla Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 8/8] cpufreq: vexpress: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:55 +0530 Message-Id: <87fecd84e3f6ff6f153be14b0d53de93c0b04ae6.1628579170.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the CPUFREQ_REGISTER_WITH_EM flag to allow cpufreq core to automatically register with the energy model. This allows removal of boiler plate code from the driver and fixes the unregistration part as well. Signed-off-by: Viresh Kumar --- drivers/cpufreq/vexpress-spc-cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c index 51dfa9ae6cf5..28c4c3254337 100644 --- a/drivers/cpufreq/vexpress-spc-cpufreq.c +++ b/drivers/cpufreq/vexpress-spc-cpufreq.c @@ -442,8 +442,6 @@ static int ve_spc_cpufreq_init(struct cpufreq_policy *policy) policy->freq_table = freq_table[cur_cluster]; policy->cpuinfo.transition_latency = 1000000; /* 1 ms */ - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - if (is_bL_switching_enabled()) per_cpu(cpu_last_req_freq, policy->cpu) = clk_get_cpu_rate(policy->cpu); @@ -487,7 +485,8 @@ static void ve_spc_cpufreq_ready(struct cpufreq_policy *policy) static struct cpufreq_driver ve_spc_cpufreq_driver = { .name = "vexpress-spc", .flags = CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_NEED_INITIAL_FREQ_CHECK, + CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = ve_spc_cpufreq_set_target, .get = ve_spc_cpufreq_get_rate, -- 2.31.1.272.g89b43f80a514