From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 E6DD982866 for ; Sun, 25 Jan 2026 18:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769364262; cv=none; b=UX5nXb26012Mt7hMQLKkUmUAXDIwQzr+g5m2Op4oUCgwdv7/OrxhyCx3Evsn6290INYoe4gFodSPkGyC9PXAKAmfk5AMh0JCTPJPewJErYkBD8Kh8k58xevWMaip4B4lDW/5A0M4nJphwT7F9GewLXdC0PZF03pwqxGWq+9o2Ec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769364262; c=relaxed/simple; bh=agBRKuwWKtPnJIUdcu7sA87gTJa6Q8gGTGTdHOJl4TA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=j0hgnQSxz+Rz17wOzrF5z7R6c3nyOUuH2wx2JofIvU3JrPG1A0GAC/f+oY3eXMb+dZoBhK/sUpLSkzfUe3fFXCr5KfeAKqhbzgH3OkkN3Y7xaeARJiF6S3gBgyyVKSDtoIVk9CF36nNr8wqsn97d64qI+AcCOJXcTGEwg1P1CdU= 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=f/+LN4kg; arc=none smtp.client-ip=209.85.128.41 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f/+LN4kg" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4801d21c411so19888255e9.3 for ; Sun, 25 Jan 2026 10:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769364259; x=1769969059; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YPoViYNjyfGmUsvPf8KRXEGZpQr2hqfqFw85F8RnlH4=; b=f/+LN4kgeJkpcSAXOrRtKqUU1xEeq0CSyYI6PJottS4MvwIgFAidG38qa/+wyPIkLl MRFOucwGTi+j64H2Ds1ZMDOOw1YQBReP26kX2dove+3Xm/kmUHdjt3bAljZr+rBtsw0W NwxMIuo0FvvSTUTYltNwt2e4a9Tw8ZXaCjnVlOOJpEYWAU/bom63iJQlgXSBU9jkJAFJ PWI1iWrhThGghxciNIZqvH3D4t6u7O6PwbNjNOHHqwJb4El+Fi4Vj79NZ971f0PHvcLQ OnS/Vw+YiKK0NJCCdXoDxlLAqn3JLXTZ/aNFuOJ9ShFxGFKJukHLa8YoY+e8gEUnO5kM JJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769364259; x=1769969059; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YPoViYNjyfGmUsvPf8KRXEGZpQr2hqfqFw85F8RnlH4=; b=FsMvEzZ5So3+TeTNP74vMoaeUPaRwHrSR5spMkvS/4HeFTWpTbB45yBNXo6rJ8UXES wesoAuSRo3inhlBUlYQDqh2kPzoocN42Mg0lKiAffZGFBPIwD2wzdQHpMpratRekQMTE 4cEeIt6KqgSgScK7+1pwvnowoDDSVLR7ze571vfaYW433VL5qUZpf1CZJcMtLlyL13qP bDPLIyGE3AFT+GCwxKBHoRXu4jkrDmlpWUab+9aCI8f3h1JXxCeyFO9JcGltQEmBWI/r J5atS0Bq9dm81C4SE3irRsJwm/0BGe7GSLfJtfmFIg3YFn9nQ7IDKNI8dn4giZoVq1DU kytg== X-Forwarded-Encrypted: i=1; AJvYcCXFqCTAPZ4fG7fGmo+KKyLZpz7gZrpN1WVccR2y45BzDFegYkCZtx6Pz1U+ySgRkSYY91NJ9fxLAdfKQG4=@vger.kernel.org X-Gm-Message-State: AOJu0YxGUN8ZuRTWoLPVhQuvrX1Ytz11KRwmYvr8e+ZFBeNFBDeOjLXw gkkR80SejH1ZtAYXY4NcRjw+j/fvDLzjIaF5Mwy6tVnfNeenguun/sIq X-Gm-Gg: AZuq6aKQy07fPDx2M7G/NuKXnXRVVk8yjtpvpIVj8C8+6fdHHkEFpYdLfr/Pqy9Hmbn jCqlBUZjU5Gql5B/U1aRWGVWDdYeXnPXyft/1cH8RGcdhBAbLyDgBLMbRFADG+1XtFmbhPddtFv L53cbuqqsiMk9edXhRvHEA15iFIPwKP/HtVXDuzgMPk/4bceu4U1dl8DiyHZt12ujUlTQiFMe0O iDBGEkGng5qyJkw5AmfkJ0Eag9g8YmmKRMvrQwzQGKq/WabZVdempmqcbuEPd+c7OayTkhyEbZp 3jDFvx2DI+xXGCdAldsjiryepkoduaAifmT49++2G6Ecllv3eGO0O5TL9ZstcwzbPffUUgnD+oR KlFqwu6YoUNSea/zuaFSwpkJKTaYUT+dfQs8wtGAgXOJrMdoeUhmmX5oPe9q98h/6a3U4SLybI2 Euehk113u68FjnCbiBHDjBk2OqDd5IjoNRvTG+oKEX/YYtN1tz6TM/WoSLfuG0S4Sr7SIVbrT8Y g== X-Received: by 2002:a05:600c:c16e:b0:477:63b5:6f76 with SMTP id 5b1f17b1804b1-4806111e38emr4511635e9.25.1769364258971; Sun, 25 Jan 2026 10:04:18 -0800 (PST) Received: from ?IPV6:2a02:8010:6606:0:fd30:74ec:a5b0:107a? ([2a02:8010:6606:0:fd30:74ec:a5b0:107a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4804d6588e3sm84017525e9.3.2026.01.25.10.04.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jan 2026 10:04:18 -0800 (PST) Message-ID: <6235f7ee-d0fa-4c46-b98b-54af4d9d5ce8@gmail.com> Date: Sun, 25 Jan 2026 18:04:16 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] arm64: dts: rockchip: add pwm-fan for NanoPC-T6 To: Dragan Simic Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Alexey Charkov , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <20251109192128.72527-1-sigmaris@gmail.com> Content-Language: en-GB From: Hugh Cole-Baker In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello Dragan, I haven't been able to test patches for a while, but now I have access to the NanoPC board again, and I've done some tests: On 10/11/2025 00:23, Dragan Simic wrote: > Hello Hugh, > > Thanks for the v2! Please, see a couple of nitpicks below. > > On Sunday, November 09, 2025 20:20 CET, Hugh Cole-Baker wrote: >> FriendlyELEC offers an optional heatsink and fan addon for the NanoPC-T6 >> and T6 LTS, which plugs in to the fan connector on the board driven by >> pwm1. Add the fan as an active cooling device for the SoC package. >> >> Signed-off-by: Hugh Cole-Baker >> --- >> Changes from v1: https://lore.kernel.org/linux-rockchip/20251026194858.92461-1-sigmaris@gmail.com/ >> * add the fan to the base board dtsi instead of overlay (Heiko) >> * just use 2 trip points for warm and hot temperatures (Dragan, Alexey) >> >> References: >> FriendlyELEC heatsink with fan addon: >> https://www.friendlyelec.com/index.php?route=product/product&product_id=305 >> Vendor DT with trip points and PWM duty cycle values: >> https://github.com/friendlyarm/kernel-rockchip/blob/4944602540b62f5aad139fe602a76cf7c3176128/arch/arm64/boot/dts/rockchip/rk3588-nanopi6-rev01.dts#L75-L90 > > I think it would be better to move these references to the patch > description, so they become directly available in the repository. > It might be the best to use the "... [n]" form for the references, > which puts them as close to the backed contents as possible. > > Oh, and I think that "arm64: dts: rockchip: Enable active cooling > on NanoPC-T6" as the patch subject would read nicer. :) > >> .../boot/dts/rockchip/rk3588-nanopc-t6.dtsi | 39 +++++++++++++++++++ >> 1 file changed, 39 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi >> index fafeabe9adf9e..9164a0ee6228e 100644 >> --- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi >> +++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dtsi >> @@ -11,6 +11,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include "rk3588.dtsi" >> >> @@ -89,6 +90,14 @@ usr_led: led-1 { >> }; >> }; >> >> + fan: pwm-fan { >> + compatible = "pwm-fan"; >> + cooling-levels = <0 35 64 100 150 255>; >> + fan-supply = <&vcc5v0_sys>; >> + pwms = <&pwm1 0 50000 0>; >> + #cooling-cells = <2>; >> + }; >> + >> sound { >> compatible = "simple-audio-card"; >> pinctrl-names = "default"; >> @@ -591,6 +600,36 @@ &i2s6_8ch { >> status = "okay"; >> }; >> >> +&package_thermal { >> + polling-delay = <1000>; >> + >> + trips { >> + package_warm: package-warm { >> + temperature = <50000>; >> + hysteresis = <2000>; >> + type = "active"; >> + }; >> + >> + package_hot: package-hot { >> + temperature = <60000>; >> + hysteresis = <2000>; >> + type = "active"; >> + }; >> + }; > > It should be better to use 55 and 65 oC as the trip thresholds, > because people often report around 50 oC as the observed idle-state > temperature of their RK3588 SoCs, so increasing the first threshold Were these people using the heatsink accessory on the NanoPC-T6, or were they using some other board with worse heat dissipation? I recorded the package temperature on my NanoPC-T6 with the FriendlyELEC heatsink and fan and even though it's not idle but actually running Home Assistant, OpenLDAP, PostgreSQL, Prometheus, Grafana and Nginx, the temperature ranges between 46 and 48°C, and the fan never even spins up. Then I ran stress-ng and recorded the temperature under CPU load, with this version of the patch and another version with 55 & 65°C trip points. [1] I suspect if people are seeing 50°C at idle, they're either using a less effective heatsink, or in a very warm ambient temperature. When talking about the NanoPC-T6 fan specifically, we kinda have to assume the FriendlyELEC heatsink is used, as there's no mounting for the fan without the heatsink. > to 55 oC should be beneficial by preventing the fan from spinning > when the SoC is actually idle. The second threshold is usually set > to be 10 oC higher, so it should end up at 65 oC. I'll send a v3 with 55 and 65°C trip points, but I doubt it makes any difference to the fan activating while idle; from my testing it seems to just let the SoC get a bit hotter under heavy load. [1]: https://gist.github.com/sigmaris/2d5590271cf26da8ec6cfc7ef8e3e8bc >> + cooling-maps { >> + map0 { >> + trip = <&package_warm>; >> + cooling-device = <&fan THERMAL_NO_LIMIT 1>; >> + }; >> + >> + map1 { >> + trip = <&package_hot>; >> + cooling-device = <&fan 2 THERMAL_NO_LIMIT>; >> + }; >> + }; >> +}; >> + >> &pcie2x1l0 { >> reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>; >> vpcie3v3-supply = <&vcc_3v3_pcie20>; >