From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B56C7C4320A for ; Wed, 11 Aug 2021 09:34:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B42E60E97 for ; Wed, 11 Aug 2021 09:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236539AbhHKJem (ORCPT ); Wed, 11 Aug 2021 05:34:42 -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-Google-Smtp-Source: ABdhPJwkwReehafMcUbIlZNd433otHjSQ1cTcW/iaeTfVVwqL8nOZJoLVmtkJ6iZwqwM5f+LD1MLMA== 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 :)