Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1296234lqh; Mon, 6 May 2024 03:30:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+GoeUfXGW9h+VU4gstzMAcuq59dFXQasgF8WPK3JmbNORG22pFDVaR0Zm0INFl/FLVVUNxlCnalz9AVGfNHNiLMPVuSpRkzEkz10Ocw== X-Google-Smtp-Source: AGHT+IEZc6Uy5EETomxckM44Y4shV2HNZB+fzftfEhKFowsgvubcwMD+GVBMXFnjZ2LUkQbdcrOA X-Received: by 2002:a17:902:ef94:b0:1eb:77ed:8fba with SMTP id iz20-20020a170902ef9400b001eb77ed8fbamr9851902plb.17.1714991404601; Mon, 06 May 2024 03:30:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714991404; cv=pass; d=google.com; s=arc-20160816; b=FxDnowQhr+R3ElF7iqb+EseBq2gvpCkuII2twwkBvYuJAwdQd6njt5mlpOGiknUlKj IRSH5vz2EY9GLRvMKafEKz1KLEHzvUwIztply7KPmD8nvUmLRv5JXUq32VJ6aapj+DeL Lr/2txOyF9etjL7e9Vpg1VqouiXKkoVtn/3oT6IBr3haWG+zTaRURqRMXq/4UnRF76aQ pmYEyRFCWFcFukri+mXGVymQbHGQmI6wxUxNlFRiCTgjJftIbc2gM48UqktZTJuGjHIU /cno2RhP8xgA9dBcGApNx/FMDqfEQckdYyWWxNqojFHwYVNOLQEIHCQrCZfrTB3Oz0eW 1jJQ== 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=BNMaBJWGHZyABbZOaeEJdaPLgk7Dz9409DKeZNEhRws=; fh=CVvh/8lCtJVvt2qBEhxLOX+d84614D66GtiSYICeyjk=; b=QhCWQJI6jwOtccD5Faf3ijFYtkQ9juKkIW1hSTmsLjJRmKb6DQ7gkcdrZNk5CK5gBv CV8KV2pdCrrt4dkCFZlrv/u2+udB32hUizsC7qS7AIEn3q5OtQCdO2lqSAcNoPvwEcRc NuHwARyB59svXbzEC/SxG0v9S3HajDa42FmFJKo4ip9rJoz9LIsTCEVIwSIBUW2zOOyE vbHdeBHTmUKnJ9/kCrlHxHK/Yro3yKF2MurtFeg6tKdMRq8oSpqm5IdOSP7em1th86ZF nvbZ4Ci8mBeDiMJlTgm5WKWQNadmilzt1GORIgOuujizl2Wt+7pWgzHPgPs/pE7PdPIp Td8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iJTHnEME; 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-169669-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169669-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. [139.178.88.99]) by mx.google.com with ESMTPS id im22-20020a170902bb1600b001eb1f82c41dsi7854407plb.229.2024.05.06.03.30.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 03:30:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169669-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iJTHnEME; 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-169669-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169669-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 09E6728313C for ; Mon, 6 May 2024 10:30:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E09FC14290A; Mon, 6 May 2024 10:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iJTHnEME" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 452F414265C; Mon, 6 May 2024 10:29:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714991397; cv=none; b=OGnDsETXxU12ncMjXbx1i+VqyIvG063hZ6UJZavcgWCbMhynRIzvoTPFTumGIqyjM288co8odD5AJjF2hZ1bTRT0+VYNJ0TvmpnuJZW0g9q+VeBlCPEt6U/uEekXQGfXfZlzB9OPQjcTQeVly3IM5RegFlp4jQMs5lWvtiPnN0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714991397; c=relaxed/simple; bh=3PoJY7tNXwvsdNUc2P3zuM49T2QEkSgVCQPu9yNoIQk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=goTh1qY2tJI8U5Sl0QXIzZ4LGRVUjlTBd8DfBk+CQyU5PeUmOXE/Kw67PvvUS9UE1H7DzUjMWzhGag+sod0qvNB+wdI8LjLev3oZgWEGzX6AFiVkxvK5DWlbVyWxtIGGoH8ipxS7HFc5QIcbXHmrORZBePaN0OIwHKPlRbnYL78= 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=iJTHnEME; arc=none smtp.client-ip=209.85.167.49 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-lf1-f49.google.com with SMTP id 2adb3069b0e04-51fdc9af005so2632827e87.3; Mon, 06 May 2024 03:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714991393; x=1715596193; 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=BNMaBJWGHZyABbZOaeEJdaPLgk7Dz9409DKeZNEhRws=; b=iJTHnEMESoEnqovcI2yy2yqnM2qYNEnrUE9lEeM3JPqNQ4Td48/zil1+Ppr39vpK4I aaPJWvn+J/26VrK0QpZkYpSjC/2XAL3ugwLe9eLDn9FirWQX/FkmYr4I1vuW+qCICnCw x2CLNmhfV5/7OTmVm9LRT/5FxuD4RniMGGGXWusYyfvJkfUrMM6Dhdg5/2arJeJKEnlm cnX1ov9l0n5CZbP3XYj/KwriIwUNUbM3mls5U+0eRPtgHJRREvLzNqddjPpCskQ5WXnC 46Psip0geqolO33Va/D8Xlu0bi1FyotTcEBUHkrNeM7KbDMKjVlqFBJRJlxMosvkyhPz aCpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714991393; x=1715596193; 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=BNMaBJWGHZyABbZOaeEJdaPLgk7Dz9409DKeZNEhRws=; b=TynYazd6tvu1rzFeOKD69wMHBAbYTXmROuK8odK018PKw6hvI1VCR6CIGvKA/kMTO1 bTIK3y3nkPdxUbfk7z6sto9E4V/R0557vXAqNbsGBCSmI2JqXRzQAUecC0YafbFTRnOS a6h8ns/3GIgtIRBG0Tn3clkFPgornTOHeH3uTumz7JCqzOpkkJkxilToEcMPzIrhpjOf m0W268ukxBW5p6FOOXFL+bNpQBNydnV5T+JxvAR9W7DtA9J6JdmTyRax7qekiCAQfaJr OQQXAz32q3U41ZbOr+rwLjGC7TAeMrEsb+AX4K4gl1DHZf7L7t/5ULEYWQ8jCxYb3z5Y IzWw== X-Forwarded-Encrypted: i=1; AJvYcCVOpyam0pz8jvsmwUnyyqKOvXX5J9St/Fb/Gyiukrx+KuUHlJOPONNZz0VwVl6UURW/8LytiKdZ8cWXuAbzO+/U9L2Y8Kt5el9a9w/JpcVpJVoUr11M/0X4/FR5zjjCEs9GCZ6LlAcWDg== X-Gm-Message-State: AOJu0YwDX1NT5ZPs4arafsyoTukQPc0MrnGxj7gZXMez+ZnAD2hgx4qw ezKYcw4tkFCQia5PrKMKR+/09w6vI8vS5qsSHYQH5SxdHAJ0NOJPgh8bUvIHchBWKN9Id3sHHyq Od2+/upLTjLwvbtezstxTBlusNr4= X-Received: by 2002:a19:381a:0:b0:51b:528e:ce7d with SMTP id f26-20020a19381a000000b0051b528ece7dmr7786951lfa.34.1714991393205; Mon, 06 May 2024 03:29:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240506-rk-dts-additions-v4-0-271023ddfd40@gmail.com> <20240506-rk-dts-additions-v4-1-271023ddfd40@gmail.com> <5332d58d48607a5559a84a2f85ce3e1b@manjaro.org> In-Reply-To: <5332d58d48607a5559a84a2f85ce3e1b@manjaro.org> From: Alexey Charkov Date: Mon, 6 May 2024 14:29:41 +0400 Message-ID: Subject: Re: [PATCH v4 1/6] arm64: dts: rockchip: add thermal zones information on RK3588 To: Dragan Simic Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Daniel Lezcano , Viresh Kumar , Chen-Yu Tsai , Diederik de Haas , 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 Hello Dragan, On Mon, May 6, 2024 at 1:52=E2=80=AFPM Dragan Simic wr= ote: > > Hello Alexey, > > Thanks for submitting the v4 of this series! Please, see a couple > of my comments below. > > On 2024-05-06 11:36, Alexey Charkov wrote: > > This includes the necessary device tree data to allow thermal > > monitoring on RK3588(s) using the on-chip TSADC device, along with > > trip points for automatic thermal management. > > > > Each of the CPU clusters (one for the little cores and two for > > the big cores) get a passive cooling trip point at 85C, which > > will trigger DVFS throttling of the respective cluster upon > > reaching a high temperature condition. > > > > All zones also have a critical trip point at 115C, which will > > trigger a reset. > > > > Signed-off-by: Alexey Charkov > > --- > > arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 147 > > ++++++++++++++++++++++++++++++ > > 1 file changed, 147 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi > > b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi > > index 6ac5ac8b48ab..ef06c1f742e8 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"; > > @@ -2368,6 +2369,152 @@ pwm15: pwm@febf0030 { > > status =3D "disabled"; > > }; > > > > + thermal_zones: thermal-zones { > > + /* sensor near the center of the SoC */ > > + 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 <100>; > > + polling-delay =3D <0>; > > + thermal-sensors =3D <&tsadc 1>; > > + > > + trips { > > + bigcore0_alert: bigcore0-alert { > > + temperature =3D <85000>; > > + hysteresis =3D <2000>; > > + type =3D "passive"; > > + }; > > Doesn't removing the second passive trip, which was present in the v3, > result in confusing the IPA governor? Not really - it will just treat the missing trip as 0C for its initial PID calculations [1], and will continually run the governor as opposed to putting it to rest when the temperature is below the "switch on" value [2]. Getting the power allocation governor to work optimally (i.e. to provide tangible benefits over, say, stepwise) is much more involved than defining an arbitrary switch-on trip point, as it requires an accurate estimate of sustainable power per thermal zone (which we don't have for RK3588 in general, and furthermore it must depend a lot on a particular cooling setup), and ideally some userspace power/thermal model capable of tuning the PID coefficients and updating them via sysfs based on how a particular system accumulates and dissipates heat under different load. So after thinking over it for a while I decided that those extra passive trips were rather self-deceiving, as they are only useful in the context of a power allocation governor but we do not have any of the other pieces in place for the power allocation governor to work. Better not to clutter the device tree IMO. Best regards, Alexey [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/d= rivers/thermal/gov_power_allocator.c#n156 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/d= rivers/thermal/gov_power_allocator.c#n487