Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3562617pxt; Tue, 10 Aug 2021 06:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt1+0zkD2DnX5Ewk0VeDRn0hZIyBfY4IJJIt8C23aGZ1nTM+HE5Jn5Mxi4y8oNx0tTYB3X X-Received: by 2002:a17:906:cd02:: with SMTP id oz2mr2231226ejb.227.1628602157106; Tue, 10 Aug 2021 06:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628602157; cv=none; d=google.com; s=arc-20160816; b=HnF0tJmZc7FSbRMIwxe16CR4obq/gCO8cWeUwyt3X5ZYBBVpEu9B60u/Iy8TJOtmx6 i4wIH0xLAOloAn68NchBtJjAFfbaLYwzOm6cy5QEYH7PauT118BlKwC9dfeB6rpItVzr 5lRw+CzbZzMppMDlN5oA0LNmJ0/IS38xGEqjCrvIzSkqTc51pFfLWKy/dTUGewH8RvrA m59SACT0keP27U90I0EBGmg9BceR1eP4QruFWzbgUjvksIULBiA8llEmA8Lu2nkK9Dsh aknY8oRWbVmBW3y1hvHrAeem2yzRUYLcIcHiH62yd768gtzUBX5KUK50G40mrloLVVI/ KDLw== 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=iH9jyFHnI8KCHeWiKctc4HwW62cQrw/+LvZSTx4gpnw=; b=vlnFhcSvwVCSyl5oQWietk957VOtWd8nOWe+GDnTeJIuZAxkdFdipnEs5sUEBFlPSf ktxx1rzWILw5G6HhML1biob4vSRrcfQGDdPcn7VACJWebk0GYn8FPp/ctFdT/zhT7oeO hzn2ixLsa4n0i3vsNHfSyrabE1YzCcWWnd1VpQaReX6KsqUSG1Yp1aaahJ+QYO0Vd7nc EAo0OGXLfu1MkytStViYJBsypPwmpwaZRqSDAVxYdN66994sKu/jop+T+94HOMv83xyc k/4ZDfdfToVT+r1VZFVTHU/Kp71oLnxRebn5vsXaJVwReHBI52s4Rh+ial283xrWG1b+ mUOQ== 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 r10si749620ejs.281.2021.08.10.06.28.45; Tue, 10 Aug 2021 06:29:17 -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 S230308AbhHJKZT (ORCPT + 99 others); Tue, 10 Aug 2021 06:25:19 -0400 Received: from foss.arm.com ([217.140.110.172]:53088 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhHJKZS (ORCPT ); Tue, 10 Aug 2021 06:25:18 -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 5F7586D; Tue, 10 Aug 2021 03:24:56 -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 7B99F3F70D; Tue, 10 Aug 2021 03:24:54 -0700 (PDT) Subject: Re: [PATCH 5/8] cpufreq: omap: Use auto-registration for energy model To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , Kevin Hilman , linux-pm@vger.kernel.org, Vincent Guittot , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Lukasz Luba Message-ID: Date: Tue, 10 Aug 2021 11:24:53 +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: 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/omap-cpufreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c > index e035ee216b0f..303136f97773 100644 > --- a/drivers/cpufreq/omap-cpufreq.c > +++ b/drivers/cpufreq/omap-cpufreq.c > @@ -131,7 +131,6 @@ static int omap_cpu_init(struct cpufreq_policy *policy) > > /* FIXME: what's the actual transition time? */ > cpufreq_generic_init(policy, freq_table, 300 * 1000); > - dev_pm_opp_of_register_em(mpu_dev, policy->cpus); > > return 0; > } > @@ -144,7 +143,8 @@ static int omap_cpu_exit(struct cpufreq_policy *policy) > } > > static struct cpufreq_driver omap_driver = { > - .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK, > + .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | > + CPUFREQ_REGISTER_WITH_EM, > .verify = cpufreq_generic_frequency_table_verify, > .target_index = omap_target, > .get = cpufreq_generic_get, > Reviewed-by: Lukasz Luba