linux/drivers
Daniel Lezcano a20d0ef97a powercap/drivers/dtpm: Add API for dynamic thermal power management
On the embedded world, the complexity of the SoC leads to an
increasing number of hotspots which need to be monitored and mitigated
as a whole in order to prevent the temperature to go above the
normative and legally stated 'skin temperature'.

Another aspect is to sustain the performance for a given power budget,
for example virtual reality where the user can feel dizziness if the
GPU performance is capped while a big CPU is processing something
else. Or reduce the battery charging because the dissipated power is
too high compared with the power consumed by other devices.

The userspace is the most adequate place to dynamically act on the
different devices by limiting their power given an application
profile: it has the knowledge of the platform.

These userspace daemons are in charge of the Dynamic Thermal Power
Management (DTPM).

Nowadays, the dtpm daemons are abusing the thermal framework as they
act on the cooling device state to force a specific and arbitrary
state without taking care of the governor decisions. Given the closed
loop of some governors that can confuse the logic or directly enter in
a decision conflict.

As the number of cooling device support is limited today to the CPU
and the GPU, the dtpm daemons have little control on the power
dissipation of the system. The out of tree solutions are hacking
around here and there in the drivers, in the frameworks to have
control on the devices. The common solution is to declare them as
cooling devices.

There is no unification of the power limitation unit, opaque states
are used.

This patch provides a way to create a hierarchy of constraints using
the powercap framework. The devices which are registered as power
limit-able devices are represented in this hierarchy as a tree. They
are linked together with intermediate nodes which are just there to
propagate the constraint to the children.

The leaves of the tree are the real devices, the intermediate nodes
are virtual, aggregating the children constraints and power
characteristics.

Each node have a weight on a 2^10 basis, in order to reflect the
percentage of power distribution of the children's node. This
percentage is used to dispatch the power limit to the children.

The weight is computed against the max power of the siblings.

This simple approach allows to do a fair distribution of the power
limit.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-12-22 19:50:40 +01:00
..
accessibility speakup: fix uninitialized flush_lock 2020-12-09 15:38:13 +01:00
acpi Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
amba
android binder: add flag to clear buffer on txn complete 2020-12-09 15:41:21 +01:00
ata
atm Merge https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-11-19 19:08:46 -08:00
auxdisplay auxdisplay: panel: Remove redundant charlcd_ops structures 2020-11-16 17:13:37 +01:00
base Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
bcma
block zram: break the strict dependency from lzo 2020-12-15 12:13:47 -08:00
bluetooth Bluetooth: btusb: Add workaround for remote-wakeup issues with Barrot 8041a02 fake CSR controllers 2020-12-07 17:01:54 +02:00
bus Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
cdrom
char Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
clk Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
clocksource Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
connector
counter counter: microchip-tcb-capture: Fix CMR value check 2020-12-03 19:40:31 +00:00
cpufreq Merge branch 'pm-cpufreq' 2020-12-15 15:24:52 +01:00
cpuidle Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
crypto Networking updates for 5.11 2020-12-15 13:22:29 -08:00
dax vm_ops: rename .split() callback to .may_split() 2020-12-15 12:13:41 -08:00
dca
devfreq Merge branches 'pm-devfreq' and 'pm-tools' 2020-12-15 15:27:16 +01:00
dio
dma dmaengine fixes for v5.10-rc5 2020-11-20 10:23:49 -08:00
dma-buf Merge branch 'akpm' (patches from Andrew) 2020-12-15 12:53:37 -08:00
edac Merge branch 'akpm' (patches from Andrew) 2020-12-15 12:53:37 -08:00
eisa
extcon extcon: max77693: Fix modalias string 2020-12-11 17:18:10 +09:00
firewire
firmware Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
fpga Merge 5.10-rc7 into char-misc-next 2020-12-07 10:08:14 +01:00
fsi hwmon patches for v5.11 2020-12-15 16:06:14 -08:00
gnss
gpio gpio: eic-sprd: break loop when getting NULL device resource 2020-12-09 09:41:49 +01:00
gpu Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2020-11-22 14:36:06 -08:00
hsi
hv hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hwmon hwmon: (sbtsi) Add basic support for SB-TSI sensors 2020-12-12 08:32:35 -08:00
hwspinlock
hwtracing Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
i2c Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
i3c
ide ide: remove BUG_ON(in_interrupt() || irqs_disabled()) from ide_unregister() 2020-12-15 12:13:36 -08:00
idle intel_idle: Build fix 2020-12-03 10:00:23 +01:00
iio Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-12-15 16:18:23 -08:00
interconnect interconnect changes for 5.11 2020-12-04 14:11:20 +01:00
iommu Yet another large set of x86 interrupt management updates: 2020-12-14 18:59:53 -08:00
ipack
irqchip irqchip/qcom-pdc: Fix phantom irq when changing between rising/falling 2020-12-12 10:46:02 +00:00
isdn net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
leds
lightnvm
macintosh macintosh/adb-iop: Send correct poll command 2020-12-07 10:48:16 +01:00
mailbox
mcb
md Revert "dm raid: fix discard limits for raid1 and raid10" 2020-12-14 12:12:08 -05:00
media Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
memory
memstick memstick: r592: Fix error return in r592_probe() 2020-12-04 12:27:10 +01:00
message
mfd
misc MMC core: 2020-12-15 15:57:25 -08:00
mmc MMC core: 2020-12-15 15:57:25 -08:00
most
mtd mtd: rawnand: xway: Do not force a particular software ECC engine 2020-12-11 20:10:02 +01:00
mux
net USB / Thunderbolt patches for 5.11-rc1 2020-12-15 13:54:56 -08:00
nfc Networking updates for 5.11 2020-12-15 13:22:29 -08:00
ntb
nubus
nvdimm
nvme
nvmem nvmem: imx-ocotp: add support for the unaliged word count 2020-11-27 16:10:07 +01:00
of Driver core updates for 5.11-rc1 2020-12-15 14:02:26 -08:00
opp Merge branch 'pm-cpufreq' 2020-12-15 15:24:52 +01:00
oprofile
parisc
parport
pci Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
pcmcia
perf perf/imx_ddr: Add system PMU identifier for userspace 2020-12-09 14:14:02 +00:00
phy Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
pinctrl Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
platform Merge tag 'thermal-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux 2020-12-15 16:21:37 -08:00
pnp
power
powercap powercap/drivers/dtpm: Add API for dynamic thermal power management 2020-12-22 19:50:40 +01:00
pps
ps3
ptp ptp: clockmatrix: deprecate firmware older than 4.8.7 2020-12-09 15:00:55 -08:00
pwm pwm: sl28cpld: fix getting driver data in pwm callbacks 2020-12-03 09:57:37 -08:00
rapidio
ras
regulator Merge remote-tracking branch 'regulator/for-5.11' into regulator-next 2020-12-11 17:48:32 +00:00
remoteproc
reset
rpmsg
rtc ntp: Make the RTC sync offset less obscure 2020-12-11 10:40:53 +01:00
s390 Networking updates for 5.11 2020-12-15 13:22:29 -08:00
sbus
scsi Networking updates for 5.11 2020-12-15 13:22:29 -08:00
sfi
sh
siox siox: Make remove callback return void 2020-12-10 16:17:15 +01:00
slimbus slimbus: qcom: fix potential NULL dereference in qcom_slim_prg_slew() 2020-12-10 16:23:56 +01:00
soc Power management updates for 5.11-rc1 2020-12-15 16:30:31 -08:00
soundwire soundwire: intel: fix another unused-function warning 2020-12-05 13:11:54 +05:30
spi Merge remote-tracking branch 'spi/for-5.11' into spi-next 2020-12-11 17:49:01 +00:00
spmi spmi: Add driver shutdown support 2020-12-10 10:45:36 +01:00
ssb
staging Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
target SCSI fixes on 20201120 2020-11-20 16:24:28 -08:00
tc
tee Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-12-14 12:18:19 -08:00
thermal Merge tag 'thermal-v5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux 2020-12-15 16:21:37 -08:00
thunderbolt thunderbolt: Changes for v5.11 merge window 2020-12-08 13:41:45 +01:00
tty TTY/Serial patches for 5.11-rc1 2020-12-15 13:57:14 -08:00
uio uio: uio_hv_generic: use devm_kzalloc() for private data alloc 2020-12-09 19:59:00 +01:00
usb Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
vdpa Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2020-12-07 18:36:21 -08:00
vfio vfio: platform: Switch to use platform_get_mem_or_io() 2020-12-10 16:31:46 +01:00
vhost vhost: vringh: use krealloc_array() 2020-12-15 12:13:37 -08:00
video drm for 5.11-rc1 2020-12-14 11:07:56 -08:00
virt
virtio mm, page_poison: remove CONFIG_PAGE_POISONING_NO_SANITY 2020-12-15 12:13:46 -08:00
visorbus
vlynq
vme vme: switch from 'pci_' to 'dma_' API 2020-12-09 19:44:34 +01:00
w1
watchdog
xen xen/unpopulated-alloc: consolidate pgmap manipulation 2020-12-15 12:13:40 -08:00
zorro
Kconfig
Makefile vdpa: mlx5: fix vdpa/vhost dependencies 2020-12-02 04:09:56 -05:00