Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31603556rwd; Fri, 7 Jul 2023 01:34:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlGlU95YXxe3tCmKfu8GLElJKVUdy25W+b/ADFYU4EFC1ND4T+h634i55ckN0wt+FAuRvP8t X-Received: by 2002:a17:90b:38cf:b0:262:d6e9:208b with SMTP id nn15-20020a17090b38cf00b00262d6e9208bmr3345817pjb.4.1688718885890; Fri, 07 Jul 2023 01:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688718885; cv=none; d=google.com; s=arc-20160816; b=OZhqTapdILPTelAXfgDuScTPwtOUp91Yi6D0FC2GVMlxg5D8uZ4PE9ji0UKcQ8mSnW 7QNhL8aOrliDLW1ONpF1m5v13Y6ckw9RhRgoh6XXXMRSY5EbGyLmwEqFFOXVjdwyfJNx FnzlxWxjzI11tGixYri5qSFQrQXy2bar7Wh+F9NHWdVTl19PTs4+xer7dGEF7UkYTznY Czr49IgWakVP+bxarBy0Z2CdT44JpFIvVkZK6rPyGkz/DYfK22Meab9LEbInaCqTn30l qzE9caH2ZCnglWt3uLs860iS8S6XGU9+lGR2Isr6n9D//KcQCbDQJg55YsxsLSWcImtJ O3oQ== 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=S7F017eNqHhU4s1TUlbkReV4KYen++Nr5RjRSomxY6w=; fh=xAWR+5k0pkt4/Cq6oULKgeysibGw2L9+kK/sYYXY2Co=; b=QWGDtlDxtBTU6I5Qp1clVKu8Vd3MAfaI3FMyb0F9BBMokyTY2L+btyVXM/LGcgWwTv RdUhf/mHlqFUdyVwVirD+rydBS1NsrSjLBzgPL1kzMIDEMLY83tYMgYLvjxgaBo8fX5g K8u0jNrkjfg5d+Q+kykjERgv7JGzewm5DauI1xNJ9VNZ83s5sd6374l17+8C2zPx+sfo 0cDXrYjQyyFSbMORvVwF3gSvPY5qritK8QWGh+WTPo/gnuokAq5h/zu37JubGTHiRAXf gW8T8Ha7WgB+gQEau5+srEzxihRJ+mONDkGezBMnM91gwmwoxpLJ6e+Yea4R6keL4U0h PvQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dTdK+JOh; 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 oa3-20020a17090b1bc300b00262cc4177ebsi1794359pjb.160.2023.07.07.01.34.34; Fri, 07 Jul 2023 01:34:45 -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=dTdK+JOh; 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 S232878AbjGGIWS (ORCPT + 99 others); Fri, 7 Jul 2023 04:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232940AbjGGIWO (ORCPT ); Fri, 7 Jul 2023 04:22:14 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 344EE210B; Fri, 7 Jul 2023 01:22:09 -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 4AB9C6606FCA; Fri, 7 Jul 2023 09:22:07 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688718128; bh=KlqmsemJjqgs8TN2Gg23NtEfSBp5PE0Ob4EPcUQRJuw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dTdK+JOhlS1RgWLnLTo3YBkJSNT581LvyIa23ZL6eicmvkcLaVeZ2g9u18dMNXOtW Tkg1Aq4nQlff4bBZ1dqbJGm9dWMsjhuQwVWbcWHECFBoh1cTZuPbwzJEvY78QPckSL 7eka9gMKpUNEg71Ki37FrhwC9A4KGP43lfwQmmpa0tuqv+po5EARjMa5kUpl4EFDgk k0MsmvVaVgxDATr5bRtjL2v37taVHc/z/Qkc00kmGPoqxe4mnx1WiKXKqOVjZGG1yv nFLJEiPw9v261ho8uS3+/h33OHfo7A+TllTaehD8q7Qw7HQrWOYWx/0uJIS5sM8nZ3 bKyqCZpet8aPQ== Message-ID: <7d7db84b-e6be-2d45-fbc6-e891718b757a@collabora.com> Date: Fri, 7 Jul 2023 10:22:04 +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 5/6] thermal/drivers/mediatek/lvts_thermal: Don't leave threshold zeroed 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-6-nfraprado@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230706153823.201943-6-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: > The thermal framework might leave the low threshold unset if there > aren't any lower trip points. This leaves the register zeroed, which > translates to a very high temperature for the low threshold. The > interrupt for this threshold is then immediately triggered, and the > state machine gets stuck, preventing any other temperature monitoring > interrupts to ever trigger. > > (The same happens by not setting the Cold or Hot to Normal thresholds > when using those) > > Set the unused threshold to a valid low value. This value was chosen so > that for any valid golden temperature read from the efuse, when the > value is converted to raw and back again to milliCelsius, the result > doesn't underflow. > > 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