Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1604167ybv; Thu, 6 Feb 2020 06:49:59 -0800 (PST) X-Google-Smtp-Source: APXvYqyrxVgxzVl2q1+Kvw6IJPD7h/Wwxg45FAcftWSuMOgkS9A3jyzBsrYTfb3BNXV+FfWR7VAP X-Received: by 2002:a9d:74d0:: with SMTP id a16mr19046465otl.228.1581000599016; Thu, 06 Feb 2020 06:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581000599; cv=none; d=google.com; s=arc-20160816; b=FU8QYBR28rRvDDt/aAnxvFM5cidd/AUTrgDIMFOvtI4vLS0qM2WGvp0I6KaKX5Rbvq YtZbNtwYsgkVdckQmtYYjL7At3e24EU6pXnf9AiC4YoNf8jGYZE78CRxlsX2wJSveHz8 5ERmrGoJP5dzll8OAdBckm5XiH+NjOMBZkfLNxUFUEtV3yoGPB38dGQYVtd+L7My1IUd wrl67CKkgYoGKoA8Z11G6YQi9qa1q36gJ0rz35tw3iAdDTCwvtyxVOaEjcKQc0hbA5Xq AZ+65exnMIKpNvNW3arEWCvboxZWEkMlIKPvv0cWKx6NEb+O1DkaxtN97MdL7WBZ4Vql wHNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Tagd/v/uASyHuBGTz0GbEx0xWwUgMPLr1ZtaBFa58DA=; b=TPJL7kw3jsA36MDyYo4OUc2dw8DqZ//v29ER0tl7Y5j7YkanZA56wPmNmi54HStenD WVjMsWT7I5nkd05vHaVrlKoccTNz42XlKC/eUReiuSqg7doue+ipptN10ITDRIt4XUYN nipGyWkENYRdjBIa20VSh+F8mtln2oY8pwzdEIlHE07yMB+XwCXsnDs2pGNsKY21ENTC jTuKSnnQzASurbME9F6gc5H9fq5+hbve9BSHWlqCU2u/B49DG5J9M3/K51vnf5pDly/2 Wt10eg2bm+n/IiWOJwZUi6lbqSyOSEfmdZHCM84upwUB6v4+ESd5rp8goZODtUWXLYKh XsGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si2119477otq.96.2020.02.06.06.49.46; Thu, 06 Feb 2020 06:49:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728035AbgBFNrG (ORCPT + 99 others); Thu, 6 Feb 2020 08:47:06 -0500 Received: from foss.arm.com ([217.140.110.172]:58556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbgBFNrF (ORCPT ); Thu, 6 Feb 2020 08:47:05 -0500 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 AFCB730E; Thu, 6 Feb 2020 05:47:04 -0800 (PST) Received: from e123648.arm.com (unknown [10.37.12.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 648223F52E; Thu, 6 Feb 2020 05:46:52 -0800 (PST) From: lukasz.luba@arm.com To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-imx@nxp.com Cc: Morten.Rasmussen@arm.com, Dietmar.Eggemann@arm.com, Chris.Redpath@arm.com, ionela.voinescu@arm.com, javi.merino@arm.com, cw00.choi@samsung.com, b.zolnierkie@samsung.com, rjw@rjwysocki.net, sudeep.holla@arm.com, viresh.kumar@linaro.org, nm@ti.com, sboyd@kernel.org, rui.zhang@intel.com, amit.kucheria@verdurent.com, daniel.lezcano@linaro.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, rostedt@goodmis.org, qperret@google.com, bsegall@google.com, mgorman@suse.de, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, kernel@pengutronix.de, khilman@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, robh@kernel.org, matthias.bgg@gmail.com, steven.price@arm.com, tomeu.vizoso@collabora.com, alyssa.rosenzweig@collabora.com, airlied@linux.ie, daniel@ffwll.ch, liviu.dudau@arm.com, lorenzo.pieralisi@arm.com, lukasz.luba@arm.com, patrick.bellasi@matbug.net Subject: [PATCH v2 0/4] Add support for devices in the Energy Model Date: Thu, 6 Feb 2020 13:46:36 +0000 Message-Id: <20200206134640.11367-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukasz Luba Hi all, This patch set introduces support for devices in the Energy Model (EM) framework. It will unify the power model for thermal subsystem and make it simpler. The 1st patch refactors EM framework and adds support for devices. The 2nd patch changes dev_pm_opp_of_register_em() in OPP/OF which now should take as an argument struct device pointer. It touches a few trees (OMAP, NXP, mediatek) updating their CPUfreq drivers to the new interface. Patch 3/4 changes thermal devfreq cooling removing old code for calculating local power table. It simplifies the code and uses EM for requested power calculation. Last patch 4/4 adds EM to Panfrost driver. The patch set is based on linux-next tag next-20200206 but also applies on top of today's Linus's master. Changes: v2: - changed EM API em_register_perf_domain() adding cpumask_t pointer as last argument (which was discussed with Dietmar and Quentin) - removed dependency on PM_OPP, thanks to the cpumask_t argument - removed enum em_type and em->type dependent code - em_get_pd() can handle CPU device as well as devfreq device - updated EM documentation - in devfreq cooling added code which prevents from race condition with devfreq governors which are trying to use OPPs while thermal is in the middle of disabling them. - in devfreq cooling added code which updates state of the devfreq device to avoid working on stale data when governor has not updated it for a long time - in devfreq cooling added backward compatibility frequency table for drivers which did not provide EM - added Steven's Reviewed-by to trace code in thermal - added another CPUFreq driver which needs to be updated to the new API The v1 can be found here [1]. Regards, Lukasz Luba [1] https://lkml.org/lkml/2020/1/16/619 Lukasz Luba (4): PM / EM: add devices to Energy Model OPP: change parameter to device pointer in dev_pm_opp_of_register_em() thermal: devfreq_cooling: Refactor code and switch to use Energy Model drm/panfrost: Register to the Energy Model with devfreq device Documentation/power/energy-model.rst | 129 +++--- drivers/cpufreq/cpufreq-dt.c | 2 +- drivers/cpufreq/imx6q-cpufreq.c | 2 +- drivers/cpufreq/mediatek-cpufreq.c | 2 +- drivers/cpufreq/omap-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- drivers/cpufreq/scmi-cpufreq.c | 11 +- drivers/cpufreq/scpi-cpufreq.c | 2 +- drivers/cpufreq/vexpress-spc-cpufreq.c | 2 +- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 + drivers/opp/of.c | 45 +-- drivers/thermal/cpufreq_cooling.c | 10 +- drivers/thermal/devfreq_cooling.c | 427 +++++++++----------- include/linux/devfreq_cooling.h | 17 - include/linux/energy_model.h | 108 +++-- include/linux/pm_opp.h | 14 +- include/trace/events/thermal.h | 19 +- kernel/power/energy_model.c | 399 ++++++++++++++---- kernel/sched/sched.h | 2 +- kernel/sched/topology.c | 4 +- 20 files changed, 712 insertions(+), 490 deletions(-) -- 2.17.1