Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1495147pxb; Fri, 1 Oct 2021 11:51:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGMT/nyHzPQOJcYLBeZSTvlnLb86G9l2162Os/02VzbB4HlBlWf99LR5AkvxEvd94TuJej X-Received: by 2002:a17:906:31cf:: with SMTP id f15mr8242681ejf.272.1633114311009; Fri, 01 Oct 2021 11:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633114311; cv=none; d=google.com; s=arc-20160816; b=aVVaeOTpTK4Ant+iaEwdpaANYSwYOhhoVay1W5L62A1u468RPOomGl10dPgBL7QkDp 1UeaCXqBg9nQjlQEXKBPFwdI15WjKxN0V+1NXHBJjSEamk7xy9HNbSzIYHJSzOwU8K7c /NRH0kLdl7MbnwdM+KDneZuMrBtYD6vUD8kzEQ0ZAGNi0r5x2u902jU++o51kIhYud+W d51MMNapme9ouTzvB04UYiVVErJvwlYAIn4vQnJR5Zb5hpsjrL0fCllS2hpMTvDa6Fvx 2x7TGMixXtNwrZgN0Ly96e9X5iepBULkTzzAviA+dLnDIUtaB0rNE2ODrE57QxU3Wk6B vzxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=4Q7Yakx1bnlDnZP0EqNwqBXdC+CI5UVFLyCydfGIqOI=; b=sg+EDvItIoaJ39ko8fDoLpmxfttbMmEW9aHSXrXwf1cVeM3pv0t5iu/D9xKRW2eNKk ls3/8cfZD4Ol3wyy/VgA+sBFJMWU/MXHeHGEJQmb4+ZqeRmTptp4/qvryJDXr1X9eVjf AU+DkQp8q+2vTglbmsXZJuWb4xxiFOPS8sWRKZIr0ezsrMpAJBqcYGQIh+R2HoISQR51 N2eUg/wMEKKCdDrJU0RvD7YNeEtRIwxARBUBKIA4J6de5ZOQznWp46mdZrY18J2wwl0b MV44dfwAVRmqrlbRxHitby84QJs4Cfp+7NWW52JTzaLlUeI0R0uyVJoDk0yRYrmbchJZ CxoA== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh9si10129857ejb.137.2021.10.01.11.51.25; Fri, 01 Oct 2021 11:51:50 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354722AbhJAQ74 (ORCPT + 99 others); Fri, 1 Oct 2021 12:59:56 -0400 Received: from mail-ot1-f48.google.com ([209.85.210.48]:46968 "EHLO mail-ot1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353953AbhJAQ7z (ORCPT ); Fri, 1 Oct 2021 12:59:55 -0400 Received: by mail-ot1-f48.google.com with SMTP id o59-20020a9d2241000000b0054745f28c69so12255055ota.13; Fri, 01 Oct 2021 09:58:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Q7Yakx1bnlDnZP0EqNwqBXdC+CI5UVFLyCydfGIqOI=; b=Ua14CiV5oUNIJwxbpVC6tNh8YXwLbimtRwveGhhSMBABcbr1umxxPk6mAZj9tBX4sr YHQ3Yi5c7zFsHWoUs/VTSXPJ+HxLl8RnbezXnASbVT/y1LJGBJFXlJCrY3pFOlJINFPd BMHKcYndSMXwNpfbSdxrVUvmkTxdbwtb4BOiqQtrmjwQVzyxyVOt3KsjxqnweTGXGsBp vvARuTm2eAqMYTJ1yTmmG4lKuDOIpyiKYsL5FM128o50iuCMqqk41aGP8CXVfvTBUmMt YSiklgDrSTB7b1r2dXOm4O9R2qZR1fdnT9yDZ3vYZfJGzt1AY6vWbDaghoPQ6SXF8wE0 a9TA== X-Gm-Message-State: AOAM530pqDfOXHL6UDxIXhnRUhLdcK+DErBrzq2Ru/RfgYm72dZS8yKW KmKEwlHrTZL192piZ7Zg7l3sfoCtZyMMjZJIYC4= X-Received: by 2002:a05:6830:82b:: with SMTP id t11mr11082122ots.319.1633107490735; Fri, 01 Oct 2021 09:58:10 -0700 (PDT) MIME-Version: 1.0 References: <6417aeca2f0c450545469b82f6b9bb615d1fa8ea.1632994837.git.mchehab+huawei@kernel.org> In-Reply-To: <6417aeca2f0c450545469b82f6b9bb615d1fa8ea.1632994837.git.mchehab+huawei@kernel.org> From: "Rafael J. Wysocki" Date: Fri, 1 Oct 2021 18:57:59 +0200 Message-ID: Subject: Re: [PATCH v2 1/7] ABI: sysfs-class-thermal: create a file with thermal_zone ABI To: Mauro Carvalho Chehab Cc: Linux Doc Mailing List , Greg Kroah-Hartman , Jonathan Corbet , Amit Kucheria , Daniel Lezcano , Zhang Rui , Linux Kernel Mailing List , Linux PM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 11:45 AM Mauro Carvalho Chehab wrote: > > The thermal ABI is described, together with the internal > development details at: > > Documentation/driver-api/thermal/sysfs-api.rst > > Move the sysfs API description to Documentation/ABI, > ensuring that scripts/get_abi.pl will properly parse it. So the subject of the patch should be something like thermal: Move ABI documentation do Documentation/ABI Also please mention the MAINTAINERS update in the changelog. > Signed-off-by: Mauro Carvalho Chehab > --- > > See [PATCH v2 0/7] at: https://lore.kernel.org/all/cover.1632994837.git.mchehab+huawei@kernel.org/ > > Documentation/ABI/testing/sysfs-class-thermal | 259 ++++++++++++++++++ > .../driver-api/thermal/sysfs-api.rst | 225 +-------------- > MAINTAINERS | 2 + > 3 files changed, 264 insertions(+), 222 deletions(-) > create mode 100644 Documentation/ABI/testing/sysfs-class-thermal > > diff --git a/Documentation/ABI/testing/sysfs-class-thermal b/Documentation/ABI/testing/sysfs-class-thermal > new file mode 100644 > index 000000000000..2c52bb1f864c > --- /dev/null > +++ b/Documentation/ABI/testing/sysfs-class-thermal > @@ -0,0 +1,259 @@ > +What: /sys/class/thermal/thermal_zoneX/type > +Description: > + Strings which represent the thermal zone type. > + This is given by thermal zone driver as part of registration. > + E.g: "acpitz" indicates it's an ACPI thermal device. > + In order to keep it consistent with hwmon sys attribute; this > + shouldbe a short, lowercase string, not containing spaces nor > + dashes. > + > + RO, Required > + > +What: /sys/class/thermal/thermal_zoneX/temp > +Description: > + Current temperature as reported by thermal zone (sensor). > + > + Unit: millidegree Celsius > + > + RO, Required > + > +What: /sys/class/thermal/thermal_zoneX/mode > +Description: > + One of the predefined values in [enabled, disabled]. > + This file gives information about the algorithm that is > + currently managing the thermal zone. It can be either default > + kernel based algorithm or user space application. > + > + enabled > + enable Kernel Thermal management. > + disabled > + Preventing kernel thermal zone driver actions upon > + trip points so that user application can take full > + charge of the thermal management. > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/policy > +Description: > + One of the various thermal governors used for a particular zone. > + > + RW, Required > + > +What: /sys/class/thermal/thermal_zoneX/available_policies > +Description: > + Available thermal governors which can be used for a > + particular zone. > + > + RO, Required > + > +What: /sys/class/thermal/thermal_zoneX/trip_point_Y_temp > +Description: > + The temperature above which trip point will be fired. > + > + Unit: millidegree Celsius > + > + RO, Optional > + > +What: /sys/class/thermal/thermal_zoneX/trip_point_Y_type > +Description: > + Strings which indicate the type of the trip point. > + > + E.g. it can be one of critical, hot, passive, `active[0-*]` > + for ACPI thermal zone. > + > + RO, Optional > + > +What: /sys/class/thermal/thermal_zoneX/trip_point_Y_hyst > +Description: > + The hysteresis value for a trip point, represented as an > + integer. > + > + Unit: Celsius > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/cdevY > +Description: > + Sysfs link to the thermal cooling device node where the sys I/F > + for cooling device throttling control represents. > + > + RO, Optional > + > +What: /sys/class/thermal/thermal_zoneX/cdevY_trip_point > +Description: > + The trip point in this thermal zone which `cdev[0-*]` is > + associated with; -1 means the cooling device is not > + associated with any trip point. > + > + RO, Optional > + > +What: /sys/class/thermal/thermal_zoneX/cdevY_weight > +Description: > + The influence of `cdev[0-*]` in this thermal zone. This value > + is relative to the rest of cooling devices in the thermal > + zone. For example, if a cooling device has a weight double > + than that of other, it's twice as effective in cooling the > + thermal zone. > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/emul_temp > +Description: > + Interface to set the emulated temperature method in thermal zone > + (sensor). After setting this temperature, the thermal zone may > + pass this temperature to platform emulation function if > + registered or cache it locally. This is useful in debugging > + different temperature threshold and its associated cooling > + action. This is write only node and writing 0 on this node > + should disable emulation. > + > + Unit: millidegree Celsius > + > + WO, Optional > + > + WARNING: > + Be careful while enabling this option on production systems, > + because userland can easily disable the thermal policy by simply > + flooding this sysfs node with low temperature values. > + > + > +What: /sys/class/thermal/thermal_zoneX/k_d > +Description: > + The derivative term of the power allocator governor's PID > + controller. For more information see > + Documentation/driver-api/thermal/power_allocator.rst > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/k_i > +Description: > + The integral term of the power allocator governor's PID > + controller. This term allows the PID controller to compensate > + for long term drift. For more information see > + Documentation/driver-api/thermal/power_allocator.rst > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/k_po > +Description: > + The proportional term of the power allocator governor's PID > + controller during temperature overshoot. Temperature overshoot > + is when the current temperature is above the "desired > + temperature" trip point. For more information see > + Documentation/driver-api/thermal/power_allocator.rst > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/k_pu > +Description: > + The proportional term of the power allocator governor's PID > + controller during temperature undershoot. Temperature undershoot > + is when the current temperature is below the "desired > + temperature" trip point. For more information see > + Documentation/driver-api/thermal/power_allocator.rst > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/integral_cutoff > +Description: > + Temperature offset from the desired temperature trip point > + above which the integral term of the power allocator > + governor's PID controller starts accumulating errors. For > + example, if integral_cutoff is 0, then the integral term only > + accumulates error when temperature is above the desired > + temperature trip point. For more information see > + Documentation/driver-api/thermal/power_allocator.rst > + > + Unit: millidegree Celsius > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/slope > +Description: > + The slope constant used in a linear extrapolation model > + to determine a hotspot temperature based off the sensor's > + raw readings. It is up to the device driver to determine > + the usage of these values. > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/offset > +Description: > + The offset constant used in a linear extrapolation model > + to determine a hotspot temperature based off the sensor's > + raw readings. It is up to the device driver to determine > + the usage of these values. > + > + RW, Optional > + > +What: /sys/class/thermal/thermal_zoneX/sustainable_power > +Description: > + An estimate of the sustained power that can be dissipated by > + the thermal zone. Used by the power allocator governor. For > + more information see > + Documentation/driver-api/thermal/power_allocator.rst > + > + Unit: milliwatts > + > + RW, Optional > + > +What: /sys/class/thermal/cooling_deviceX/type > +Description: > + String which represents the type of device, e.g: > + > + - for generic ACPI: should be "Fan", "Processor" or "LCD" > + - for memory controller device on intel_menlow platform: > + should be "Memory controller". > + > + RO, Required > + > +What: /sys/class/thermal/cooling_deviceX/max_state > +Description: > + The maximum permissible cooling state of this cooling device. > + > + RO, Required > + > +What: /sys/class/thermal/cooling_deviceX/cur_state > +Description: > + The current cooling state of this cooling device. > + The value can any integer numbers between 0 and max_state: > + > + - cur_state == 0 means no cooling > + - cur_state == max_state means the maximum cooling. > + > + RW, Required > + > +What: /sys/class/thermal/cooling_deviceX/stats/reset > +Description: > + Writing any value resets the cooling device's statistics. > + > + WO, Required > + > +What: /sys/class/thermal/cooling_deviceX/stats/time_in_state_ms: > +Description: > + The amount of time spent by the cooling device in various > + cooling states. The output will have "