Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3520674pxt; Tue, 10 Aug 2021 05:42:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAHVacQ/I9Zm10gpopS2/IcNc68YWGeZaHuzzGg6NlLEs3yBocenCsRpvKyTPcuunYEarH X-Received: by 2002:a17:906:4c5a:: with SMTP id d26mr6636378ejw.317.1628599369996; Tue, 10 Aug 2021 05:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628599369; cv=none; d=google.com; s=arc-20160816; b=HZQShpmvyCiVC/kbMM9I1nFUrtZNvfgaPouRsBACKM4q7Oy2n1Tnn8VFKKdNIsUus4 fYzInSfe0WZYQZkmz1m0DyLtx4B/kuwB41ghTPmSc5TVfE8J0JU18KlsDtstxwnmB5CI d0EPiLvq1TlaXuecmBWg2rnaE4tP1zADqDPqrD+utoW7FGWTwXq3vg/4PYY1CgaHOJPc gJQqqS7jjOOfqEMPjG1ymq4AkjKic6UuqoknsPjiOBXDAgQzI/KyFz4ayme3KnlVL2nn qjon45CaB1NjhgyEXQSi/x0ntgIXeiaZzO29txMwkCzhrC51qFdpMoTH09ZdQvgVSEQK BuMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NRaO485jOXyVF0oustzhSd8qBSdNJyzH3A7Z5Nbm+es=; b=jxysa1IdEuCuteopd/So6eP6MML/4n3XuzulykiiDEkutARkK44ZvzIlr7etzzubkq +YNLcRWvDCUUZND0OtmECeSyAGgtp4aeSM7lPTJ0mfm0fnfGBMkWkyaLHRF33Xw2mkVb UReWTTcF2RQgnSeiCMgMfkb4XpkSUUOT/3CpRAcVUxlcx3gI79juYXKtTcoy93SFsyN0 TXm5/M9SHIwUGLwy/31P+YWJf6oO8CpIJU9ODe1ZvCZltEhSR21PfvZSiUzFIL2J2MxZ tYf/Hwf2g3YlotD3E+kTd39vqpn3stG4kQBqNHQqkBgWBjtSw5OVEeXHWSXY4QBpKueT A5AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EN4FC+Zy; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si14179870edc.407.2021.08.10.05.42.22; Tue, 10 Aug 2021 05:42:49 -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=@linaro.org header.s=google header.b=EN4FC+Zy; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239007AbhHJJ1b (ORCPT + 99 others); Tue, 10 Aug 2021 05:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239015AbhHJJ13 (ORCPT ); Tue, 10 Aug 2021 05:27:29 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED97C06179A for ; Tue, 10 Aug 2021 02:27:08 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id w14so1644296pjh.5 for ; Tue, 10 Aug 2021 02:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NRaO485jOXyVF0oustzhSd8qBSdNJyzH3A7Z5Nbm+es=; b=EN4FC+Zy6qPz5ONRrMSzGs7f2d5IFWEHB+CKaGTlrSFl71+MmJb6AWQ7efO8d+ClIb pnmBW2qV3uz+YogPMJIOxazI0Bvoj1dCt91i+6XBfI4J8/HogjbdB3HsDTzg2BkBekw6 8D0q7W44BuFzkyreb4V+5EVY8FveQYOjxevTlXLNu+I9rWg37oGRNiI9dnTyVA9wEaDy 3ElJHf+wXX8SN/vvMyi3ziXGw8gJw6iFl6YHA0ajvLilryl5EKx6myt1uXEbG5leYYw6 E8W2P8Ia8sL2uhsbmaxIi/vfz8yL3Oso9PVdHL+61zufIGdpF/RQ9nmb7wV0dxlDjdmJ vqZg== 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:user-agent; bh=NRaO485jOXyVF0oustzhSd8qBSdNJyzH3A7Z5Nbm+es=; b=CmHM6VUySGi5M+i9gZJW53KDj7HzzyN9vx/+y+IAsiTCpoZKJgo7SlnlCwWtrFTJkp c4gDe7jbLQxhVJmn/YCwk0hsgzmZkJadviYNs+nPhQJ7sXtlZTFBjZN9Uqpi/u9ftfmz Lf4w/8rvqNMOhTB/ebWGD9ZWk0Sh060WSmxNJAyehEezzyPasj+hkF0oeANMfFDTs5sn QqKZ+GVdbCXw5ODpWnCfwF7Yrlqy1NRB0bHWJCioJJRbj/oaNa0HCmaJtINFhznFnlp/ nqzuHd3h25a2JrxdHe8UsLUOfLl97ru4NLKyg9NoC8zdhX7BntQewe1eYRVhtUOINSYL R/WQ== X-Gm-Message-State: AOAM530VRiFJvpX9BHgne7w0vXvC/WF8LjvWjtrANedwICTD20T0Kt1v vso+asFyD5SgBW+ddp8nfMCBcA== X-Received: by 2002:a62:1e83:0:b029:3c8:ac32:3b41 with SMTP id e125-20020a621e830000b02903c8ac323b41mr19067962pfe.0.1628587627673; Tue, 10 Aug 2021 02:27:07 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id d9sm21966486pfv.161.2021.08.10.02.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 02:27:07 -0700 (PDT) Date: Tue, 10 Aug 2021 14:57:05 +0530 From: Viresh Kumar To: Lukasz Luba Cc: Andy Gross , Rafael Wysocki , Vincent Donnefort , 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: <20210810092705.ctf43hwhzdepmcrv@vireshk-i7> References: <6449a61f-a5fc-0b81-65b2-7bf77b8a71aa@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6449a61f-a5fc-0b81-65b2-7bf77b8a71aa@arm.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10-08-21, 10:17, Lukasz Luba wrote: > Hi Viresh, > > I like the idea, only small comments here in the cover letter. > > On 8/10/21 8:36 AM, Viresh Kumar wrote: > > Provide a cpufreq driver flag so drivers can ask the cpufreq core to register > > with the EM core on their behalf. This allows us to get rid of duplicated code > > in the drivers and fix the unregistration part as well, which none of the > > drivers have done until now. > > The EM is never freed for CPUs by design. The unregister function was > introduced for devfreq devices. I see. So if a cpufreq driver unregisters and registers again, it will be required to use the entries created by the registration itself, right ? Technically speaking, it is better to unregister and free any related resources and parse everything again. Lets say, just for fun, I want to test two copies of a cpufreq driver (providing different set of freq-tables). I build both of them as modules, insert the first version, remove it, insert the second one. Ideally, this should just work as expected. But I don't think it will in this case as you never parse the EM stuff again. Again, since the routine is there already, I think it is better/fine to just use it. > > This would also make the registration with EM core to happen only after policy > > is fully initialized, and the EM core can do other stuff from in there, like > > marking frequencies as inefficient (WIP). Though this patchset is useful without > > that work being done and should be merged nevertheless. > > > > This doesn't update scmi cpufreq driver for now as it is a special case and need > > to be handled differently. Though we can make it work with this if required. > > The scmi cpufreq driver uses direct EM API, which provides flexibility > and should stay as is. Right, so I left it as is for now. -- viresh