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: 12428147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FFFEC4338F for ; Tue, 10 Aug 2021 07:40:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 163CE60F13 for ; Tue, 10 Aug 2021 07:40:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 163CE60F13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=56k0BGV168npnU/EFYwxr0cSKtCCV5cDw4I/euuoxMg=; b=1VOLxArY4I2Ek9 7hdbBNWFuOl5GWKhvgCjTqO0Jz4X6mxpgp/FvwSpIEh/WdCvi6wsH8rkAEurGg585itLT5CtO4oUP XFZYpi9qZm+T3ArFCK623pdG4B+UVBUco6x/52iUU/1+JGwi5Bu3xpoOIpVj/VD5TUkoKZvc7eiT8 hxjdTyuYtpayo5uzuXQcLQQtak+3Nx3cZX1ZCqKrg7M4Jml7jgJ0lm0jfhohLNQF7KxOCWkJGqulL SWJOMym4wEXw9rLQfXjZ/BpYc290y97XMhjkjJ3VNbWf3kZSIgeY/pBDYjUOiaLChxdn/tmgtqMwH J1SvEi7PdpWPYSc9rjEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMKq-002l35-DO; Tue, 10 Aug 2021 07:38:04 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMKK-002ksE-F2 for linux-arm-kernel@lists.infradead.org; Tue, 10 Aug 2021 07:37:36 +0000 Received: by mail-pl1-x632.google.com with SMTP id d17so19789264plr.12 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=KAIO0paEJZv3NJOShjz1n6fgYlJPqPC6260e9kdGUnS/2GzdAqQ2F3TSLdjtzJFEJ9 Z1SVBoF2vLZLwgpSuwIsYVPMgryKUUns5DdjnyUSqkZTh8O/tgGL9bRcX6TYlizuG6gM yDxBeV8/MbJnTRk+5rMT3nfJ2eYgLFhdQFUh8LJUECgRP4LtE604mni4zgllrhPEbG2d KwG6Pt9hUHSS73PtuQxdoUi5EswyDuGP+syeuxyR7xNcvDXTt/Js+F/wQ4ttPlUGWWAf dr6edAItIY0bCoKWfiITY9hkqSRyEWOHK4WgnCWmxVlpgZ8FzxfRtAmG5yK32/eOnSeH 24cA== X-Gm-Message-State: AOAM533A2fZnSPDZPKBdpQTYoiHKZn2ylIOaH50xABmnol5LpR5Aq25u uX3aucvrlQgLSleJbvCnom8C303p1m1ibg== X-Google-Smtp-Source: ABdhPJwVRmgoKnt3ij3/5KYJru9Y5sSV2ApKUBdMorjsp0bG8BMtxxQoHU07A2PF+eLCjDkZxSE+XA== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_003732_543525_C11ECA8B X-CRM114-Status: GOOD ( 14.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Lukasz Luba Acked-by: Sudeep Holla --- 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,