From patchwork Tue Aug 10 07:36:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494320 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3682817jap; Tue, 10 Aug 2021 00:37:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH76TjHM/SpF0PR3VkIydlBOLWoWClf+Krz+P65tlUL1qy3gICPlSlQEdklWSW8SrtRjVx X-Received: by 2002:a92:6408:: with SMTP id y8mr111034ilb.84.1628581029802; Tue, 10 Aug 2021 00:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581029; cv=none; d=google.com; s=arc-20160816; b=hFLzGRExDhT1BPTn8GnPktW2GHJdHp/N8818N575ojxsvaBKBSyiphMXfFxSuh9jAP ykvmWCTtAIjAd3FYuQVWbh3DoDeafJQyfOMxCfPkv/xB7LS0YduxCESjrHgOezfQLXFk 7X8Zxsi67PUlV+bJkHVHvqAo+v8m/2b9jLb5O8SI4KcV12wanRDlrySmBSLPr2omjDUy krZ0/D6M0FFoHeJdS193EjmbGBlb6VS9dM+uL2mfTEugNyzdxwe0EKUy5ifENc6ducWV WpAW1ehFMHVs6gF1dyiu8FnZoY3Yht3RouqRtNNFEakmB8SxTW9OgPywgyKz8NOqQ+N1 26TQ== 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=aZMnI+ITVBnBcneBIgvhNm4piucoB9ecl6DZQEqepNc=; b=j3N7C/GkYnpd5GrmL1mKFKnttWEr0ScIxPJOEcu+6z0fqN+vQ9SqKbJ+lvUVaB48jo WNmuLmDT7xYXgXJbk2zfDEQmnbLuEsS6c6UIFKBSre6aYRWC5pp7/UYRupzbSIXRBXMX /gsfsqR+6/za9ZM9KujVDwFFm23HZaJRWFux4Q9aQa/eH3M344u6fhQUKTpt1yzm69N5 mga7XjO0mkYwYgePHcGjKhLqLvjC9sAyDh3AXrwqDObiQbhLvg1etCtnKmER1qti51Rk p4z9RkCzzvJqqfYugK/GTuiIXGRY0NMgEde9sxxe5G2RL7PgzxOozVnG9I0VnhjltuTi 8kBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ussZDGKO; 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 i1si21482622ils.142.2021.08.10.00.37.09; Tue, 10 Aug 2021 00:37:09 -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=ussZDGKO; 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 S234992AbhHJHh3 (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234183AbhHJHh2 (ORCPT ); Tue, 10 Aug 2021 03:37:28 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685A3C061796 for ; Tue, 10 Aug 2021 00:37:07 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id pj14-20020a17090b4f4eb029017786cf98f9so4049482pjb.2 for ; Tue, 10 Aug 2021 00:37:07 -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=aZMnI+ITVBnBcneBIgvhNm4piucoB9ecl6DZQEqepNc=; b=ussZDGKOXX/2mkZH5nS13YeUAqSCGfAjQ1/Hs72syBDUyUK1jzDkKS8xsyVvLvyjE9 CIZjQNxPnkyuvb0DAV/4sxnkxL2IjezejN73dFjQ5l/W9fRT07jA2hTRbRGMlOyIMDJQ mLkaA21gaqA1IwLRHBAdu2MTsLg3uAOz2CRAbPc93WzsMjUc29tQKIDD8XvpNSo+s8zn njTVprhkFudNvMEhJskzmhUVJ/r9IkbGRzxKGwICtyK4pDZJetllqkLA6BhaAb+MC3fb VnNOojFgtp/C+bHo0FYwxoTnqF8lvywlatxLoFMZXm5vTs9xLaSAGiOl05ml64ADSrGj TAFQ== 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=aZMnI+ITVBnBcneBIgvhNm4piucoB9ecl6DZQEqepNc=; b=Gy4XWmYF0u1ifmyWjarF7MBvi9TA7mVW/zxacRNo9OOej9fwmK2nyIyvadwnZo4y3H UaeA6JU5sqbHOnnbPUbt8tiNOkYAEFvKSN4HMlThsdATWj53WdnQNon/r/pdPruJH+Zc dZoNjFlSMeTbx/fJJzzKPA8OOK32NNMIJxEOfegOqZgRpafVVipPOg4stNqdGUPwkM+t 8hCIHFVyL5FlID3a0mj+9WmUBUH4r23+S5YIi+iit5HOEa5C4CmieqDd4XyGJf4aU9Ib mFz23xrLlYWwaPw7yrzrDTlEJfPD6PyLEwZIxAenqyBM0gUXNe908gTqeY6qUF7nbKm9 FQfw== X-Gm-Message-State: AOAM532UJc7iYfgCkY51G3QQtwD5vX7ZgNAKXdCrEjbf3mcvzTQOMPiL 33zBmPUa2l8/atFA75ikcoQO+jcIVjCrMg== X-Received: by 2002:a17:902:70c6:b029:12c:c0f3:605c with SMTP id l6-20020a17090270c6b029012cc0f3605cmr23934208plt.70.1628581026997; Tue, 10 Aug 2021 00:37:06 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id a185sm5054759pfa.205.2021.08.10.00.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:06 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH 1/8] cpufreq: Auto-register with energy model if asked Date: Tue, 10 Aug 2021 13:06:48 +0530 Message-Id: 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 Many cpufreq drivers register with the energy model for each policy and do exactly the same thing. Follow the footsteps of thermal-cooling, to get it done from the cpufreq core itself. Provide a cpufreq driver flag so drivers can ask the cpufreq core to register with the EM core on their behalf. This allows us to get rid of duplicated code in the drivers. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 9 +++++++++ include/linux/cpufreq.h | 6 ++++++ 2 files changed, 15 insertions(+) -- 2.31.1.272.g89b43f80a514 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 06c526d66dd3..a060dc2aa2f2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1511,6 +1512,11 @@ static int cpufreq_online(unsigned int cpu) if (cpufreq_thermal_control_enabled(cpufreq_driver)) policy->cdev = of_cpufreq_cooling_register(policy); + if (cpufreq_driver->flags & CPUFREQ_REGISTER_WITH_EM) { + dev_pm_opp_of_register_em(get_cpu_device(policy->cpu), + policy->related_cpus); + } + pr_debug("initialization complete\n"); return 0; @@ -1602,6 +1608,9 @@ static int cpufreq_offline(unsigned int cpu) goto unlock; } + if (cpufreq_driver->flags & CPUFREQ_REGISTER_WITH_EM) + dev_pm_opp_of_unregister_em(get_cpu_device(cpu)); + if (cpufreq_thermal_control_enabled(cpufreq_driver)) { cpufreq_cooling_unregister(policy->cdev); policy->cdev = NULL; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 9fd719475fcd..f11723cd4cca 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -424,6 +424,12 @@ struct cpufreq_driver { */ #define CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING BIT(6) +/* + * Set by drivers that want the core to automatically register the CPU device + * with Energy Model. + */ +#define CPUFREQ_REGISTER_WITH_EM BIT(7) + int cpufreq_register_driver(struct cpufreq_driver *driver_data); int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); From patchwork Tue Aug 10 07:36:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494321 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3682921jap; Tue, 10 Aug 2021 00:37:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP1C2DkJVHZJpFLie9Pe1XHL/8PCHANiwQ5y9yDi+soKCW4X1cfnfiiCzEaJ5yJjSCGDhY X-Received: by 2002:a5e:da04:: with SMTP id x4mr123719ioj.199.1628581038456; Tue, 10 Aug 2021 00:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581038; cv=none; d=google.com; s=arc-20160816; b=JLyEm5z7+xbhrO/X5KuMIM+c2Fda4GxqJ94grtM+lj46kjxUwdWsqSGrl0ER9xjV5M HlZu4y4WR/MXr4nQ0S7tyLPU1GRhvI4kPY8UtfDdccHs66MIIhnuesVXglr3Y0zr+eVC 1vl2lTrm/RB679oP9hHI3ezMxFXhI9tuDL9Yq90LYujHdb1WmRz/RrPMsThrEEtZJrWl a/DWozf2UF4R4ju3KUFglacLHrjEfk0I+62QCgspDUEeyCk34bF2kzKZrWriyui0ZasO SuM0HW9GlEsm+mTQ0LWS4gaWmsjWV39OslcISSCIpaJj7E3+E0SbTwUWXGzANK8vfF7/ XcfQ== 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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=c0qeq4DAVtnTAW9Z1vLKy6rva/G+U2wJwVw1fPThrLaN186iBDc5fRA6MVg9hAa5in eqzmrtkNOfc8GEwBnCP2UrmPuMPzwn6HiuT4BvT+Zmh7bbuDh69ktRGFPy9+b75KRUuq j4yr6b/eDQrx2P1znPw+AoJKOie8v7sYYjvCfx6FcNaD3poQ9vTpYrhU0hnvsIetXt39 HLUr/rIUwxYUS4g0uaZSaGVgrZYvnLZ4vDEgeaI1HvUzS4xPNxJGBtvcP/vuG+eJa6bP g798p5e0pOkgPfuCrIdCKBPVNoQRZhBs/olsbZfziy1rI+utNz2yB3qoP+tQIwjYwe07 X6LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kn615fl5; 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 i1si21482622ils.142.2021.08.10.00.37.18; Tue, 10 Aug 2021 00:37:18 -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=Kn615fl5; 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 S233833AbhHJHhi (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235235AbhHJHhh (ORCPT ); Tue, 10 Aug 2021 03:37:37 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B44EAC061796 for ; Tue, 10 Aug 2021 00:37:14 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id j3so19817563plx.4 for ; Tue, 10 Aug 2021 00:37:14 -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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=Kn615fl51FeOD52lrtpgeS7SnpliWdUH/DpbmWYGWHk30G/nLAaMrllwgIn5weKJJC e5Jhdl9JeKyqspRiJ1kyUWv0qr/RxWMdiFtZnq269arO0CiT7hLub8mqmgBolBUvGgbN UVVVrZuv7+NYF5577lZCH+2wcgxlgAatlSl9AJeJW79wwirigzP/D3w5NLswTE+GCSGk DxPhctc5QEbB64l6CsM+7WK82AJK+8f7d2W+Q7OtzOgVemxGd+ejqT33WeJ9pzP4G7z2 455pT63z/E0vj2VhGPMIBs9bR6GhK+90AqBXrhy67N6mk0KmD8QeAMGKmAlJcxatlxfc 8txw== 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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=Q3uvjf3OqkaJMy/KT2wwNaFmut3o1+5OCv/HOMgFuh18NBkDmXyD1w9AF53eac59Cz 3cMAWDwEFGKk6gHaPtf0bxMt1p+RKO24Ie7i2Bjgnkta/oW87TeWq9/VfuCpK4t1OBk1 hMR+u4GSmTutNf52gd71FQP7MJaQ8UG2mUbjqkweWthjooCPM+9EvAqJP0O6nua5QsWo f6GON3kNCU6HhOL4lnHcP88DUktaJmGFtyW5bve7YkJT6mwu16qCE9enGh0oUZDwy+QZ UA6e89rAsm4kpEgv2q4parm7VqExWQOEVaIVTJnfLpFZt6Buo/6YUNF2mht59wYk5+OC n6nQ== X-Gm-Message-State: AOAM531cvDhrBcwy+tAKLPux7QaA78qzBZMhUgOSUgu8/EFR12Icx/zT MzS0IY83lR/RJKHwmKBQ3LKTAQ== X-Received: by 2002:aa7:8d94:0:b029:3a0:a513:e13a with SMTP id i20-20020aa78d940000b02903a0a513e13amr21899757pfr.56.1628581034296; Tue, 10 Aug 2021 00:37:14 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id hd21sm1912831pjb.7.2021.08.10.00.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:13 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH 2/8] cpufreq: dt: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:49 +0530 Message-Id: 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/cpufreq-dt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index ece52863ba62..b727006e85af 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -143,8 +143,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) cpufreq_dt_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs; } - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - return 0; out_clk_put: @@ -176,7 +174,8 @@ static int cpufreq_exit(struct cpufreq_policy *policy) static struct cpufreq_driver dt_cpufreq_driver = { .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = set_target, .get = cpufreq_generic_get, From patchwork Tue Aug 10 07:36:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494322 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3682931jap; Tue, 10 Aug 2021 00:37:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiTLSzEaU2GBmYSIc4cXsZp3ZLUCa1EBQ6BQV1NcAGpuLHq3EYmPhm/a5DhDCjyw9EILyK X-Received: by 2002:a5d:848a:: with SMTP id t10mr50959iom.82.1628581039434; Tue, 10 Aug 2021 00:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581039; cv=none; d=google.com; s=arc-20160816; b=pxCcFnyMYnO3j5yf9KMt/utOSbqLDQrKG7H04sKjPrVTV6lnFRBmBKqyPcxLiX1n1L TpgZ2QUp+uarjh+UJYIAK4guNhJz2vkdiLhHkMxgBnMYlDm+4YKCGdP/vTDqoSuyZsa5 bsi35ivyxMf0pi+cKCpvUuXAXVwdoFId0kwxdvc+xke8ebddVEfZoUJ/mYsQO4mo8jP4 K7ipkWBuXw5dWWvJd1UyxNoRmo2DlxA3cOGHp0ATKn6aE5m9S9JkWhTdQ1wYFBCXpgt/ 5S7uo6YfN6l7jhkQLRJzZszZqho2+E1/fYqjTBasu54zFXuwCTTquAUarNe3+zLfJA88 huWg== 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=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=A9o330JC/COyp/5iKq+07If63mV25LnlKKGCvOH5s9vD2eHZcdP7NwI1R5f9T+HzIJ vbT9lWh/04Hyc7RtrlyZ8XM9ydfTTVIgnLakaZUHDGxUg/VL3BQFzanVL6U7ttAjrfm6 UoFpWTW0585IZ1Prgh65M0xgIZx/mompz93glsWSELGnh7UfYb7JybDl4HQTlf/o3RTc Ir/YBgD7wXA9Y47pObmXrLx+Ig2u7JNWDxsv279JYUu5HaRmEi9b4xq7Jaamq5ZgL1gK vGL8DVRrZUdKRzWMqYinE6TDO4nmxl/EONph3sXZlGUnkkfVMD7f53aJUffkbvhQZjNl S6jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tDJZDgwt; 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 i1si21482622ils.142.2021.08.10.00.37.19; Tue, 10 Aug 2021 00:37:19 -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=tDJZDgwt; 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 S235322AbhHJHhj (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235248AbhHJHhj (ORCPT ); Tue, 10 Aug 2021 03:37:39 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B93EEC061796 for ; Tue, 10 Aug 2021 00:37:17 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id l11so8182795plk.6 for ; Tue, 10 Aug 2021 00:37:17 -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=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=tDJZDgwt6Zksre0+Hb84Oaba+GoGOFFnBNTSeFFbIxWMY/kmyer6CIsG5m8Gy1g4kk ZPUAYeVRYBtzn0FBsxM4HhlemFAWLIb56qQo4pQnz6c5f7xENOK6is2MpgB5M1+OBV+S 9Zm/29cSjLdXxi+vsEPSUIH6KgUXgXJsq0AylkYvvSZhObcjRBgiojCe/7Sj210pOp80 B+rZ+ivfcTLYlFni4Hj2lO6nKUPI0+ITlM7b3vSLzNp2txKbP/hwxM67bbsz45XYtwBD 0fFIr55WXt/JEs1cPOIdCNfXMztD8eqHJaqaBeHvwiddMhcl6kMq2iyk2VxenpTkoJfB SiDg== 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=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=hRWc78nMIkGwR2+wtSFDuRrYsu/I7pmf7ibLw30jsDrnzvWm3g7wB1BmhD++1uZO+A 89EdNKxh3BgDzBYCSHXUTibDWa+xDGgX8TAnsVuSv/XhEFrzE9Q6VZ3BOCJyVH+D1hqd oLrp+72LUQ9vlE+Y6TJyqIxWytl3wMvG8tR897CaDYquch0nFYcvbeyvE7/QGRN/s79E 2WGVrBLTBL7hjk4XGHKCquIFed3z8lPHhEae7/I0bjRt8x9FtIcWTEuxzCs+icDXouTj KOGS0YqFp03/MnPPmFs0aVkp2uG6txLeJPJcmmsvTCgxHaHXtV2Cwhnw2J8hKdGgha8T GeoQ== X-Gm-Message-State: AOAM533fuyyivTJ9+8yhkARKCm6g88jIct5SDjIf5sG4qpX6JNrno0/Y RKAj+r0kJXMNUaHsxYuzFnXXag== X-Received: by 2002:a65:5c48:: with SMTP id v8mr8527pgr.411.1628581037290; Tue, 10 Aug 2021 00:37:17 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id d9sm21546884pfv.161.2021.08.10.00.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:16 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] cpufreq: imx6q: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:50 +0530 Message-Id: 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/imx6q-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 5bf5fc759881..aa8df5b468d7 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -192,14 +192,14 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) policy->clk = clks[ARM].clk; cpufreq_generic_init(policy, freq_table, transition_latency); policy->suspend_freq = max_freq; - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); return 0; } static struct cpufreq_driver imx6q_cpufreq_driver = { .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = imx6q_set_target, .get = cpufreq_generic_get, From patchwork Tue Aug 10 07:36:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494323 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3683002jap; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmt/tD4bhqt3iH8m28TOaGPtkbClGh/sMBG8tPuZ3O6dgblYaxAyLJS7MBTzpGtaUMqi9T X-Received: by 2002:a05:6602:14a:: with SMTP id v10mr11551iot.36.1628581045378; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581045; cv=none; d=google.com; s=arc-20160816; b=qPEppBOxbJ/xQrwdvPOtH8SmoAP0gH6ps6AUdBL83kPnzv1lKpNV5DnwULdQ17zUon WYt2O6MhfxtsxPUEi8ix2+Sa9ufi3Aw/z0FemhXioGhqeF0V31aS4tnGUo6N6QaajwR1 09ZGXlWKlVaD4Kcxi38enlDgTj/i+NFyAKCpRpOS5548kmEdiECensvi1K5UsuUv9zW8 BwWq8vh3MUf/fDDLj0Z0OoVpENqM2xXrpsL5aO8siM7PiGbKlq5cGjem+vsK98e6+zjK nxYRo4pA1wnn+rP48J/5v8D+wgoLIdaWr43s7gdB+eyskquZK7NswaRbZAGlRuPNa1FU eRoQ== 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=iNVi1PJwomW2Lv5qQiFKSFJ6/Vv2aKjQw2zcbRmrKys=; b=nQpLHGIG1+7zkgTqqmv6n8HryHFsrowoZepL8qmO0KKMu6/YIPK8BwrpD43xX4cWV4 7oUXbH/uyqtEhiLWU+Um7E2HZ3VzaVSwElruRRTSH25CY+EtVWpS2/KVaYWXxPuIiNBI U6XdKlML9b4XNcgoAXKpiOY8Li8W8bXo2b1i4CKIjSV89Zv9fS3+8bPOmL3BiuAL9gxR y7txKNNfzRj1k2pOI1fiQV2PSYTfyu7ZAcXhunc0A57aLn+8c+W9EzJ6V9bdEsCU93Df jn+NV6+7pgyzeKmy988DhplaciXFp2DeC9XU1gAYMsTLMPkRlHvP9Ij+zDWdRCgjrXYh W23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GwAvGJKy; 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 i1si21482622ils.142.2021.08.10.00.37.25; Tue, 10 Aug 2021 00:37:25 -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=GwAvGJKy; 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 S235234AbhHJHhp (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235623AbhHJHhm (ORCPT ); Tue, 10 Aug 2021 03:37:42 -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 B7626C06179A for ; Tue, 10 Aug 2021 00:37:20 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id k2so19768088plk.13 for ; Tue, 10 Aug 2021 00:37:20 -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=iNVi1PJwomW2Lv5qQiFKSFJ6/Vv2aKjQw2zcbRmrKys=; b=GwAvGJKypx7dO1I0Quh1Zo3hfRBIgOhUAweuXo0i6JjHUCpYGk5+qJLXFbe9sLri1G P+WOkghCyhFndfyOID+H35Uf+VciyHQHnKrB9mVN4nbGeKfyEdpY8BXDBitOqCwCT+vx 6CPzpG4vziCrjzO+Eztlu7jvoOMBI3oJjZKJILfLpxpIti5cJDfztxNKCtRnIZPuCD5q /BXgfXm5gexBx65NWelA9VY40xpGcO1xQU0MUlbeavFYL4HzuseUcuPG1z8uX5Lan4mN nj/5Gd33SFntKjuHOTGtTXO+SXADQdhJczErFnA8sHspqZ4y92OoOV7Wq/gcjxhEIm1W RnCw== 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=iNVi1PJwomW2Lv5qQiFKSFJ6/Vv2aKjQw2zcbRmrKys=; b=OO1YmWxKKs1xzNCy8AWAy97HuJLtJWlsbyckVQ5Y3SotC2lf5T0mglXE7LRIw+hFUj bjXHBGSTwCLtxN+8Fd2E3y8y3ATKIwzIjvIVNsTawJvubyWYD/aHvKNE6wrFB6xEU++e 06HVk7n35a4pYTlaUH4fil2iE57dEbHTZaofasvRbLXr78uFrYtACqMceegGVXAo0PSs rWrsaUoF3F45A1wnuD+6Og6ZRwDJDBkdPkwEdwc9c2BmHLlpslr6ePX2zenCgTummYz9 L8BxQt3FxWkDNI5XyFvYB5ZhaOkebwRush3ehM443hGMhG9n6oIk0x++JFXOlkqjC7eu rkHQ== X-Gm-Message-State: AOAM53289Nz+s3J7pxwlHNTylQGmvVAfgGblaJhSM0ZfhKarEgH7EnkI d8NMSUZEhcycced0s/VdOGQEyg== X-Received: by 2002:a17:902:7144:b029:12b:24ce:a83c with SMTP id u4-20020a1709027144b029012b24cea83cmr5859162plm.54.1628581040292; Tue, 10 Aug 2021 00:37:20 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id 20sm28187764pgg.36.2021.08.10.00.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:19 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar , Matthias Brugger Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 4/8] cpufreq: mediatek: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:51 +0530 Message-Id: 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/mediatek-cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 87019d5a9547..4743f2e58b97 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -448,8 +448,6 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy) policy->driver_data = info; policy->clk = info->cpu_clk; - dev_pm_opp_of_register_em(info->cpu_dev, policy->cpus); - return 0; } @@ -465,7 +463,8 @@ static int mtk_cpufreq_exit(struct cpufreq_policy *policy) static struct cpufreq_driver mtk_cpufreq_driver = { .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = mtk_cpufreq_set_target, .get = cpufreq_generic_get, From patchwork Tue Aug 10 07:36:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494325 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3683043jap; Tue, 10 Aug 2021 00:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJu04VmM26wPHD2lvnCoJv1wVAcZyrfIRUvWFBfyiSezSwh/Cox2Bf+pQ9BrE7JqlWJTTr X-Received: by 2002:a02:b0d1:: with SMTP id w17mr25314756jah.1.1628581048608; Tue, 10 Aug 2021 00:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581048; cv=none; d=google.com; s=arc-20160816; b=yT/miQ4JTZQJNAnshh5+9Oj1NzWGNceN1Jl+YYuvdruMShjyiogqmAD3mZLh3huYUz A8t+Sek/LtFOG7neLbfPyVG+CYVTKVFrtkdPKsVKKHRPKcONJHx+CxnMicIfR1F7ToJg srkxaqb6il0eX/d3P6RGX6Wq+FPaS0f1cSzWxPzMD4j0jdwxhyTqnkcr99Um6FpYRqYC gASfyTeazWgjOHaZLUZF28/NJBlcFBB4hrABsITorJwizqdAKXMqOI2vNtNdWQKN1xXV JIh/gVOlam4HYY3ittAcMPnisyJSPIWsIedHVsG8sQ9Q2x7d3QmNrQWeCn52qg18QsLU 2JoA== 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=L1wUGUmm+RM+WFeAm1m0YDv4o3hsF8ZYP495ftWlyX8=; b=OHfNqLKLzMNeSz9uplGUoW/02oUTLBAR+YLxIwBztDRZUFDO0+cSc/1Yj4I/03ai5G T/x1qkR0tio/MrfP9Pmpy23iBzxTMe5wPcnpwVUp3REctpMU06JCbfJ0GisLM/VXbZXN hkkglISVXECPHDHYsFhcVE9RgOEZvZA/nURN/1z642IIh2k8ufSjVAE1AY6Wgu73Yv2A VyEfcI/5URTsmvCCBLtVUifIGwtae/dAp47P8M/JXo+HjHqGhKRJzApaplVkNxoSTgrw S8/tQwFQB8pAiYBmlp9q3AtxrGEZJG6JyGsIKNAklWAof31jV+wlrxnHcWRDv7m7/DcD Vdfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fk5tOWy2; 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 i1si21482622ils.142.2021.08.10.00.37.28; Tue, 10 Aug 2021 00:37:28 -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=fk5tOWy2; 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 S235980AbhHJHht (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236151AbhHJHhs (ORCPT ); Tue, 10 Aug 2021 03:37:48 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A095C061799 for ; Tue, 10 Aug 2021 00:37:26 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id j1so31853712pjv.3 for ; Tue, 10 Aug 2021 00:37:26 -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=L1wUGUmm+RM+WFeAm1m0YDv4o3hsF8ZYP495ftWlyX8=; b=fk5tOWy2yIUEWF2V3Hv2HPVQoMpXxyOfrZoZs5z9PCvwXNRxlF3y2dGoDt0fdKZps4 IbMw4UJUArG/kcdJj/hQW+gC6Fjc7Uy7Q7eXxGsHSKRS58gzOIq3mtjk+r1BP8frQ+hj XeJESYYtha+eG0XHEMuLWJVYKlLqw2C6DH3U0NEX8+CzlLWeqGbA89xPaGxK3NP6FPal VRk9tRzQSZNXBmH7YfJnPt25AUAe3B9Rnk41CoEwyyYTyz1QPVbLxvft0t1W/HyfLMMO 5SOEcRbNNj2U4+4IkR860KlCkU06v04ruyoOd6jqP7hmoIYdvDN1z6+rgLomaQPLmzGq SDBw== 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=L1wUGUmm+RM+WFeAm1m0YDv4o3hsF8ZYP495ftWlyX8=; b=sEFl5ebXJPI3BJUS7GcEJC6vXvyJpicWI8oUGVos6iydX5HXdRh44lJGB9W6D6RQeY muJi/ly5zkKYuUR2IlBUgoAR2sWQTo0YAg4/zR7G51+EnZXMVHoBtWPvVRa7HXFjgSVk 5sFtWSH5z+6Rj0aAax0lFbB0RLE1g1mbUCmOWF+mdtCRncphAx+yWhpPhcRft0KtA0oa k41QT35WVA65Lcdwk1WJRkIz29Sj/zNr85KGiTd47kdO7KDdr4usa3tU5/cvyCO7Oybg cGTmdXhYZ7eYyaGIsNUTG3T/B/Ibcn+6SAM//q/LdsJrNQxaGHm2q7tJJz8tSl6/ges0 oDig== X-Gm-Message-State: AOAM530Z37gknVFjN/enhHYGWbuUd3R84z6qudSp8eFFi9xZuGUgUtRb gyMdorAEwT2BWHaIp47FDpHYJg== X-Received: by 2002:a17:902:e746:b029:12d:1cb0:9649 with SMTP id p6-20020a170902e746b029012d1cb09649mr9705017plf.21.1628581045913; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id fh19sm1879612pjb.27.2021.08.10.00.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:25 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Andy Gross , Bjorn Andersson , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] cpufreq: qcom-cpufreq-hw: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:53 +0530 Message-Id: <0b0d533988c3a4318b9fdc5e10c857348e203132.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/qcom-cpufreq-hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index f86859bf76f1..221433c6dcb0 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -362,8 +362,6 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) goto error; } - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - if (policy_has_boost_freq(policy)) { ret = cpufreq_enable_boost_support(); if (ret) @@ -406,7 +404,8 @@ static struct freq_attr *qcom_cpufreq_hw_attr[] = { static struct cpufreq_driver cpufreq_qcom_hw_driver = { .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = qcom_cpufreq_hw_target_index, .get = qcom_cpufreq_hw_get, From patchwork Tue Aug 10 07:36:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494326 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3683088jap; Tue, 10 Aug 2021 00:37:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW1ieCvrwlBAn3hCpZ3LQqqdX1Lg7CzADyisJOncC8lRfh3bjSL14+2P5BmvMnr6fDjgy/ X-Received: by 2002:a5d:9ac1:: with SMTP id x1mr132620ion.191.1628581054458; Tue, 10 Aug 2021 00:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581054; cv=none; d=google.com; s=arc-20160816; b=cGbdXdJmwspbqwvIE3dy3zF6ELXlKH5gkXfHMg2g/YatyL3r/ZZUuWtbhlU0Qd2JKy fbVJ93xoKdrcDzbGIjcjZX6VIjKxqkC+0sGkGqKe+3rWi+/KDXW2M8sqw9b3ZqoTOCGP 6oaIFwlU8QK9uTOn/E3V2En7EsFpHotGixVB35414KcsTHNO4tZVvUCDjyH8MzP3KFam 3IN3CJpcqIpabSWwlNtotIIpOvGtfT0jxJAWEnDrs7Sd0gUAAXj+5Sm9apY6DNV9lWj9 dsQ0gfxpZ+kgDpNUXMCIYUnuh0khnyQvKIPaIhaNQPh67NzQ+JIKy6iNiZ20X0Kp5FRN 2oMA== 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=ZfMkvAhG2Hs471btmo38FaMbm1HPcKJf+JsWbgzrWXE=; b=Bps08BwmGyJEMko5l0DuCvo6+OGqKg0ftQq07KoYq0fBW+OnT9oPeQbygj7a6To/c2 cv3bhG9mGFlaQlfLQGK1ZkGm0lchNrLTU5D84U2QmhzkyWLW6sM3vOGLKZ1IXEkKh+34 QYLSivA6LvMTlYUEMEuZTG88S4YNeNjv70leUAmMEdNbER8Xv6skfOMr/XoWp8M8GpZl C5GBelH1E0o1eBh3zKF8PNa1C1t9ovunbgGXh6j774tv1F9ElBaVPfPUs82d9cXiZtwi auDsxmsutykzvDRTY4BCfbQlbZgypHd9FbF1gwEepj+2yNGCOzfc5RDoR3JckVgE+/Vv CIUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RAtnkgZs; 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.34; Tue, 10 Aug 2021 00:37:34 -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=RAtnkgZs; 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 S236239AbhHJHhy (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236398AbhHJHhu (ORCPT ); Tue, 10 Aug 2021 03:37:50 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25FFFC06179A for ; Tue, 10 Aug 2021 00:37:29 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id lw7-20020a17090b1807b029017881cc80b7so3077194pjb.3 for ; Tue, 10 Aug 2021 00:37:29 -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=ZfMkvAhG2Hs471btmo38FaMbm1HPcKJf+JsWbgzrWXE=; b=RAtnkgZsWRTD84WtL3JO7CI+pzY0OF/z53Kk7V0xgxfFx13n058ztE9BwxTIrkzGBp kPjaJwZtNjaez286r1aOCJlCckLdIT/Xabvn8IQzeoKtTPCVuKCk5XKT1HV4oAWn3giR f+5fyJ8sMJBf6chcUCNJVNFwRbchgZxHFQ4qzf+mAzal54DwBZAEz2M5BQuBztC4GD0N quQR6pB0kLmNWtPytvbOrNw5irDf0j1DEyTg/wt9eI9YM4aGd5c56yJJjNr1grv0gWdz ZbwBYHG5HcgDDDsZbsQoNLCHKnyKKB+AaVjwDrBw/B/r/Iz9jomLVUrqWg3E8AM08X08 jy7g== 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=ZfMkvAhG2Hs471btmo38FaMbm1HPcKJf+JsWbgzrWXE=; b=swpzJc33RjYD7jq+tzPWH+Lev/Co1L+YZMIxinD1vzRSruZyv6c4IRxFxmHw/MdCCb W2qYn9QaI5OgkNlnEynfFdTlytatogxL6/J6zwNhlLzeRnlZ3R+od6rEZ+HYMagQAnDO MNyRUfF+ePdVLx4mnwB1D3C/3s8oP5xiHPFtX3Ol528aqyiWaGlqa0NyfdXxPh13ImMh sq+iyHP/TwL9SkC3Jug8+PtsRXxBM9xhh26fAlI/SnEsnEW2AfCCiUFwd7GzGP5clMYi v0IXybbFE1fMUZ3RDg1p8+AGKtKmg5H25VI9CZjiJOda9iFvHyrc4W6nHKYbK/yu/BcY VbGA== X-Gm-Message-State: AOAM533AFyPCZxpRWuXQn/vmKc1OX0inCd19PTN/ZH8r9ItIA+INJjTN 5/5hghC46ns4N/TuIrATjDKUpu9OYPS3lA== X-Received: by 2002:a17:902:f541:b029:12d:27cb:832e with SMTP id h1-20020a170902f541b029012d27cb832emr6159878plf.22.1628581048705; Tue, 10 Aug 2021 00:37:28 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id j23sm1918452pjn.12.2021.08.10.00.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:28 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Sudeep Holla , Cristian Marussi , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] cpufreq: scpi: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:54 +0530 Message-Id: <7809d747fecbaad46699a178f26288a015055b20.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/scpi-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/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index d6a698a1b5d1..bc8c62b1beb5 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -163,8 +163,6 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy) policy->fast_switch_possible = false; - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - return 0; out_free_cpufreq_table: @@ -193,7 +191,8 @@ static struct cpufreq_driver scpi_cpufreq_driver = { .name = "scpi-cpufreq", .flags = CPUFREQ_HAVE_GOVERNOR_PER_POLICY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .attr = cpufreq_generic_attr, .get = scpi_cpufreq_get_rate, 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,