From patchwork Wed Oct 25 17:08:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 158192 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp102458vqb; Wed, 25 Oct 2023 10:09:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXaoJKNdnlOaqCO9jkBM6jVAIKX1s0wMRJvkh/SdI22RANS4NVXg9uuvHOqAx6IkOz6FvO X-Received: by 2002:a25:ac07:0:b0:d9c:7d48:300b with SMTP id w7-20020a25ac07000000b00d9c7d48300bmr9910662ybi.33.1698253785963; Wed, 25 Oct 2023 10:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698253785; cv=none; d=google.com; s=arc-20160816; b=TQoMtTB82qmSXBZtwuiefJz54u1QtxrBJFq6cjt27/a4NAANlUabSKsfy5d+nxTufN AVwHv7DRcKnWpakP18xANZ+CqbASqVah5S6yXQtt5+TEsA0gGW3JgzzZZjVu4ZjgpElB Yhu1wHaw5JTKpvQQsQKBN9jy14289jndZyjaXdUKhphQzv7db5fwXwj4FVjQz+/3CC2k C2eY34it3W9SRn4MMvXCCHh58pftRtkRk2rcaSLSSG7aIu5l7fC1/vxMwnUWJZvCwWB4 DKLtXjPLBPDHGbmWEr+RNJibDi2x0N7OZKKG3DpSIJOIkJM1FQlBagRA0jdAa9ixAWe9 u/OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9fN/MQV6dwt8BvtYNvMR12qWNERnV7Wj49zgD8ObeVA=; fh=SwIf/Xmhr5VbSRApyCAu05w8wdG0RyLeMNW6QMUCmh0=; b=cYYw2nJ+FZthj6wDNp0ZfivZQgNz4WfXcbCMuKFJD/BEbFo1YXgM5YSrTeqn8i+oLS Sd+9BggPu+Cj3Rkau20zJL82dwqecOIFeVfKzAEFiRAlI/ch7ZAyvlKPrsExqp86lSgT PeX/SlQcGtWErPUhBlf+mBywmYgQL12/t1wXbNtzyIksmydhB5xq91mgFHirdPpVnPXT +MiiDWiDojJAixUUC12rY/z7UTKKhWlwbmnAx0u/oZD/8FeFlRyLuOk8H533Sd8qT8Ex inVKWtfE+NzWFPoxEXmyyFfZda/oYUYDU+wVEHAuOHpJ7bznS9WxOkTgV6RkYtn6prU2 hOvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=VtFrx0zc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id i4-20020a256d04000000b00d9a42c75a5csi10823647ybc.653.2023.10.25.10.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 10:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=VtFrx0zc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9A6B881C0CA6; Wed, 25 Oct 2023 10:09:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234559AbjJYRJL (ORCPT + 26 others); Wed, 25 Oct 2023 13:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233880AbjJYRIv (ORCPT ); Wed, 25 Oct 2023 13:08:51 -0400 Received: from mxout4.routing.net (mxout4.routing.net [IPv6:2a03:2900:1:a::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E461184 for ; Wed, 25 Oct 2023 10:08:46 -0700 (PDT) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout4.routing.net (Postfix) with ESMTP id D58D61025C5; Wed, 25 Oct 2023 17:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1698253725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9fN/MQV6dwt8BvtYNvMR12qWNERnV7Wj49zgD8ObeVA=; b=VtFrx0zcDRKK20SYDAD7XyFziUjVNDiy8fI2lqOyiXFo2zn/v/Lb4HySL4Nm7AzyvioUHH Qp6MFraRa39+17LVkKPqEraI6BEs5NNdcq3KuxV73pdSZS0R3BqtJ7WWG9QlOUXmE6pZ4a LkWnawYUAcSUKkekMCnOaROufBtkM3Q= Received: from frank-G5.. (fttx-pool-217.61.159.50.bambit.de [217.61.159.50]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 2AB493608ED; Wed, 25 Oct 2023 17:08:44 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Golle , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Eric Woudstra Subject: [PATCH v2 3/5] arm64: dts: mt7986: change cooling trips Date: Wed, 25 Oct 2023 19:08:30 +0200 Message-Id: <20231025170832.78727-4-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231025170832.78727-1-linux@fw-web.de> References: <20231025170832.78727-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: eafcfba0-3d01-49d2-bf58-32026e9a4c7d X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 25 Oct 2023 10:09:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780748161783071226 X-GMAIL-MSGID: 1780748161783071226 From: Frank Wunderlich Add Critical and hot trips for emergency system shutdown and limiting system load. Change passive trip to active to make sure fan is activated on the lowest trip. Fixes: 1f5be05132f3 ("arm64: dts: mt7986: add thermal-zones") Fixes: c26f779a2295 ("arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts") Suggested-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno --- v2: - squash patch for bpi-r3 as suggested by angelo --- .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 10 +++++----- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 20 +++++++++++++++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts index f9702284607a..b876e501216b 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts @@ -152,16 +152,16 @@ cpu-active-high { trip = <&cpu_trip_active_high>; }; - cpu-active-low { + cpu-active-med { /* active: set fan to cooling level 1 */ cooling-device = <&fan 1 1>; - trip = <&cpu_trip_active_low>; + trip = <&cpu_trip_active_med>; }; - cpu-passive { - /* passive: set fan to cooling level 0 */ + cpu-active-low { + /* active: set fan to cooling level 0 */ cooling-device = <&fan 0 0>; - trip = <&cpu_trip_passive>; + trip = <&cpu_trip_active_low>; }; }; }; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index 77ddd9e44ed2..fc751e049953 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -614,22 +614,34 @@ cpu_thermal: cpu-thermal { thermal-sensors = <&thermal 0>; trips { + cpu_trip_crit: crit { + temperature = <125000>; + hysteresis = <2000>; + type = "critical"; + }; + + cpu_trip_hot: hot { + temperature = <120000>; + hysteresis = <2000>; + type = "hot"; + }; + cpu_trip_active_high: active-high { temperature = <115000>; hysteresis = <2000>; type = "active"; }; - cpu_trip_active_low: active-low { + cpu_trip_active_med: active-med { temperature = <85000>; hysteresis = <2000>; type = "active"; }; - cpu_trip_passive: passive { - temperature = <40000>; + cpu_trip_active_low: active-low { + temperature = <60000>; hysteresis = <2000>; - type = "passive"; + type = "active"; }; }; };