Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3748706pxt; Tue, 10 Aug 2021 10:23:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpIV1wzLeLM/iZtHdWhFTGjekFrfwzqE5X5rbmkTuxXR52lE7BBboDn9pgV/lcp1jzzo0E X-Received: by 2002:a92:ae03:: with SMTP id s3mr394299ilh.248.1628616200079; Tue, 10 Aug 2021 10:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628616200; cv=none; d=google.com; s=arc-20160816; b=0bHAyhWxZFcQ+9VmGHHrOaGkrP/UkZUACVv7HM8CwYcm0YQKFmOBAsmP1jZJqeRUTu tm8R9+vVJNrqiOaIJ76gRO3qJC6JH3aEpDENJdaaSK+ZIV3dTMBLSHN545hb+S7Jthzm 9An1rdBpHpnwmY7MPcuxYDSVL450jvNn966jNFLDMcodKtJlZS9u8b2ys2U8yRsWPlv1 PxsZKot+Lm3oTxr/Q5+2d80CviboQ4p0tAihI8vlfcL9YNrzagro0Ghf4JcCD2R+if08 4lbtaC0uh5IQzclCiLTo6PpoNo1iKrb4wp9hCULiNVke5QjN888B3fwYdCXcyLcRrEpY lCHg== 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=l68kJldkH2KjQav5eqqh261gLFdub2/I+QSqy0+of8A=; b=w6Xfxls95i1PRMSHWiFf3WQDRRp+MMub1tVJYv7Fwv5Nq9rye8LoZYOHRYq73kGv/n /tF1cusgtm/c+Hu+rffxm2O62Cn/xF4JNGwpF0mTIBRd4knY4eADxFLITxLlTEBQiGU+ 1l1hJom6hpB0Zz6xHC+3elJnR2UqZhxdNHU1aLi0T/WncyBSwk0ZSxV/PNSJfBhFgVi8 E4pkSgNyb4VtHeJBIYnJ6uet+guXjkLFAnkcsvf2IkDZOKGDszec0qQxv4ftYUxXBtCH iqzGxZiGZ/jGDY99Z6O7I02N4FhJrmEnNRZ4dJXEyKnC54w64yR7OL37Xqw/t9yKK8QY 8nMw== 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 v20si22576726jas.98.2021.08.10.10.23.05; Tue, 10 Aug 2021 10:23:20 -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 S239065AbhHJK2l (ORCPT + 99 others); Tue, 10 Aug 2021 06:28:41 -0400 Received: from foss.arm.com ([217.140.110.172]:53146 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbhHJK2D (ORCPT ); Tue, 10 Aug 2021 06:28:03 -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 D46286D; Tue, 10 Aug 2021 03:27:41 -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 C3A493F70D; Tue, 10 Aug 2021 03:27:39 -0700 (PDT) Subject: Re: [PATCH 7/8] cpufreq: scpi: Use auto-registration for energy model To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , Sudeep Holla , Cristian Marussi , linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <7809d747fecbaad46699a178f26288a015055b20.1628579170.git.viresh.kumar@linaro.org> From: Lukasz Luba Message-ID: <4db552cd-a362-13ab-194e-5117addd636f@arm.com> Date: Tue, 10 Aug 2021 11:27:38 +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: <7809d747fecbaad46699a178f26288a015055b20.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/scpi-cpufreq.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > 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, > Reviewed-by: Lukasz Luba