Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31599087rwd; Fri, 7 Jul 2023 01:30:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGhI0noZcrG0KjpIpVmPbs/DQmxeBIBmzH5LZWaVTCCJATBgiwl/4hPAfVPzn85G8YZPjdz X-Received: by 2002:a05:6808:244:b0:3a3:2fad:695e with SMTP id m4-20020a056808024400b003a32fad695emr4394119oie.46.1688718613790; Fri, 07 Jul 2023 01:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688718613; cv=none; d=google.com; s=arc-20160816; b=q0JzQxP7ySAzHEc3JiZH1ziR4s6DhsnZTDP3KlguhEm5R/SrS3v0rDQXuVqcNJUcpR Fbsk5Fh+rBMXavoUjomFY7425VUpgCBRDljwwGk/mFVW1VqcFJZdr0h8/XNp/cY0xllH kcNKdNH8i8a92EDTLLlVbFM6DPGeWTb08gaFfHWBNrM4FgFDLvxKDI4YVa/8/tZ4GYvo Jdc1HSvPZQzV2tSaVJxdybRF8zyz4Dz0c7S4WJEZ8NiXISYchvNsBJnDcWmBhwX1nbwE jOfesokNLemckLf6ANPNVWBw5GexgRLgfc3jM7OaV1gKiOcDY5RFRJS/GMSPI06+qsPo 9Ehw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=l1HYXE+coLOdcuJ+am2P0PeP2xqJSbH4Iexmg+LIOnk=; fh=xAWR+5k0pkt4/Cq6oULKgeysibGw2L9+kK/sYYXY2Co=; b=ykzIoXJSfi+MKuIHLDMHFX2oYpZ/oUw3XBxKmcfmzcJbNZUWpp7rUcW9jU92Ar5Lxl L5gWiziA1tyA5sl7THNLkjOAUYm5Dceb6XB8MfAdgxweY9rer3KH/HOU8iqbNVq0bZsM 1VJNgAaO3iON3QqyYXtorRQZ+JTCn6jhHkZu27EKP31XHEQI+tY3V5F5YoUfiC3hRQV3 Y2TzmvSpSoNZn+wTDp72DwBKApnLLejtESKsN4N8w3a5Pj55RzbXjPLYIUOoLwWI1prJ jHICV6c1VMJoTrdBJH8neTeRrnbJEAVlPpnh+brHo5tcwIOtuq9DNih0O8e21totc5Gg t/4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DvqZkfgq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj14-20020a17090b088e00b00261326aa56esi1589324pjb.5.2023.07.07.01.30.01; Fri, 07 Jul 2023 01:30:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DvqZkfgq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232004AbjGGIXH (ORCPT + 99 others); Fri, 7 Jul 2023 04:23:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232995AbjGGIW4 (ORCPT ); Fri, 7 Jul 2023 04:22:56 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 614AC2109; Fri, 7 Jul 2023 01:22:44 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 6E8056606FCA; Fri, 7 Jul 2023 09:22:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688718163; bh=C7CMkxmZPAlHvOPFwq2S9P/9xy5K1sw18FMOfrzXvRs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DvqZkfgqgUMrr+u89G0Qog44SqNJzD2utg2faRY9pl8nXtOZORJywbcWcb01Mh9Mb 9s4d0sCaaD+ZUnS0VafaPJjmCMK14DnM25sDcVuswmSA9GSQhfIIRC52kc4AYW1/9K +TWstsAk3LrBkXhw1mm5WVGQEthuqx/ZHFZ3qVNAycSNV+iFXF99USK+blOhEVVg8M assnECXSq4tIvwZK2XgsrpY7U+u/fVTi0O9wyllf1pPmbWRNctpZ1UB2NaCqby0+zl Ps7wpuPWcV8QI8mB4aocMhj9X6CQY2QrWPlOWsE0XBwWiW0IkoCSjaFOll4k0bPgV0 w/v1Op4BHVtOA== Message-ID: <16c4d5a9-4eeb-6a92-e97e-6e15eaeb913a@collabora.com> Date: Fri, 7 Jul 2023 10:22:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 6/6] thermal/drivers/mediatek/lvts_thermal: Manage threshold between sensors Content-Language: en-US To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Daniel Lezcano Cc: Alexandre Bailon , Balsam CHIHI , Chen-Yu Tsai , Alexandre Mergnat , kernel@collabora.com, Amit Kucheria , Matthias Brugger , "Rafael J. Wysocki" , Zhang Rui , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org References: <20230706153823.201943-1-nfraprado@collabora.com> <20230706153823.201943-7-nfraprado@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230706153823.201943-7-nfraprado@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 06/07/23 17:37, NĂ­colas F. R. A. Prado ha scritto: > Each LVTS thermal controller can have up to four sensors, each capable > of triggering its own interrupt when its measured temperature crosses > the configured threshold. The threshold for each sensor is handled > separately by the thermal framework, since each one is registered with > its own thermal zone and trips. However, the temperature thresholds are > configured on the controller, and therefore are shared between all > sensors on that controller. > > When the temperature measured by the sensors is different enough to > cause the thermal framework to configure different thresholds for each > one, interrupts start triggering on sensors outside the last threshold > configured. > > To address the issue, track the thresholds required by each sensor and > only actually set the highest one in the hardware, and disable > interrupts for all sensors outside the current configured range. > > Fixes: f5f633b18234 ("thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driver") > Signed-off-by: NĂ­colas F. R. A. Prado > Reviewed-by: AngeloGioacchino Del Regno