From patchwork Tue Aug 10 07:36:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494327 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3683130jap; Tue, 10 Aug 2021 00:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx/bPBa0kZJ9+/n9ZHQ3XSVDJRU1tRY2Hz7lpeuKnHJnW2LfPL9kydhd0y8P/vhJ+6Uu4L X-Received: by 2002:a05:6638:14d:: with SMTP id y13mr26438706jao.78.1628581057418; Tue, 10 Aug 2021 00:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581057; cv=none; d=google.com; s=arc-20160816; b=t8Go0osdOc4XEw4v1cy6xE6OjbNWg090vkw/anZdk8aAST+QwzCSefdF4kfPZ6SMn0 kkcDxXxvxPYxqKBk6NG3HP6BhO6iqAepGqHn8Ioj0eiOSUI0lMDbltuzQAZPBs3vbBIt 0UDoWyNI22RTQtNoBgPpWjHlj3/AvmTL+0KJsss8J6pM7AUGzQPq4fn1PPK+JR8kNRGo jZaJVvIleKkyWNd4uhX5j3lk+pradKKrUVkZGeMUq6jdkLjHBnPREJW8GPtYxPj1ca0P LmkQi9PorSj1CHccAs9R9B/TpTEZUaos1RZ9qTWPKD4Y7BjILyfRxeyzP/VO7QESEpnm FISw== 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=Mx8PXegL/QDVzFkJgVoUztKis2uzwkfmy+tkfYoEKCSg0XUcS8sdHe7yj9re7o5G4i F6zMiDqwkcQilnq6kIp1qPOgdos6MGQ5oeydEm0vMUYUgHk8hI00O0Ck+sFhxAnB3E4t NfastecQNJJzPmOiw/WrBf2y8hezKycRMyvY9WIVntUneZxSMlEvCv57kxNXs6Vp3p7c hSninqSlVFUrkarlVHC3QY8OmTUQyH5I89LOBAcJh/Fl2hVHNFiB5M4QSQy3uvK3v84I 0EF4NGeZQK8LpBWp2qcjB4mKYO66aj4KTV0ZHcUcvaGWe2SX9DwT3DMFsH6WcGu0+gnA Hm1Q== 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-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 j6si24762370jat.30.2021.08.10.00.37.37; Tue, 10 Aug 2021 00:37:37 -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=Nyujgk1y; 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 S236445AbhHJHh4 (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236702AbhHJHhx (ORCPT ); Tue, 10 Aug 2021 03:37:53 -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 D8471C061798 for ; Tue, 10 Aug 2021 00:37:31 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id lw7-20020a17090b1807b029017881cc80b7so3077322pjb.3 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=MTx+OskMadcBu1w80dWvJX/XoR3+QZ4mqgHJdsAlOtSLWeORsKwPCxHTRhTWPS23/h maydpaUf8UZoWyry8AxkafC9wdvSq9WeDH7rPZoMhfcZnewqnjSljYTdVRq4gZoxk+YG 7I3tsJew7MY7ilfLicbMD8h9Z+gFvFMtKjqnxuZ2s4CpfD0wrQXKPiYAODCJbIIX8rIH CkveQnCvub9roWrdbs+/gAINpL5od33ckYlCKsMMb/UPVi22Z33nSeHhyDF+xzuWGlao NVb778lyvMhPiY3M5PEMmUrYcvQRPzY1FeDkEWXAh6EWWjSCJePtSEzOArHOkZfV0ghA rCAw== X-Gm-Message-State: AOAM533zEV0jZQBmaDP5zKQ8XGAf/BTDpSSm668PUgjf+xhY35DVb9Af wR/i1XBqnpVc8lvJHsqTN7PEVw== 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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba Acked-by: Sudeep Holla 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,