Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4293709pxt; Wed, 11 Aug 2021 02:36:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynGftG4XGcXa4Hib3OQqYzBt5u9zr/42peD1ca2pjrFAvX0TLpCObrZL28xGnxlGs0yejG X-Received: by 2002:a17:906:f8d5:: with SMTP id lh21mr2726895ejb.6.1628674586862; Wed, 11 Aug 2021 02:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628674586; cv=none; d=google.com; s=arc-20160816; b=DK8a8XboG8lR/wo8K4PXmC9oZCQ0VwW/4nynLwpYRnr+jVTlzklVPjn1fWx093g97X GqFTgD7ijhxueGEYxFCDnZmgxMEDWUc55duV1vSagh5s+iY6OFi+xtx7rp1ey2FeMzRF C5GkNJaAWv8VxfowCPy+Rw+MQewQA9xEbrdxp4j45xceiLfnvq2YFqBZyZWQCaROMBw1 ONu20P+r/SjDdltn9nCkZHws9XERDyow9LSoKzsDV8qxjrTHtVcBn2Ol9TU2x2DhA+Gh O8RZU6NMowBL1r29A0cct4UtqCl5MKIxfI9WI4LuLOmGubkeTskN69WfE7iKA5lXpbmy qykQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vnsVN4bcM0E0y8yL+4jX4NPKN0s5XVfHXg6t0sA+kKU=; b=jQpAXF2jCxbjpS9p0jVz8nWAtjwdZvfCze74DwSmSTmjS82UmiavsY30hUG3fyOOtG dAM2wROfqZotwKZ5Z8TO0HgjgoOcwpbCw+1uqEvf0UjdRlv4sWUMEFNAfiPnjZTSS+Q3 cVOSFwhoQXNpO7VacOSG5ssmwpZHjjii+k71LSAC0dtLSvtoTNO0TOOtuqrm0Scl4UwN wn4ahdSD2CV9s+/ZWK5IsyvLWngu3pYMnaCNW34J9kVV88lUOttYPEI4UPHrYY+8kDwn cNSgp8xTkYFEm1rIBQq4saP9j9dRFaR76QOgA6N2MdhWb8FehokHTXYZvTyXDoZ0lXQd MY3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u8FXx8Pb; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq1si22968356edb.603.2021.08.11.02.35.43; Wed, 11 Aug 2021 02:36:26 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=u8FXx8Pb; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236411AbhHKJel (ORCPT + 99 others); Wed, 11 Aug 2021 05:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236056AbhHKJel (ORCPT ); Wed, 11 Aug 2021 05:34:41 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936CFC0613D3 for ; Wed, 11 Aug 2021 02:34:17 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id i10-20020a05600c354ab029025a0f317abfso3925250wmq.3 for ; Wed, 11 Aug 2021 02:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vnsVN4bcM0E0y8yL+4jX4NPKN0s5XVfHXg6t0sA+kKU=; b=u8FXx8PbqKg72yRV7K6aX2nwg+RaUIMIKfNSyZDi54QHZNgrnmHHhpQ3uW6MNefq+t X/92op1mryh95Wm/AH8EEK6FZ9dY6WHyWJJ6gWW9CV/snKBi8+dpGzZiAUW4j3bT+sQA kEkRFMvY/K+F2WRBhUU/Aw+ZhvCvgDYP07VdNhurn9IQQUMuRJhYvRvsUghUHu0Cd7lm 2HxjMjXHAezdkF4PXpqZnFGn0GCPqevGzJ4qOY7sM7q2tRu5scxmVsHV2bkXeB5xOZay Vb/qjRNLocExEd0jwIXNuWn1dpNVgbP5WBCp0KJvYay/+69ktW+ZNYmVv3DQXiNSoqSs F/Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vnsVN4bcM0E0y8yL+4jX4NPKN0s5XVfHXg6t0sA+kKU=; b=suShG128A8GEI8tJbhP08+b2zUkeaZkbLXf1eRqtDuyswF2hG6H5sqCL1BnCPCSocV NANRoEy+mvmMn6klsATbP3LF5qNLiut1weJPZK+A5LEx6O4GxSzs1C4Y0EdHWbuJosnA 9L340f4SxMNPJXu8Iz82N2BERiE3tzeoYzR62CbritlXFW1KlipcRta08EkuuAPoRg3E eZumlfEH8JCLM1TeGqf9uy2gZzjpvo8k6/OsSW8lbK/TG3MM+tyW9pLZO83P6IWpqk5z pVBRKpStOMMuUGHnfKS7d4sofx/mwScmLs+ZoGcLa1PLcGDJPzp5mKNaRwBHSxTyagK9 reZw== X-Gm-Message-State: AOAM533ki6SYhFtBvcnKFoU0K+B/Z7O0f1hRa8B3gfzKvTtE0+axpXpi P4rI+0P4rbTctg8dVGhhLRVUIw== X-Received: by 2002:a7b:cd83:: with SMTP id y3mr26353421wmj.126.1628674455789; Wed, 11 Aug 2021 02:34:15 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:43fd:e634:73d9:e10e]) by smtp.gmail.com with ESMTPSA id i14sm20670426wmq.40.2021.08.11.02.34.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 02:34:15 -0700 (PDT) Date: Wed, 11 Aug 2021 10:34:09 +0100 From: Quentin Perret To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Andy Gross , Bjorn Andersson , Cristian Marussi , Fabio Estevam , Kevin Hilman , Matthias Brugger , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Sudeep Holla , linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-omap@vger.kernel.org Subject: Re: [PATCH 0/8] cpufreq: Auto-register with energy model Message-ID: References: <20210811051859.ihjzhvrnuct2knvy@vireshk-i7> <20210811091321.xtb776q4t6cwyanx@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210811091321.xtb776q4t6cwyanx@vireshk-i7> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 11 Aug 2021 at 14:43:21 (+0530), Viresh Kumar wrote: > On 11-08-21, 09:37, Quentin Perret wrote: > > On Wednesday 11 Aug 2021 at 10:48:59 (+0530), Viresh Kumar wrote: > > > I had to use the pm-opp version, since almost everyone was using that. > > > > > > On the other hand, there isn't a lot of OPP specific stuff in > > > dev_pm_opp_of_register_em(). It just uses dev_pm_opp_get_opp_count(), > > > that's all. This ended up in the OPP core, nothing else. Maybe we can > > > now move it back to the EM core and name it differently ? > > > > Well it also uses dev_pm_opp_find_freq_ceil() and > > dev_pm_opp_get_voltage(), so not sure how easy it will be to move, but > > if it is possible no objection from me. > > What uses these routines ? dev_pm_opp_of_register_em() ? I am not able > to see that at least :( Yep, it's not immediately obvious, but see how it sets the struct em_data_callback to point at _get_power() where the actual energy calculation is done. So strictly speaking _get_power() is what uses these routines, but it goes in hand with dev_pm_opp_of_register_em() so I guess the same reasoning applies. > > Right but the EM is a description of the hardware, so it seemed fair > > to assume this wouldn't change across the lifetime of the OS, similar > > to the DT which we can't reload at run-time. Yes it can be a little odd > > if you load/unload your driver module, but note that you generally can't > > load two completely different drivers on a single system. You'll just > > load the same one again and the hardware hasn't changed in the meantime, > > so the previously loaded EM will still be correct. > > Yeah, it will be the same driver but a different version of it, which > may have updated the freq table. For me the EM is attached to the > freq-table, and the freq-table is not available anymore after the > driver is gone. > > Anyway, I will leave that for you guys to decide :) IIUC Lukasz is working on something that should allow changing the EM at run-time, so hopefully it'll enable this use-case as well, but we'll see :)