Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3701346pxt; Tue, 10 Aug 2021 09:22:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+fYcGf4zMgZY+EUyHgmq0R8FWccl+cTf2Fv2N/XuDPMt+fFIrcyNebaEI3rHPnnWMQL7K X-Received: by 2002:a6b:6319:: with SMTP id p25mr337874iog.100.1628612520167; Tue, 10 Aug 2021 09:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628612520; cv=none; d=google.com; s=arc-20160816; b=z62a5OtsCaofCfqP8Ru8RfyM4k9SA3sWbIrsnL5nO6KT8RGkjW6VRYjn18iNQ4BHVB OD5BZ/Z2KPAEzfkNiPIwhW9JMmhklA/ixKM5rdHCseTF2f64i1OObwKv0cgZoyliX1iv zpM8FMOPlOY5e6zFT64/cUAjGVQCxSLt162W3xKPtFWEVEekgt/kyneLIC6B53DEZBWH Ski+89/wyUaf+olil++ki764W0s7cF2hh1zc3oo4X7PHg7gJ0zrdCAu4/3IE7DQhOBMt oTHqnqVbqoa9SqYkmR+QUq5GllQDnt/V00IHs5/PqPJtj/jV0yVc052ZEly2h8giR7dC HUPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=o3fALPedc1JvnX88H1aP8PmEF4bNvz1EE7yNeTFj39w=; b=WhuIA14gSNwafCuiF058iuadRCHbVfv1RDVSNKBza5fMNvfK62Pfx/4kL0zxgWlRrS iOE2Sg36jH8pmtygoMygxGfDLPA/GXVEWx7tezVsdXxG0UgCKH6znUSnebI7HMgHKYGo ewendNwcYT+RLyDoLwBpPpea8pFaOIKfynI4TpJf7SkJlBGBURHSi5Uns5j46GTK2c1X CccH3ENbEUeAngmtsr/bikhlOexzkGOpl8d2p/IN8BDHK4VPjnuQ4vdmw40tPlkeEdsX T+NRYAPn972cRW2srOn6Od2JuEnvGt9GV9kdzbKO0Q6+K/Iw+AlvxJp7T5hTUuWwUUR6 st7g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si1199930iow.33.2021.08.10.09.21.28; Tue, 10 Aug 2021 09:22:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233429AbhHJK2T (ORCPT + 99 others); Tue, 10 Aug 2021 06:28:19 -0400 Received: from foss.arm.com ([217.140.110.172]:53114 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232875AbhHJK1A (ORCPT ); Tue, 10 Aug 2021 06:27:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D03FC6D; Tue, 10 Aug 2021 03:26:28 -0700 (PDT) Received: from [10.57.9.181] (unknown [10.57.9.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF7DD3F70D; Tue, 10 Aug 2021 03:26:26 -0700 (PDT) Subject: Re: [PATCH 6/8] cpufreq: qcom-cpufreq-hw: Use auto-registration for energy model To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , Andy Gross , Bjorn Andersson , linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <0b0d533988c3a4318b9fdc5e10c857348e203132.1628579170.git.viresh.kumar@linaro.org> From: Lukasz Luba Message-ID: <68aa4250-da98-e70a-2850-03d97f768b2c@arm.com> Date: Tue, 10 Aug 2021 11:26:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <0b0d533988c3a4318b9fdc5e10c857348e203132.1628579170.git.viresh.kumar@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/10/21 8:36 AM, Viresh Kumar wrote: > 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(-) > > 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, > Reviewed-by: Lukasz Luba