Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3717339pxt; Tue, 10 Aug 2021 09:42:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpBe5Jvybig4Yk+2XX7Ny/bsrd6ILoEnM0smaAZkIRM/x2bZ2AyiOeCdWoMTOKDESveMtd X-Received: by 2002:a05:6638:268f:: with SMTP id o15mr15362277jat.22.1628613763420; Tue, 10 Aug 2021 09:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628613763; cv=none; d=google.com; s=arc-20160816; b=ePTUJUeB6ZDEvWJ0USrvoc5lXUWWssjGlWusg6JHgRbvy7RYA9h28Vd/+2ngkD2iWH /NQ9F5d2iZyyUIaJKy7Mwd2I7zErTP9TmCtrpFDimqTf7wWiujtBetjLUHZDiEbBGShc v4miaq2jVErrSPvOqjleG1wqlD4I6Ejf/RRrDbLsPgbZVPW3nip1kBJywsOatdbqxJAx WJxKcv3f6F4TLJBWKMI2L3ig9wQKakVda17jeWNQ2RClwOkpjJ11rX+xdzrM4rDl+aq9 le+fITTeJQSktsQ80s7RPUsuIut7SG7J9dnfzUciNN8eH1cYStoFfAfyeyVtZNseE7FN SwvQ== 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=9+m5x+e3JGvvhwT2MQxGhNcpaQDMVdl7ws7kOuXnd3o=; b=AzCnsWUDxXdM5MnvIayWSNXBZdedNymICjjoyR8A79YYhGvPwFYAVEhB4ZIBnaB6jW LzPO2B81+BiJ1V36lsnZHsoWmEpoSntELXqxllUYISXuydXFDqROQncTi6SdEUwRv01k tNCDCEPs5zlCzSt9nIaZZnmYwKuuJ539EMCC+7VrOKrl7c+SLpucx+fJA/E1JAS3PM3w AqLf9pKPnAvmUp7VJ+npM3fht80PZoLy/fevay0W1BbHMz6MuT2N7w9cIuN2QKte/wdY 8llsjoOIhAEmJD0mn3k61rAiiJz2iatsma7vplpnuiYWTVbdostKAwNAZQOoloUWd/rf OfFA== 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 ay9si8639999iob.85.2021.08.10.09.42.31; Tue, 10 Aug 2021 09:42:43 -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 S243182AbhHJPeK (ORCPT + 99 others); Tue, 10 Aug 2021 11:34:10 -0400 Received: from foss.arm.com ([217.140.110.172]:58176 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243118AbhHJPd5 (ORCPT ); Tue, 10 Aug 2021 11:33:57 -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 25BF81FB; Tue, 10 Aug 2021 08:33:35 -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 0F7EA3F718; Tue, 10 Aug 2021 08:33:33 -0700 (PDT) Subject: Re: [PATCH 1/8] cpufreq: Auto-register with energy model if asked To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org References: <20210810093828.drel3kuurmhd4ki7@vireshk-i7> From: Lukasz Luba Message-ID: <821da524-0ca5-6923-2f57-2d6ed4723c7d@arm.com> Date: Tue, 10 Aug 2021 16:33:33 +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: <20210810093828.drel3kuurmhd4ki7@vireshk-i7> 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 10:38 AM, Viresh Kumar wrote: > On 10-08-21, 10:36, Lukasz Luba wrote: >> The of_cpufreq_cooling_register() should be called after the EM >> is present for the CPU device. When you check that function, >> you will see that we call >> em_cpu_get(policy->cpu) >> to get the EM pointer. Otherwise IPA might fail. > > Good point. > In other patch set I had a discussion with Quentin and I've checked the Performance Domains setup code. There is a code triggering the rebuilding perf domains with EM from governor. We cannot call EM registration so late in this cpufreq_online(), not after cpufreq_init_policy() call. So this dev_pm_opp_of_unregister_em() must be called before the policy is initialized. I'm not sure if you still would like to push forward this patch set in this case.