From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBC0CEB64D9 for ; Fri, 7 Jul 2023 08:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w/mcGyhROgMv3S/DPJIHJS7h8zOl7lVEH1O97EBJtKI=; b=J1jVKz8JsysHykw/xlYru7dDfa si3SbdvIh7ioztFPZeE/s+hQjmYqUTQOBjT/ivdyMJOqutIIhU2H9/U+ENwoBq3+ao4jW/jlyrWBS PmOs//3sBwHoFzC4rEC3DcQyKN+tMtaM3FWoujMj3lpRwc1nODsVW5Xq6ANuzEkMkgDhL7ldRrlrN XKMFBOQRXIV2sm4oEXxSHmw2tnrRD8ozag+rOlnuZPUU+ZAkplOzgKNcz2sjzjbp9iSywAnyfGU5e HZk8HZeyxT/ub+4K0CA2iEYlWnp08LXpigJ6reYH4/pUb4mZc49n/Rx8CKfwXBqbQzHABTpmg2I0d MEr5vPXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHgii-003yYw-0e; Fri, 07 Jul 2023 08:21:40 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHgie-003yWp-2X; Fri, 07 Jul 2023 08:21:38 +0000 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 560766606FCA; Fri, 7 Jul 2023 09:21:31 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688718092; bh=37R8WytlElX/g9LasuDma5fEgNGMk0IZTGnuoKn6N4Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=h2kDENk50rWu1SysrlTafzH1+VuYVHOvKAlvGaTaf4J3/TURNCv6Nh4/5oMsW/bwT 7D4klldr1l+6QRtXlAH3L3vpKMo0cs/crDBPwbGFAXsx2lHHOIBh8aQF36MRAHfy6N M6otPz7A06N/tprFPJtXvw3oa302/9B5GVLc/aMrrQ5rnAvHDXRWwsIf3QI0/bjSaX mvTi8wMX8tWu3iN86twZupPWrZBF4noD+d376cHaI5eTC9HYnMZzsDjYhKtaRiZ2yy O2MXc9ugiub0CmVw6AYy/X78kmgi7Ji28umZXg+A9VJ6RRofP9ibetQH4Zb9PelTbE wMsugYwL7E80Q== Message-ID: <0361bfac-95b4-3acc-583a-e8665800fe4d@collabora.com> Date: Fri, 7 Jul 2023 10:21:28 +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 3/6] thermal/drivers/mediatek/lvts_thermal: Use offset threshold for IRQ 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-4-nfraprado@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230706153823.201943-4-nfraprado@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_012136_958380_47D6A830 X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Il 06/07/23 17:37, NĂ­colas F. R. A. Prado ha scritto: > There are two kinds of temperature monitoring interrupts available: > * High Offset, Low Offset > * Hot, Hot to normal, Cold > > The code currently uses the hot/h2n/cold interrupts, however in a way > that doesn't work: the cold threshold is left uninitialized, which > prevents the other thresholds from ever triggering, and the h2n > interrupt is used as the lower threshold, which prevents the hot > interrupt from triggering again after the thresholds are updated by the > thermal framework, since a hot interrupt can only trigger again after > the hot to normal interrupt has been triggered. > > But better yet than addressing those issues, is to use the high/low > offset interrupts instead. This way only two thresholds need to be > managed, which have a simpler state machine, making them a better match > to the thermal framework's high and low thresholds. > > 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