Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2687987ybv; Mon, 24 Feb 2020 09:40:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxcMlc4QkqT0/lyPbByrxiMnrT6sNEU6GPNwE1nAHsU7pJLQbTtBzvUXG+TXHtF0j94B56e X-Received: by 2002:a05:6808:10b:: with SMTP id b11mr181057oie.110.1582566036700; Mon, 24 Feb 2020 09:40:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582566036; cv=none; d=google.com; s=arc-20160816; b=Q4NtWW5DwKISkHNtCZ3dnnC6+zKOZFwqWeqkgeqXwxrRkCfu8b/pP/anMNUM0QHcGl PsgkIXJwvE0Wi/db7+Zf11o4i3i9kF9uk6+AIcBxzZY0EapaSiMSbnVKRRiUAeqbWwyV 18F6Lx5AP815ZcDkhzAdl64+ZcurStjl2+ESU7RdwefkrDIYkCYqta4SSlvKMh4eN0YM BbzHYtUM7Gd+gcQW8ka8mfWIswQcyIKuOfaZFKcZlON3Rfq3C2DjZMRdwbuZCujPN4Qm mE+DY2vQcTPsHbv8kX9IZCVy8Aspv1jZCY0aRaOQt+9O6Uk9neFbGMuIf5IgzsHkhCsb 54VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:to:from:date:dkim-signature; bh=vfKLK1ovlrB+EV2QJ5vM/7zY3hWgo6YapmSj9S6HSnU=; b=LNnCj7H2NcL//vVyCZikXCyrzI3GrWlD0PLeX87OopoRyXwoy8EjshJGILKiayM3sQ VoPbJaGnJsfkMJxGtWp7LO18pr/XRMFvyxCNAGtlInQfRTaBkYfQyM46RuTKdgCn+2sb erkYnjJAwr58CXZ782IVsVDptU0wdg/K7dycWCA95eJ4YyISOs/Ma2pQUSDXwCxPqFwm LnmJrmfXnRk7Z2+8ZQuN6bW6peHaevICCJ+yl48bynq3zpxqOaBFgBel8d9F+bV69rOD mRT8GMDfWdlyUcvK1+c1t1ES1v7KBDSKJJvrLKzq+YXOvloF+OYNEsZZh71A/VmDs3vI zSYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=FoSjuyUE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si6418485oto.205.2020.02.24.09.40.24; Mon, 24 Feb 2020 09:40:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=FoSjuyUE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728149AbgBXRjn (ORCPT + 99 others); Mon, 24 Feb 2020 12:39:43 -0500 Received: from vps.xff.cz ([195.181.215.36]:60558 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727108AbgBXRjn (ORCPT ); Mon, 24 Feb 2020 12:39:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1582565980; bh=bssBG1gkye/nYahI0KI7q69HyEXw05nP1PGKKo8PTDc=; h=Date:From:To:Subject:References:X-My-GPG-KeyId:From; b=FoSjuyUEQg2Zi08JDwJhfQKkeU+UWADJZHnAIBU7RY8JU1qByM7iZvFuW4x2nwBhW LQFABB99Nv08xlfT9LxVBgzfhtmJdwqdWhQL/3tmhYi4PipX5/Iz3/KcHZUkzBtI1T 2QNNcU+zW2sm3ErVaf8txlY3VNGztiHLu/jjvP6E= Date: Mon, 24 Feb 2020 18:39:40 +0100 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Daniel Lezcano , linux-sunxi@googlegroups.com, Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/Allwinner sunXi SoC support" , open list Subject: Re: [PATCH v2] ARM: dts: sun8i-a83t: Add thermal trip points/cooling maps Message-ID: <20200224173940.huwpaqhrc5ngbmji@core.my.home> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Daniel Lezcano , linux-sunxi@googlegroups.com, Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/Allwinner sunXi SoC support" , open list References: <20200224165417.334617-1-megous@megous.com> <2e4213a6-2aaf-641c-f741-9503f3ffd5fe@linaro.org> <20200224172328.yauwfgov664ayrd6@core.my.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200224172328.yauwfgov664ayrd6@core.my.home> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2020 at 06:23:28PM +0100, megous hlavni wrote: > Hi, > > On Mon, Feb 24, 2020 at 06:06:20PM +0100, Daniel Lezcano wrote: > > On 24/02/2020 17:54, Ondrej Jirman wrote: > > > This enables passive cooling by down-regulating CPU voltage > > > clocks = <&ccu CLK_C1CPUX>; > > > @@ -1188,12 +1188,60 @@ cpu0_thermal: cpu0-thermal { > > > polling-delay-passive = <0>; > > > polling-delay = <0>; > > > thermal-sensors = <&ths 0>; > > > + > > > + trips { > > > + cpu0_hot: cpu-hot { > > > + temperature = <80000>; > > > + hysteresis = <2000>; > > > + type = "passive"; > > > + }; > > > + > > > + cpu0_very_hot: cpu-very-hot { > > > + temperature = <100000>; > > > + hysteresis = <0>; > > > + type = "critical"; > > > + }; > > > + }; > > > + > > > + cooling-maps { > > > + cpu-hot-limit { > > > + trip = <&cpu0_hot>; > > > + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > > > + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > > > + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > > > + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > > > + }; > > > + }; > > > }; > > > > > > cpu1_thermal: cpu1-thermal { > > > polling-delay-passive = <0>; > > > > No polling to mitigate? > > Polling to mitigate what? > > The driver is using interrupts whenever new reading is available, and > notifies tz of the change. I don't have a reason to believe any new > values are available from thermal sensor outside of the interrupt > period. To be more clear, new temperatures are available from the thermal sensor driver at the rate of 4 per second, which should be enough to do quick adjustments to the thermal zone/cooling device even for quick temperature rises. https://elixir.bootlin.com/linux/v5.6-rc3/source/drivers/thermal/sun8i_thermal.c#L442 There's no slow/fast period depending on whether the cooling is active. It's always fast and no polling of the thermal sensor is needed. regards, o. > > > polling-delay = <0>; > > > thermal-sensors = <&ths 1>; > > > + > > > + trips { > > > + cpu1_hot: cpu-hot { > > > + temperature = <80000>; > > > + hysteresis = <2000>; > > > + type = "passive"; > > > > I'm curious, can you really reach this temperature with a cortex-a7 > > running at 1.2GHz max? > > That depends on ambient temperature. I'd say easily. My A83T is running > iniside enclosed space with no cooling other than dissipating heat to > the board. > > Anyway, I'm running my A83T boards at 1.8GHz. And A83T can run up to 2GHz > at the best SoC bin. > > I'll probably submit updated cpufreq table at some point too, once I fix > it up to use the SoC bin information. > > https://megous.com/git/linux/commit/?h=ths-5.6&id=171b7c3c3db98b5939d28d0c96b384edda95cec3 > > regards, > o. > > > > + }; > > > + > > > + cpu1_very_hot: cpu-very-hot { > > > + temperature = <100000>; > > > + hysteresis = <0>; > > > + type = "critical"; > > > + }; > > > + }; > > > + > > > + cooling-maps { > > > + cpu-hot-limit { > > > + trip = <&cpu1_hot>; > > > + cooling-device = <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > > > + <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > > > + <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, > > > + <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > > > + }; > > > + }; > > > }; > > > > > > gpu_thermal: gpu-thermal { > > > > > > > > > -- > > Linaro.org │ Open source software for ARM SoCs > > > > Follow Linaro: Facebook | > > Twitter | > > Blog > >