From patchwork Fri Jun 23 21:09:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willy WOLFF X-Patchwork-Id: 9807333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F9E960349 for ; Fri, 23 Jun 2017 21:09:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDBC1285DC for ; Fri, 23 Jun 2017 21:09:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1ED128600; Fri, 23 Jun 2017 21:09:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B6F0285DC for ; Fri, 23 Jun 2017 21:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TZpk3glNphHzJ6hMR0cLNqrq98oMm57VNBL+fl2sC60=; b=jXzYxaXHvbePDE 9Io3wiLQw5FhllTJ/h1nUzEQ5CD3Bam90aNYaNOL8qCWMpjVV1si84QYzT4z/KtjtcWQpvhF+5sMj PE8sDGSHRFivKJMrJUXmpTeCSatiLpk0iHLwj7SQjofu2sV0efiXN2/jurTRBw36trNdXBfngM3WD OVQTUXbZ4/UYRVQolxvHMs9OEBMbkEFcpxEcoMmtObV88PCYQ9kyQPCauljMg54RxRfi0D5WU5Rk5 p8DQ2MiFiHAIJMAUV4De4n6IXpMSoaFPdJmoKpcXolQLwhYu7Cp5RoPfZSZrmUVx2TaLdQKFLHUyZ eqD7PszY8dORg/XiWurQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dOVpl-0003Rf-Ic; Fri, 23 Jun 2017 21:09:41 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dOVph-0003Pq-LM for linux-arm-kernel@lists.infradead.org; Fri, 23 Jun 2017 21:09:39 +0000 Received: by mail-wr0-x242.google.com with SMTP id 77so15300327wrb.3 for ; Fri, 23 Jun 2017 14:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=5XEWyVa5vy7bPxemeNEGsCIo3MGsOyxJpfIk0rZ+hE0=; b=CXamUuEkoN+txWcm1bLWKMlKlKAgpoFGiJU1dgclizgpTvrpk4qSH++JEXncB2Lo0K XI8fnXW1wmdi3y+OOhHS6PUSqAcZJhMM+FD3iRfBnQYfsNr3/Ad+f40s6S+CUvT8qvba pygZgxlKD8lBw1H8sHKNqsRUXoNeHFRlNiwSfNUCF/IeIULvK/UidGxFuOJwcIlOjmA0 I1J0gRHxOX/jNMTSJ5uHO3rV1z32d2MZ1z5l34t00L4gger7ZKF9DC6N61cwUEKWiHGC mjmlAz7nWMWs/Y4oCvBRcrh2zG/N1t497w5FIhxepkXvBi/RDZ3LoPw0JoOlMF2Q+x1O mAdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=5XEWyVa5vy7bPxemeNEGsCIo3MGsOyxJpfIk0rZ+hE0=; b=ogCSJkpXKN+Im8DjzQWoR9K9docI43RhgPRAoyQmiz08AQIskt4B4G8lPWhBwKBXe2 OLC5CDxanc5PtDYZJ5g7Bwk3Q8ZjQ572C6WjqMNZNtsRaFgoqsrzUagyevMBBt+LUIaf j2qv0EH2hd79HC9z5N97XRnwn4slEAWsu5qRqed2GBrGJchgGftm0J7/w3e+BWO27GIy Rh0xAZcJ0448qEKQvNNpV4sKVfenQz/XIbPGsCPnZ1lAk436REKg8cHIHj13rm4b44mG 1wa7y/8uY5Vi1gm7/MCAXV0WEn2YCH8JJ+RQwtfcjBkMjB+Zgl1VrJ9KuP3wIpU0wiW2 2U4A== X-Gm-Message-State: AKS2vOzEyRiKiXEqCb5a2qps88KGKITexNNb6+JJW+KMcPvwdJy1Vrzt 7pF8sRDslflAwg== X-Received: by 10.28.26.2 with SMTP id a2mr6716266wma.32.1498252155590; Fri, 23 Jun 2017 14:09:15 -0700 (PDT) Received: from inc028000032.lancs.ac.uk (inc028000032.lancs.ac.uk. [148.88.228.92]) by smtp.gmail.com with ESMTPSA id u4sm3405248wmf.7.2017.06.23.14.09.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Jun 2017 14:09:14 -0700 (PDT) Date: Fri, 23 Jun 2017 22:09:14 +0100 From: Willy Wolff To: Rob Herring , Mark Rutland , Russell King , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: dts: exynos: Exynos5422 Odroid-XU* incomplete thermal-zones definition Message-ID: <20170623210913.ugutgop7ratwolfy@inc028000032.lancs.ac.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170623_140938_032988_7D883888 X-CRM114-Status: GOOD ( 20.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Odroid XU*-familly boards has thermal sensors per A15 cores, but the actual thermal-zones define only cooling-maps action for cpu0. If the application is running on all cores but core4 (first core of the A15 cluster), the CPU can reach high temperature without any proper cooling action. As already discus in prior mail, and on IRC, it's a quit big code duplication, but I don't found the write way to express that in a better way. The situation for this board is that we have multiple sensors, but matching cooling devices for these sensors act for the same physical device (FAN and A15 cluster, as each core of the cluster share the same frequency). In fact, of-thermal.c:473:thermal_zone_of_sensor_register() can't use multiple sensors for one single thermal zone. This patch follow the path taken in arch/arm/boot/dts/qcom-apq8084.dtsi:97 I'm interested to extending the thermal driver, but it will takes time. So this is a workaround before refactoring the driver. If somebody knows how to write it better, any advice and suggestions are more than welcome. Also, the comment for cpu_alert4 in cooling-maps definition is not accurate, 11 steps for A15 correspond to 700MHz, not 600MHz. Signed-off-by: Willy Wolff --- arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 249 +++++++++++++++++++-- 1 file changed, 231 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi index 05b9afdd6757..0759cc0812fb 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi @@ -64,22 +64,22 @@ polling-delay-passive = <250>; polling-delay = <0>; trips { - cpu_alert0: cpu-alert-0 { + cpu0_alert0: cpu-alert-0 { temperature = <50000>; /* millicelsius */ hysteresis = <5000>; /* millicelsius */ type = "active"; }; - cpu_alert1: cpu-alert-1 { + cpu0_alert1: cpu-alert-1 { temperature = <60000>; /* millicelsius */ hysteresis = <5000>; /* millicelsius */ type = "active"; }; - cpu_alert2: cpu-alert-2 { + cpu0_alert2: cpu-alert-2 { temperature = <70000>; /* millicelsius */ hysteresis = <5000>; /* millicelsius */ type = "active"; }; - cpu_crit0: cpu-crit-0 { + cpu0_crit0: cpu-crit-0 { temperature = <120000>; /* millicelsius */ hysteresis = <0>; /* millicelsius */ type = "critical"; @@ -88,14 +88,14 @@ * Exynos542x supports only 4 trip-points * so for these polling mode is required. * Start polling at temperature level of last - * interrupt-driven trip: cpu_alert2 + * interrupt-driven trip: cpu0_alert2 */ - cpu_alert3: cpu-alert-3 { + cpu0_alert3: cpu-alert-3 { temperature = <70000>; /* millicelsius */ hysteresis = <10000>; /* millicelsius */ type = "passive"; }; - cpu_alert4: cpu-alert-4 { + cpu0_alert4: cpu-alert-4 { temperature = <85000>; /* millicelsius */ hysteresis = <10000>; /* millicelsius */ type = "passive"; @@ -104,43 +104,256 @@ }; cooling-maps { map0 { - trip = <&cpu_alert0>; + trip = <&cpu0_alert0>; cooling-device = <&fan0 0 1>; }; map1 { - trip = <&cpu_alert1>; + trip = <&cpu0_alert1>; cooling-device = <&fan0 1 2>; }; map2 { - trip = <&cpu_alert2>; + trip = <&cpu0_alert2>; cooling-device = <&fan0 2 3>; }; /* - * When reaching cpu_alert3, reduce CPU + * When reaching cpu0_alert3, reduce CPU * by 2 steps. On Exynos5422/5800 that would * be: 1600 MHz and 1100 MHz. */ map3 { - trip = <&cpu_alert3>; + trip = <&cpu0_alert3>; cooling-device = <&cpu0 0 2>; }; map4 { - trip = <&cpu_alert3>; + trip = <&cpu0_alert3>; cooling-device = <&cpu4 0 2>; }; /* - * When reaching cpu_alert4, reduce CPU - * further, down to 600 MHz (11 steps for big, + * When reaching cpu0_alert4, reduce CPU + * further, down to 600 MHz (12 steps for big, * 7 steps for LITTLE). */ map5 { - trip = <&cpu_alert4>; + trip = <&cpu0_alert4>; cooling-device = <&cpu0 3 7>; }; map6 { - trip = <&cpu_alert4>; - cooling-device = <&cpu4 3 11>; + trip = <&cpu0_alert4>; + cooling-device = <&cpu4 3 12>; + }; + }; + }; + cpu1_thermal: cpu1-thermal { + thermal-sensors = <&tmu_cpu1 0>; + polling-delay-passive = <250>; + polling-delay = <0>; + trips { + cpu1_alert0: cpu-alert-0 { + temperature = <50000>; + hysteresis = <5000>; + type = "active"; + }; + cpu1_alert1: cpu-alert-1 { + temperature = <60000>; + hysteresis = <5000>; + type = "active"; + }; + cpu1_alert2: cpu-alert-2 { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + cpu1_crit0: cpu-crit-0 { + temperature = <120000>; + hysteresis = <0>; + type = "critical"; + }; + + cpu1_alert3: cpu-alert-3 { + temperature = <70000>; + hysteresis = <10000>; /* millicelsius */ + type = "passive"; + }; + cpu1_alert4: cpu-alert-4 { + temperature = <85000>; + hysteresis = <10000>; + type = "passive"; + }; + + }; + cooling-maps { + map0 { + trip = <&cpu1_alert0>; + cooling-device = <&fan0 0 1>; + }; + map1 { + trip = <&cpu1_alert1>; + cooling-device = <&fan0 1 2>; + }; + map2 { + trip = <&cpu1_alert2>; + cooling-device = <&fan0 2 3>; + }; + + map3 { + trip = <&cpu1_alert3>; + cooling-device = <&cpu0 0 2>; + }; + map4 { + trip = <&cpu1_alert3>; + cooling-device = <&cpu4 0 2>; + }; + + map5 { + trip = <&cpu1_alert4>; + cooling-device = <&cpu0 3 7>; + }; + map6 { + trip = <&cpu1_alert4>; + cooling-device = <&cpu4 3 12>; + }; + }; + }; + cpu2_thermal: cpu2-thermal { + thermal-sensors = <&tmu_cpu2 0>; + polling-delay-passive = <250>; + polling-delay = <0>; + trips { + cpu2_alert0: cpu-alert-0 { + temperature = <50000>; + hysteresis = <5000>; + type = "active"; + }; + cpu2_alert1: cpu-alert-1 { + temperature = <60000>; + hysteresis = <5000>; + type = "active"; + }; + cpu2_alert2: cpu-alert-2 { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + cpu2_crit0: cpu-crit-0 { + temperature = <120000>; + hysteresis = <0>; + type = "critical"; + }; + + cpu2_alert3: cpu-alert-3 { + temperature = <70000>; + hysteresis = <10000>; + type = "passive"; + }; + cpu2_alert4: cpu-alert-4 { + temperature = <85000>; + hysteresis = <10000>; + type = "passive"; + }; + + }; + cooling-maps { + map0 { + trip = <&cpu2_alert0>; + cooling-device = <&fan0 0 1>; + }; + map1 { + trip = <&cpu2_alert1>; + cooling-device = <&fan0 1 2>; + }; + map2 { + trip = <&cpu2_alert2>; + cooling-device = <&fan0 2 3>; + }; + + map3 { + trip = <&cpu2_alert3>; + cooling-device = <&cpu0 0 2>; + }; + map4 { + trip = <&cpu2_alert3>; + cooling-device = <&cpu4 0 2>; + }; + + map5 { + trip = <&cpu2_alert4>; + cooling-device = <&cpu0 3 7>; + }; + map6 { + trip = <&cpu2_alert4>; + cooling-device = <&cpu4 3 12>; + }; + }; + }; + cpu3_thermal: cpu3-thermal { + thermal-sensors = <&tmu_cpu3 0>; + polling-delay-passive = <250>; + polling-delay = <0>; + trips { + cpu3_alert0: cpu-alert-0 { + temperature = <50000>; + hysteresis = <5000>; + type = "active"; + }; + cpu3_alert1: cpu-alert-1 { + temperature = <60000>; + hysteresis = <5000>; + type = "active"; + }; + cpu3_alert2: cpu-alert-2 { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + cpu3_crit0: cpu-crit-0 { + temperature = <120000>; + hysteresis = <0>; + type = "critical"; + }; + + cpu3_alert3: cpu-alert-3 { + temperature = <70000>; + hysteresis = <10000>; + type = "passive"; + }; + cpu3_alert4: cpu-alert-4 { + temperature = <85000>; + hysteresis = <10000>; + type = "passive"; + }; + + }; + cooling-maps { + map0 { + trip = <&cpu3_alert0>; + cooling-device = <&fan0 0 1>; + }; + map1 { + trip = <&cpu3_alert1>; + cooling-device = <&fan0 1 2>; + }; + map2 { + trip = <&cpu3_alert2>; + cooling-device = <&fan0 2 3>; + }; + + map3 { + trip = <&cpu3_alert3>; + cooling-device = <&cpu0 0 2>; + }; + map4 { + trip = <&cpu3_alert3>; + cooling-device = <&cpu4 0 2>; + }; + + map5 { + trip = <&cpu3_alert4>; + cooling-device = <&cpu0 3 7>; + }; + map6 { + trip = <&cpu3_alert4>; + cooling-device = <&cpu4 3 12>; }; }; };