Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp11703rdb; Thu, 25 Jan 2024 07:00:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGH8QzZqHxQ+BJ1CU37SR0mKt3L9szC+aPnokus6duerJ82YHA+7F685TxqH+5XdAOSo7Wa X-Received: by 2002:a17:902:724b:b0:1d7:900:40d6 with SMTP id c11-20020a170902724b00b001d7090040d6mr897394pll.72.1706194805531; Thu, 25 Jan 2024 07:00:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706194805; cv=pass; d=google.com; s=arc-20160816; b=nNzz2gvCML1p2XiBHs9lCKzhzIWldEDkueH0N4FNE1JYfCtEBiwn2kHVMzsEodPCBS 6DvE3DMmLgeW6VQKiaWG2zUSz8b1Ubn//IOI3Hh6ZsGOaS96X5ek3dep+uOHHH047Xnz 5qvrRRyX3vLXBHykYLXF9TcZBlVSoa/9XW3+wp8B12E4sWngCA2LlDpdNkzyGtSN1Ydc MQbozOEPeLROBKmMyikLHCQBgqeLiz5OZj6YFxD6m/U8cTOuP+49MynCmo41al+G+Ywq UgLXYKqLM2QoyQYk2h653PoxfDIqctDUxk8fBRCBZOmC0r+laqeiYNqEmtPpr74qDLrM gH/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=n4hX8W9xNuyyOSQCgz2SgdgTnuDIhAWJKxtpQ17e4fg=; fh=BRa/KpI/huPNAEe8/pzuygLTZEDZZR9l7N/3a+QvsWw=; b=Svj5ofzfaLYN6xIleF4QF7vBn8fSRxedBjXssYk7Zt9TY9fawLaLYEaM1rLfcqAo+g K8NPRqp9BXPIXjCV1MDQl+T22OADaBRSbR1Jfc3i5LoilflkgsYd/+7fSQtBvGv2oPZS 06tcRD0YrB8yhy+UZ/BOU/iBjQ+uxzRFe8oa9BhKKypPkULTSrP8PcpDXMvNihcgGGTA palzuH65/Fr7fWol3tPrgwO/8a9BJ3TEnf+Kxe0mqrpj9R/mFkViXIYx5UcfICkTClyY HzB0GACzcDovcfAMIHHpuKJhNq8EPGvqj77EedP2x/wmDwy7MDShVj014z2H15BW2SEy T4FQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iqDoQVCF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38742-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38742-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e12-20020a17090301cc00b001d76c77a6e3si5255382plh.191.2024.01.25.07.00.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 07:00:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38742-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iqDoQVCF; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38742-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38742-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CAAD1292563 for ; Thu, 25 Jan 2024 14:47:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DAEB6E2DF; Thu, 25 Jan 2024 14:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iqDoQVCF" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5D676E2D9; Thu, 25 Jan 2024 14:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706194031; cv=none; b=UzSH1J4PsfCR1kw9XtSLlrUpYAIVHPW6AXmOR28iiB+TzD+H1htA4al0nXgWU2evWhmsyRzDCKAQImLtnokuH03DcQ2X5uUkmew7Hxf1nA0Zk5QcUGtgSJdVCa8Gm96pQRneAmy/Sh6kobCCpqbZ+CHxRDrTMKTvj21+9oVC9ro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706194031; c=relaxed/simple; bh=hfDxzQWo/PGBd3L2W8+BoRAcKd91eLKtldatvc5IaEs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=u0Xh74XzRP4j8M65x5UEXRbXEcqOrH1wUyYW9D+nFTqamZ+Vk9EHdvb1BGTm/MguXuNAtMKqDDMke1H2iR/4iyI1crGDvTknpvs61KLd95dTlP1I7mhnNjPrMZLdA1JPm0ZQz90/znWGK/MgTvJTYPUh3hNCU1nli782zITrE8Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iqDoQVCF; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-55a50649ff6so7535961a12.3; Thu, 25 Jan 2024 06:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706194028; x=1706798828; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=n4hX8W9xNuyyOSQCgz2SgdgTnuDIhAWJKxtpQ17e4fg=; b=iqDoQVCFNDWB3hUgJrN6EnhQH2EbPZ2hAp3t+Cbd9fVN7OyplLoKGoBs/xYae8C4mJ g8epmqiF3Hfdl0dgXzgv2oZZgA0hj0d2N9ZLsMDBcsqto1zIp3JCpCj1UsE7kzISf8qb i91QjgCsbG33viZHToz1eMz/AzfsscdwLGnYv7qU4nTIXsi4lCTWJ5DETMaRoP/PlDqC IGwpWAtoBXXa3V0wlAjx9KkPOl83aoBNfcdoBp0qd69kFcHDBrpRLKW/2mcPlY9D3SWP dCbdgJ6F9fGTAdgUjf0Kbx5WOE71jMlzJtAd1SYHDdCGq+KId1cUgbR6keFDh0acSLtE GD/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194028; x=1706798828; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n4hX8W9xNuyyOSQCgz2SgdgTnuDIhAWJKxtpQ17e4fg=; b=U/hdphr1CS+GREwRyz6VxmrXP3GVgmsXI17Xa2Z834A8BXhlZYpMRE2tYAQKq9xB5Z xt3pyrDXEorWRMjYUc0EnUCZE2tHHaYPcVTSA1w3pDAaLCoh/oXQyioJ/TXCqnCOa38K QJBL39Blsg1aiX3voacuapWvxBUUzdZ+XXWiPvWCI0BvRwEE8WrKB8B7uYG8w+nQHXra xc9kZyHIu1JcO+2cygxfcoCBzduzXwlbsts0CZ/Bff8fwdHuKgWTAGeiD92WMsL8li4u ZNF5ROoyuDF+EO5CxzLyR8rIaJ9MePzT1Fl+s9z0wgmy0yWSazTIiJxevaduDJKxMLT6 kNHw== X-Gm-Message-State: AOJu0YwxfFXP9NBmpLpuf4lwXxhKEca9Pu7VLDMcowbhakqIL4n7nl+n BAMlzcAFqGPLb+4butHqvnWHsv31Mu9EgC+//x8/5dWfpaOP6fU+n0SRgwEhWGnt3WMpMBgWRCU cjzgI9TTMsmZCvZALo+mRSGyjf4k= X-Received: by 2002:a17:907:1591:b0:a2e:d32b:6fc7 with SMTP id cf17-20020a170907159100b00a2ed32b6fc7mr537611ejc.119.1706194027557; Thu, 25 Jan 2024 06:47:07 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240125-rk-dts-additions-v1-0-5879275db36f@gmail.com> <20240125-rk-dts-additions-v1-2-5879275db36f@gmail.com> <245f5692-be30-4216-8b13-988092793732@linaro.org> In-Reply-To: From: Alexey Charkov Date: Thu, 25 Jan 2024 18:46:56 +0400 Message-ID: Subject: Re: [PATCH 2/4] arm64: dts: rockchip: enable built-in thermal monitoring on rk3588 To: Daniel Lezcano Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Dragan Simic , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 25, 2024 at 2:02=E2=80=AFPM Daniel Lezcano wrote: > > On 25/01/2024 09:26, Alexey Charkov wrote: > > On Thu, Jan 25, 2024 at 1:56=E2=80=AFAM Daniel Lezcano > > wrote: > >> > >> On 24/01/2024 21:30, Alexey Charkov wrote: > >>> Include thermal zones information in device tree for rk3588 variants > >> > >> There is an energy model for the CPUs. But finding out the sustainable > >> power may be a bit tricky. So I suggest to remove everything related t= o > >> the power allocator in this change and propose a dedicated change with > >> all the power configuration (which includes proper k_p* coefficients t= o > >> be set from userspace to have a flat mitigation figure). > >> > >> That implies removing the "contribution" properties in this descriptio= n. > > > > Alright, I'll just drop those "contribution" properties, thanks! > > > >> Some comments below but definitively this version is close to be ok. > > > > Yay! :) > > > >>> Signed-off-by: Alexey Charkov > >>> --- > >>> arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 165 ++++++++++++++++++= ++++++++++++ > >>> 1 file changed, 165 insertions(+) > >>> > >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/b= oot/dts/rockchip/rk3588s.dtsi > >>> index 36b1b7acfe6a..131b9eb21398 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 =3D "rockchip,rk3588"; > >>> @@ -2228,6 +2229,170 @@ tsadc: tsadc@fec00000 { > >>> status =3D "disabled"; > >>> }; > >>> > >>> + thermal_zones: thermal-zones { > >>> + /* sensor near the center of the whole chip */ > >>> + package_thermal: package-thermal { > >>> + polling-delay-passive =3D <0>; > >>> + polling-delay =3D <0>; > >>> + thermal-sensors =3D <&tsadc 0>; > >>> + > >>> + trips { > >>> + package_crit: package-crit { > >>> + temperature =3D <115000>; > >>> + hysteresis =3D <0>; > >>> + type =3D "critical"; > >>> + }; > >>> + }; > >>> + }; > >>> + > >>> + /* sensor between A76 cores 0 and 1 */ > >>> + bigcore0_thermal: bigcore0-thermal { > >>> + polling-delay-passive =3D <20>; > >> > >> 20ms seems very short, is this value on purpose? Or just picked up > >> arbitrarily? > > > > Frankly, I simply used the value that Radxa's downstream DTS sets for > > my board. 100ms seem to work just as well. > > > >> If it is possible, perhaps you should profile the temperature of these > >> thermal zones (CPUs ones). There is a tool in > >> /tools/thermal/thermometer to do that. > >> > >> You can measure with 10ms sampling rate when running for instance > >> dhrystone pinned on b0 and b1, then on b2 and b3. And finally on the > >> small cluster. > > > > It seems tricky to isolate the effects from just one of the CPU > > clusters, as their individual thermal outputs are not that high. > > > > For my testing I disabled the fan (but didn't remove the heatsink to > > avoid wasting the thermal interface tape), > > It is ok but the system will have more heat capacity and it will be > necessary to saturate it before running the tests. IOW warm up the > system by running thermal stress tests several times. > > > and tried loading CPUs with > > stress-ng. Here are the observations: > > Usually I use drhystone to thermal stress the cores (e. one minute). Hmm, could you please point to the source package or repo to get the version of dhrystone you use? I could only find the old shar [1] and a Debian version with added Makefile [2], but neither seems to produce multiple threads. It doesn't seem to be packaged for either Gentoo or Fedora unfortunately. Indeed, I'm getting higher thermal load (vs. stress-ng --cpu) even by simply compiling kernel sources, although I'd expect it to wait for memory and/or IO quite a lot. [1] https://www.netlib.org/benchmark/dhry-c [2] https://github.com/qris/dhrystone-deb Thanks a lot, Alexey