Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32059892rwd; Fri, 7 Jul 2023 08:09:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlHI+Y9dJFGnYG8J6r6a6n4M0IrAu55ysMClXGV2XNyxuybChgZxf5mA/e1hOJP86YhE9Kus X-Received: by 2002:a05:6870:ac24:b0:1a9:71c3:b7c2 with SMTP id kw36-20020a056870ac2400b001a971c3b7c2mr6768370oab.50.1688742562824; Fri, 07 Jul 2023 08:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688742562; cv=none; d=google.com; s=arc-20160816; b=FuHVzuZZybQ4H4RfGBv7LPZVX567oCD8x8T91rrcyVKZIVr+rgVkPLLNSWpD5CVCFO pQptHC/InmaSDa2CPl1XYuVRyj3NdzLObD8ZwKw+is0OchgRarZd75AT0+BRPH7NtWRT JaJRooIM8CIWRX0v5xdHb8B0J6ipESzqjKvTydJOZJ8G05s9qfl6ICOUFtdX9PI+y6KU qabkUQHwaEOt+DopPnWkRiu6kUFeObCDr6wLlqXuHEbchFgdp8x51oVFqJIic1lMITu1 bR1VpRcN5RwL6no7Ak5Nyb0bLRtr28RFQuA5TaCRbg26BNT5ESKjs5YCUw/yuxwmYMkh Kc6Q== 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=ycpGNLsgt/ES0G1zwIWkJIdAtFjomLDl2xkjlXWSTo4=; fh=AGdL4DTWv5YqGwrkp2MTO6Q0jUJQWzOlIOztiQwy2/I=; b=lFlm26oAFkvS0REWtWTzNssjH04mlRwGDlqjDEEJRQcjCELzWM2aZOieWC/4DO6S23 vxgS5XY2CymSKeT6tqM7DJ6+RjstS/7lEIbRfZoJZE+fuAXhG2qPap4WoDckj8euOgZJ 3sD7tmqGPfrTMYbfPW75jcZ7L6v0vMVQeJmSUjVMzWvRPqGSxMx4x6U84uJD5D/sL2hg /220mtRMENsKGQYyeWgjvvkqTLV8J7eX/siQkuFZqffUms7oj8LxPmq70Ao/mHjHZ3Q3 L34ffGw+lopLQz5oU0PmrdEBsGhgQCt2ES+fd4nsjbI0BPRv+BPr4F5ZO2caEcoDvkzX 4jpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=DVbjMVlx; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u21-20020a634555000000b005577fd7efa4si3812587pgk.427.2023.07.07.08.09.06; Fri, 07 Jul 2023 08:09:22 -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=@baylibre-com.20221208.gappssmtp.com header.s=20221208 header.b=DVbjMVlx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232614AbjGGOMK (ORCPT + 99 others); Fri, 7 Jul 2023 10:12:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232838AbjGGOMF (ORCPT ); Fri, 7 Jul 2023 10:12:05 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E5F82123 for ; Fri, 7 Jul 2023 07:12:01 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fbc0981755so21327205e9.1 for ; Fri, 07 Jul 2023 07:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1688739120; x=1691331120; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ycpGNLsgt/ES0G1zwIWkJIdAtFjomLDl2xkjlXWSTo4=; b=DVbjMVlxHE9pu3YlBytLFnpsxwPBMrs4rpCRfT0334ztrG4dfj5UIdU8xKhSyHlI9y dGLp86nBHpb1Wu+ID9UCtE6PciybqIGVT99TKQf3pGyXZk5VATe4xCQLgdm8jDwy0J4t aw4jAa8+T0nz9r55f4c6Evev2l5Gqc6l5K0eSgnO3ZeyyNdDyYHbDCh7SnwkUciF2r0L eXqCFb4R0FaCMGVkNY6mryVPdOytgJr4TglhKevcsFBxYZJJLojSXS2c8UtF6mjIpuh9 p22MJ0bzcWpPT1A5c6tcjU7D7C5B63Z/0/R/xV6iet0dSYSSVVFX1IOId8dTN6lYtbb3 thUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688739120; x=1691331120; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ycpGNLsgt/ES0G1zwIWkJIdAtFjomLDl2xkjlXWSTo4=; b=jW0PIZNNea5/hwsHIIxXHIJC/PjDcyDSmrtsUHwr4knxad+AxxQrCEOyYMHL85FCCT sGtKJ0920pyjwkTPje8c2Mz0cYJbc6j3HoJd8WNJI4YmLcIlwfoO9gqaZoQgYKiZ8MTD S7q32dGikD4g1vzHYxyPNGEzebGwDV/pjJe5bZdAg7Cn941uCAdJQhM/aIKqtL5ebS5S H5ohG7+Z/R1QJPjjraIjN1YRQdqEyqho8uKJiEGdocinxpeJvqN7RNS9awRp/7JI3Ojy Am+sdHFEUKCKGqCgzP/Hn2mWrV5GDR3zyihRBaUWQAsbzdbOFzz4i29Lg8yHKI8w89Zu 8HnA== X-Gm-Message-State: ABy/qLbXtoCXF3IyQxwl2KyU4f9mUJ1mdhQDdRv3Jy7ywYmUUss95V+m NnVW1EPmVYBYIhO0uKo7lJ5jAw== X-Received: by 2002:a1c:4b0a:0:b0:3fb:d1db:545b with SMTP id y10-20020a1c4b0a000000b003fbd1db545bmr4005976wma.20.1688739120033; Fri, 07 Jul 2023 07:12:00 -0700 (PDT) Received: from [192.168.1.172] ([93.5.22.158]) by smtp.gmail.com with ESMTPSA id l22-20020a7bc456000000b003fbb5142c4bsm2579548wmi.18.2023.07.07.07.11.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jul 2023 07:11:59 -0700 (PDT) Message-ID: <6fb74321-2f85-1a08-e16e-97346bd7e82a@baylibre.com> Date: Fri, 7 Jul 2023 16:11:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.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 , AngeloGioacchino Del Regno , Chen-Yu Tsai , 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: Alexandre Mergnat 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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 06/07/2023 17:37, NĂ­colas F. R. A. Prado wrote: > 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. Reviewed-by: Alexandre Mergnat -- Regards, Alexandre