Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp236025pxu; Tue, 6 Oct 2020 05:22:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpqU2bU2cHVqvSIpL2W17/ffcCbMgHUII91nUavrVCTZsNdeIj1GBGdHOKSCoOzilVJtKR X-Received: by 2002:a17:906:6a4e:: with SMTP id n14mr3973128ejs.14.1601986939032; Tue, 06 Oct 2020 05:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601986939; cv=none; d=google.com; s=arc-20160816; b=tqv5Qs5KqNCB+kpQcNitdw4DcONYA0+S3rx7zhlLZA4vGg7fqfHZeGje7zVqUCbL7X 5Z/Q+xlKJqInWhuVih0PQR1AzkBpPzfugkM7kbQtnMwBZ0fmWkiySB9/yOT3pxmOeYZB nsKmO6xQNkCAfH9vwumY1d4deE2LkI088+E2/vWKlrbFnX0+N1dO/99BU0qzr+WdcR59 QmdddnoFYkCb9NYBE5Ag4B8lPR6T2b4TiR03qHyRkt4oycCnFxOk/fIqHMtMfH+ilLu5 foAvlAdp4BReyYcM4P2hWGgeMmKgJRenEtpsu92iGPfFDYV7jcDo46p/X6N5DuNalSRD wDYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jHqlJlKyK3t+BplWZMVjP0HJb12amo5gWYHD/Aa8e9s=; b=OLwq/Y00W30c77J4s5WdzunXKTF3wn981rRjtw0ur35FLJfMAanj1JRVs0JvmtPg6X sN/dPgmvxYl5r/j6Uj3EY3BrtZNAVIgrhSOhE8dd1tGrSIg0knfL4UqG4k0Kjwj6fXEW +IZNioFVrfrWF/aATlffgKXdriPXRlLKNWZpllsd6vONPvYd8NDTeBAmb5GYUhdnA05Z rjjzr4FSHboBF9AwrrXqTfop5Wxix/HWOJHf1J67UVTGfZJPuwlUe0gjCe5ZyBfbhITl 4A8CtEHSIlYEBfN9iHrP5qyqjpmiGrdAiJkNHLuqhyu0nfBE6BRT7/va1O9uiseMRydl VFMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fB7+dnId; 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 r10si1797530eji.253.2020.10.06.05.21.50; Tue, 06 Oct 2020 05:22:19 -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=fB7+dnId; 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 S1726335AbgJFMUq (ORCPT + 99 others); Tue, 6 Oct 2020 08:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgJFMUq (ORCPT ); Tue, 6 Oct 2020 08:20:46 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9173C061755 for ; Tue, 6 Oct 2020 05:20:45 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id n15so7462472wrq.2 for ; Tue, 06 Oct 2020 05:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jHqlJlKyK3t+BplWZMVjP0HJb12amo5gWYHD/Aa8e9s=; b=fB7+dnIdkE+utP0B/DtZDwiIRlCjrN+H3ocJF3Kg7TpO8uliOFUsHs0nCFJEtu0z9F Q30VL7TfftLQawwmbVq6URRycNI2U6ymvN5r3ssthQWYhxxOMR6uDwwx0csrjUWsugcA PnxUifmMqz16gCqUpSj7ePV6H+Tepnrg4QrSqGfkYudLBOi52MSWEfjBTZqi4ygvWx5R JgDZbi7WNI/wKqXtS6kv93sdmGnjSOwsIHr+ELxQCtYl5TG7bnvfwrjDVTxFwtwpXTYq 024D9ccCJTIPWHTAjoamaaUTreonc3WYsdmKK5J1DMALErGonc/Y6/7KtNdsFFiM46mM ueMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jHqlJlKyK3t+BplWZMVjP0HJb12amo5gWYHD/Aa8e9s=; b=UD8gxdvZ1I/aaS6bI5NT34ttQloC+bnnYf+lU9SA2f7R4HS35RSPfvfNhqd0PeJ00Q nA1CRcgyLjT8HPsLtB9Hh7tkR+ixjKwxzQIukTlZL8kmeqEfmhBXN0XOQopAAWSeACPK YSt6fiJqJWDsEVkyc+yJ0TYB0KJlIAGNxWxr5ScNHuzYlogBx0mTIe053wR9BybaUVtY md/lNJqhTOEKxWIuB+1fxh75Zb7yNNjdrd+bbXvmNv0vAXzw6DgLDOit2isVqpeVHtxi 1WD/yCklBtGC0gsWr13q+asg4ApjxcqUWvyrS4aENDRWAtrRFeBjPK5OlRHd3u8auOEQ UxaA== X-Gm-Message-State: AOAM531f4VjBmGzxAh81urmdSX3WdWxNs04LCCHWQq/nFuwo5xF2VInn HJO32R7DnkuxVv+5r3cBMeQYQg== X-Received: by 2002:a5d:540e:: with SMTP id g14mr4828784wrv.148.1601986844293; Tue, 06 Oct 2020 05:20:44 -0700 (PDT) Received: from localhost.localdomain (lns-bzn-59-82-252-130-8.adsl.proxad.net. [82.252.130.8]) by smtp.gmail.com with ESMTPSA id s19sm3742521wmc.41.2020.10.06.05.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:20:43 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, srinivas.pandruvada@linux.intel.com Cc: lukasz.luba@arm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com Subject: [PATCH 0/4] powercap/dtpm: Add the DTPM framework Date: Tue, 6 Oct 2020 14:20:20 +0200 Message-Id: <20201006122024.14539-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The density of components greatly increased the last decade bringing a numerous number of heating sources which are monitored by more than 20 sensors on recent SoC. The skin temperature, which is the case temperature of the device, must stay below approximately 45°C in order to comply with the legal requirements. The skin temperature is managed as a whole by an user space daemon, which is catching the current application profile, to allocate a power budget to the different components where the resulting heating effect will comply with the skin temperature constraint. This technique is called the Dynamic Thermal Power Management. The Linux kernel does not provide any unified interface to act on the power of the different devices. Currently, the thermal framework is changed to export artificially the performance states of different devices via the cooling device software component with opaque values. This change is done regardless of the in-kernel logic to mitigate the temperature. The user space daemon uses all the available knobs to act on the power limit and those differ from one platform to another. This series provides a Dynamic Thermal Power Management framework to provide an unified way to act on the power of the devices. Daniel Lezcano (4): units: Add Watt units Documentation/powercap/dtpm: Add documentation for dtpm powercap/drivers/dtpm: Add API for dynamic thermal power management powercap/drivers/dtpm: Add CPU energy model based support Documentation/power/powercap/dtpm.rst | 222 +++++++++++++ drivers/powercap/Kconfig | 14 + drivers/powercap/Makefile | 2 + drivers/powercap/dtpm.c | 430 ++++++++++++++++++++++++++ drivers/powercap/dtpm_cpu.c | 242 +++++++++++++++ include/asm-generic/vmlinux.lds.h | 11 + include/linux/cpuhotplug.h | 1 + include/linux/dtpm.h | 76 +++++ include/linux/units.h | 4 + 9 files changed, 1002 insertions(+) create mode 100644 Documentation/power/powercap/dtpm.rst create mode 100644 drivers/powercap/dtpm.c create mode 100644 drivers/powercap/dtpm_cpu.c create mode 100644 include/linux/dtpm.h -- 2.17.1