Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1556065rdb; Wed, 31 Jan 2024 02:09:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8CE9Yut7qRk8ClULe4siUw0ZOmWdv8c7Ol7Mp9Du6lWqRRm/Smpgb/s6y+TP/u4QhQAeb X-Received: by 2002:a17:906:a847:b0:a36:695e:60e1 with SMTP id dx7-20020a170906a84700b00a36695e60e1mr895168ejb.63.1706695749105; Wed, 31 Jan 2024 02:09:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706695749; cv=pass; d=google.com; s=arc-20160816; b=xBthfGnIAdrZF9ComXn9psJtHkTgpzOiGPCXkgkM8AxKj3gslg+KSjhDzOU6yanhhp Jhxrb4GzBQnIgoq4oBXq8UDh1jiEkIQjcrcJSt6q+zgEAYDWrgC8W28AQTcr5wM7sx2+ f4lE11eY5jctwGdsrLRipUi4UGpVj7r6OwIaxEIl66TC4RJaI4wEDkxmiZADEwk82fnP 8+2C3FRrtHevzPmHtEB6sV44ovr/ukxNQUuJHqkgJYt2WOMmqNCZB1L6LV+Q5Ao6qyPG 57k0FZ6aHRZlQecnBHL0z5/H3J7uDw3u5zePkTQcgAgnCJv1WLurhbHzHlby/JSHFCvC VuZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:message-id:references:in-reply-to:subject :cc:to:from:date:dkim-signature:mime-version:list-unsubscribe :list-subscribe:list-id:precedence; bh=6JCmGi/vABcqFbAYIX4DWFvcJjSKxoxQP5nERWYlDuk=; fh=xWZsGqmWlRljAjRefYLMLxb4fMIFR+TcWMiu2heWuiM=; b=rjto78veTU2eBTdNWS4cLje1wgnguwpoTDKrjleIQpEIVMg/2u/mxH9Bx41YDOD0fm YzAc4s+9G6lnV7N+un7XwtRLzevJgl9CdEZLBG17tY/8SPwaF4oETO792/soUOjzpesO 5hUo5bcoWyvRUUD8nKpsIBIP+3tLYdqQArNU/zwF/BVfU0r265IGWFAyIwjhYr3inq38 T4J+/A1U3x+3nNkBbgsHZD8MgGwn0j3agUyvBo+sZ/LBRhZcEx3aeIARnTEBFQSLhr/f lCr/PPvNSRRsKxjCBJdUV7GUZwCKmHLUDmtbwp/xgM1FTX48PED268ImcRpk9GMo520Z lIKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=LMwVQErL; arc=pass (i=1 spf=pass spfdomain=manjaro.org dkim=pass dkdomain=manjaro.org dmarc=pass fromdomain=manjaro.org); spf=pass (google.com: domain of linux-kernel+bounces-46180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org X-Forwarded-Encrypted: i=1; AJvYcCVtMsnmunsn0VRLOzklBh4YeZ0z0aMVPFR8vxunh7GJ5pWnTQXgQqgMYL5YRr8WikanGhEDCJVtUgqw5N6UK1joLmUNZb2YYIHLd0jFZA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m9-20020a1709060d8900b00a3530bdb51csi4363676eji.187.2024.01.31.02.09.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:09:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=LMwVQErL; arc=pass (i=1 spf=pass spfdomain=manjaro.org dkim=pass dkdomain=manjaro.org dmarc=pass fromdomain=manjaro.org); spf=pass (google.com: domain of linux-kernel+bounces-46180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ACD001F21BBF for ; Wed, 31 Jan 2024 10:09:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE0DE69979; Wed, 31 Jan 2024 10:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="LMwVQErL" Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 167D569D00; Wed, 31 Jan 2024 10:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706695739; cv=none; b=B0LSnyEULZNEftQQyLAMS4pFJEjRHJ/v22QSntJ+soEitiU6KbXXlCLtJoOVx0Gien16/WQaroZjQa8gYabyyQ/GHRETGSYEkHuUP0+G/5SY6Ovpx5rrMnTGQn9eN8K6NJO6jktqqzYtvB4ZZI4maD4M5ZToaOYtx1RAX+nHgXI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706695739; c=relaxed/simple; bh=VGccL/d9Jh3SX3ofkFgHSICtp5humDPOSw2NmoTxOZ0=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=sFMkDKB6WGXwwubq4hgcWxzyHuM2ZWl+4IABTE3H6enH28CU2K3GDzF9kHQrpE7DXh5+UGeZ0hKGjVGaAGyYcjoko0OUHU5Hg7LcPHEKlM0xiDAVci45x0fWr7G51Ww3VOHovG/KHM0xM+/BiDG1TptglZIqCisYP8Ua2YNVuzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=LMwVQErL; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1706695733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6JCmGi/vABcqFbAYIX4DWFvcJjSKxoxQP5nERWYlDuk=; b=LMwVQErLZnUMAfgvZ7dCsBTivEFe6gy4V+Xi+6cEKyXmHDGO2jBQnR6ud7cQIq4fZEfgfv Q/thtdW5cVTaNfJAPA5/hUUbQMVkzxvRpQeedcHE/Uwe4vJaZUe7AX37JOTRYhdVKSX/eK XfX1N3yWG+XEm7rZW6Jyw2xt/FwG+kWWHlUkD6iRmqlokNQ3xTHyEmdibwawUMhLb75TkP ds3h/Mo16J00q2gmqQwNp7A97Ex78CPS1wNo8rnsIBQy2DocFBsYH7IGE0CeFF1m4Q3aBy wHR+F431p+UBfFxkX44ffCGT1V5KUHhJXNdsHuBehCNNozk9E5GX38d8F1tzWQ== Date: Wed, 31 Jan 2024 11:08:53 +0100 From: Dragan Simic To: Alexey Charkov Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Daniel Lezcano , Viresh Kumar , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] arm64: dts: rockchip: enable built-in thermal monitoring on rk3588 In-Reply-To: References: <20240130-rk-dts-additions-v2-0-c6222c4c78df@gmail.com> <20240130-rk-dts-additions-v2-1-c6222c4c78df@gmail.com> <0702542c8d7dc4139ba5da690fd98e67@manjaro.org> Message-ID: <00cb830bbf9a03787e53de0b05cb076c@manjaro.org> X-Sender: dsimic@manjaro.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org On 2024-01-31 10:56, Alexey Charkov wrote: > On Wed, Jan 31, 2024 at 9:05 AM Dragan Simic > wrote: >> Some small nitpicks below, please have a look. >> >> On 2024-01-30 19:21, Alexey Charkov wrote: >> > Include thermal zones information in device tree for rk3588 variants >> >> Please use "RK3588" instead of "rk3588", both here and in the >> patch subject. Looks much better. > > Noted, thanks! > >> > Signed-off-by: Alexey Charkov >> > --- >> > arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 162 >> > ++++++++++++++++++++++++++++++ >> > 1 file changed, 162 insertions(+) >> > >> > diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >> > b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >> > index 36b1b7acfe6a..696cb72d75d0 100644 >> > --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >> > +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi >> > @@ -10,6 +10,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > >> > / { >> > compatible = "rockchip,rk3588"; >> > @@ -2228,6 +2229,167 @@ tsadc: tsadc@fec00000 { >> > status = "disabled"; >> > }; >> > >> > + thermal_zones: thermal-zones { >> > + /* sensor near the center of the whole chip */ >> >> It would be good to replace "whole chip" with "SoC". Simpler and >> IIRC closer to the official description of the sensor. > > The TRM only says "near chip center" (sic) :) In that case, it would be good to just replace "whole" with "entire" in the original wording. :) >> > + package_thermal: package-thermal { >> > + polling-delay-passive = <0>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 0>; >> > + >> > + trips { >> > + package_crit: package-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + }; >> > + >> > + /* sensor between A76 cores 0 and 1 */ >> > + bigcore0_thermal: bigcore0-thermal { >> > + polling-delay-passive = <100>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 1>; >> > + >> > + trips { >> >> Please add the following comment here, to make it clear what's >> the purpose of this thermal trip when the IPA thermal governor >> is used (more similar comments below): >> >> /* IPA threshold */ > > Not so sure about this one: shouldn't the device tree be > implementation agnostic, and just describe the hardware and its > expectations? Sounds like references to a particular thermal governor > would be out of scope. I'd agree on that, but having two passive thermal trips is already kinda out of place, because only one is actually needed, so we should describe the reason why there are multiples of pairs. I have some plans for getting this resolved in a way that's much more governor-agnostic, but it will take some time. In the meantime, having the comments can only help anyone reading the dtsi file to understand the need for additional thermal trips. I hope you agree. >> > + bigcore0_alert0: bigcore0-alert0 { >> > + temperature = <75000>; >> > + hysteresis = <2000>; >> > + type = "passive"; >> > + }; >> >> Please add the following comment here: >> >> /* IPA target */ >> >> > + bigcore0_alert1: bigcore0-alert1 { >> > + temperature = <85000>; >> > + hysteresis = <2000>; >> > + type = "passive"; >> > + }; >> > + bigcore0_crit: bigcore0-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + cooling-maps { >> > + map0 { >> > + trip = <&bigcore0_alert1>; >> > + cooling-device = >> > + <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, >> > + <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; >> > + }; >> > + }; >> > + }; >> > + >> > + /* sensor between A76 cores 2 and 3 */ >> > + bigcore2_thermal: bigcore2-thermal { >> > + polling-delay-passive = <100>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 2>; >> > + >> > + trips { >> >> Please add the following comment here: >> >> /* IPA threshold */ >> >> > + bigcore2_alert0: bigcore2-alert0 { >> > + temperature = <75000>; >> > + hysteresis = <2000>; >> > + type = "passive"; >> > + }; >> >> Please add the following comment here: >> >> /* IPA target */ >> >> > + bigcore2_alert1: bigcore2-alert1 { >> > + temperature = <85000>; >> > + hysteresis = <2000>; >> > + type = "passive"; >> > + }; >> > + bigcore2_crit: bigcore2-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + cooling-maps { >> > + map0 { >> > + trip = <&bigcore2_alert1>; >> > + cooling-device = >> > + <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, >> > + <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; >> > + }; >> > + }; >> > + }; >> > + >> > + /* sensor between the four A55 cores */ >> > + little_core_thermal: littlecore-thermal { >> > + polling-delay-passive = <100>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 3>; >> > + >> > + trips { >> >> Please add the following comment here: >> >> /* IPA threshold */ >> >> > + littlecore_alert0: littlecore-alert0 { >> > + temperature = <75000>; >> > + hysteresis = <2000>; >> > + type = "passive"; >> > + }; >> >> Please add the following comment here: >> >> /* IPA target */ >> >> > + littlecore_alert1: littlecore-alert1 { >> > + temperature = <85000>; >> > + hysteresis = <2000>; >> > + type = "passive"; >> > + }; >> > + littlecore_crit: littlecore-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + cooling-maps { >> > + map0 { >> > + trip = <&littlecore_alert1>; >> > + cooling-device = >> > + <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, >> > + <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, >> > + <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, >> > + <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; >> > + }; >> > + }; >> > + }; >> > + >> > + /* sensor near the PD_CENTER power domain */ >> > + center_thermal: center-thermal { >> > + polling-delay-passive = <0>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 4>; >> > + >> > + trips { >> > + center_crit: center-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + }; >> > + >> > + gpu_thermal: gpu-thermal { >> > + polling-delay-passive = <0>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 5>; >> > + >> > + trips { >> > + gpu_crit: gpu-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + }; >> > + >> > + npu_thermal: npu-thermal { >> > + polling-delay-passive = <0>; >> > + polling-delay = <0>; >> > + thermal-sensors = <&tsadc 6>; >> > + >> > + trips { >> > + npu_crit: npu-crit { >> > + temperature = <115000>; >> > + hysteresis = <0>; >> > + type = "critical"; >> > + }; >> > + }; >> > + }; >> > + }; >> > + >> > saradc: adc@fec10000 { >> > compatible = "rockchip,rk3588-saradc"; >> > reg = <0x0 0xfec10000 0x0 0x10000>;