From patchwork Wed Dec 9 10:30:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 11963701 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=-11.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 95A08C433FE for ; Thu, 10 Dec 2020 08:26:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B270235F7 for ; Thu, 10 Dec 2020 08:26:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B270235F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 075206EA58; Thu, 10 Dec 2020 08:26:15 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 73CA66E14F for ; Wed, 9 Dec 2020 10:30:55 +0000 (UTC) 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 A628431B; Wed, 9 Dec 2020 02:30:54 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.24.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 42A9A3F718; Wed, 9 Dec 2020 02:30:51 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 0/5] Thermal devfreq cooling improvements with Energy Model Date: Wed, 9 Dec 2020 10:30:11 +0000 Message-Id: <20201209103016.10442-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Thu, 10 Dec 2020 08:25:39 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: amit.kucheria@verdurent.com, airlied@linux.ie, daniel.lezcano@linaro.org, steven.price@arm.com, alyssa.rosenzweig@collabora.com, rui.zhang@intel.com, ionela.voinescu@arm.com, orjan.eide@arm.com, lukasz.luba@arm.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi all, This patch set is a continuation of my previous work, which aimed to add Energy Model to all devices [1]. This series is a follow up for the patches which got merged to v5.9-rc1. It aims to change the thermal devfreq cooling and use the Energy Model instead of private power table and structures. The power model is now simplified, static power and dynamic power are removed. The new registration interface in the patch 3/5 helps to register devfreq cooling and the EM in one call. There is also small improvement, patch 2/5 is changing the way how thermal gets the device status (now uses a copy) and normalize the values. The last patch is here for consistency and will probably go through drm tree. The patch set is based on current next-20201208, because it depends on EM API change which is queued in the pm/linux-next tree as v5.11 material. changes: v3: - dropped direct check of device status and used just a copy of 'status'; a separate patch set will be proposed to address this issue - modified _normalize_load() and used 1024 scale to handle ms, us, ns - removed 'em_registered' and called em_dev_unregister_perf_domain() unconditionally, so the drivers will have to make sure the right order of all unregister calls to frameworks which might use EM; this call must be last one; a proper comment added - removed 'em' pointer from struct devfreq_cooling_device, 'dev->em_pd' is used - removed of_node_get/put(), since the code can handle it - removed dfc_em_get_requested_power() (as missed to do it in v2) - collected all Reviewed-by tags v2 [3]: - renamed freq_get_state() and related to perf_idx pattern as suggested by Ionela v1 [2] Regards, Lukasz Luba [1] https://lkml.org/lkml/2020/5/11/326 [2] https://lore.kernel.org/linux-pm/20200921122007.29610-1-lukasz.luba@arm.com/ [3] https://lore.kernel.org/linux-pm/20201118120358.17150-1-lukasz.luba@arm.com/ Lukasz Luba (5): thermal: devfreq_cooling: change tracing function and arguments thermal: devfreq_cooling: use a copy of device status thermal: devfreq_cooling: add new registration functions with Energy Model thermal: devfreq_cooling: remove old power model and use EM drm/panfrost: Register devfreq cooling and attempt to add Energy Model drivers/gpu/drm/panfrost/panfrost_devfreq.c | 2 +- drivers/thermal/devfreq_cooling.c | 420 ++++++++++---------- include/linux/devfreq_cooling.h | 40 +- include/trace/events/thermal.h | 19 +- 4 files changed, 240 insertions(+), 241 deletions(-)