Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2628002rwr; Fri, 28 Apr 2023 13:12:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/Ee9WUuMDfTVWbHOHs2ONTzteU/yHi5+5mv/Oss3WK7sxpHjEIe8x+LdtB1kpWe7gpAyV X-Received: by 2002:a05:6a00:1914:b0:641:d9b:a444 with SMTP id y20-20020a056a00191400b006410d9ba444mr9741915pfi.31.1682712746393; Fri, 28 Apr 2023 13:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682712746; cv=none; d=google.com; s=arc-20160816; b=Z8qLkn4D9th011UfN0AXYBM35oUS7ulqTV+YRKFZ9irzWpzLyQe4ie3+43Hy9Zk62O /cVZGbkzKuEg2U5gFhYJ5IwMTpEEe5Amxc7MTLy3hYudLx2qNkoc1eTimKOzbS5vZ22J HQPoHwnYPFyjtdWAIz4yJRMD7N6m2YbbiWC4t8ioYS8cYK9rVRfCWL3kxHNuQY00HCx7 aae9kqeYbEWGx5626V0MIqGx04WIKLm/xU2YcyeXlkQg4LWarKMJn4HZzjxs/MxBJGJi dILdK6jzRnkxCspKk941/eccjP0fghhdbjk3ziIogM8vYLJJtQem6ApGmJvEYQrDQKlh Z6lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MgdzgDNJNalWOFj5w5YaMVuep8d52QqErlgDWabqkzo=; b=sinwRRk1svBAEWDiGtaUTOS7BQXPBb7DDOb2NSrIblKxT2HEaktuOGfBcGgPJUxWIG 12X171yEwez1kLO6Vkr+f/Mh/GVyakv6DOcKC5n+xxVnaAEAJkcm62m8J02Cb0ixm1Uo V2Y3UJ+UQCaNQo/Z2+SwhJ1b11Moho9sKDRR7/cbzwLvb5LbJdxBrxEL9DpFgiO279vC 2n65Yi8lkMprnGI0yfStSGdFphgDiKNWS8x2m3rRhYsHeOLUR+GOQXbMnDZiPlpste+F etkOKFgR5HjGF6ayIagWbfYC41eCWZzoYaESAeyps3/xLV/PttvK9kUAxXEKGzDb5exg dlGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mOYtKibk; 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 a3-20020a654183000000b0051a24ba4d9fsi22891233pgq.413.2023.04.28.13.12.11; Fri, 28 Apr 2023 13:12:26 -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=mOYtKibk; 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 S230207AbjD1UKw (ORCPT + 99 others); Fri, 28 Apr 2023 16:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbjD1UKu (ORCPT ); Fri, 28 Apr 2023 16:10:50 -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 E056926B1; Fri, 28 Apr 2023 13:10:49 -0700 (PDT) Received: from notapiano (unknown [194.36.25.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1E58866032CF; Fri, 28 Apr 2023 21:10:43 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1682712648; bh=b5em7hgy8DNSPO5+mn/VtcgYEzm4w56x9wJfr+VO8D4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mOYtKibkW1pr8UXj77mTOfkBfTEHE2oP6mK91rL1sLuM5uyyvweODtM13BjoCDbqq FFlgX6LUhK6MPAje3n1giNCCJZ6nK4Jzn282wQtxAY3Vs3fUeYfiB0HcI4kr75L+QD dtA550hoHvFG0YaRobuOVtopR1PCjQlRpnP/TYL21qS0vVL4cseX7YVT1gXlGIHQJY Cm5igPAjkdFstwIoKSWNP0DM2AqJnoDgW3xoW0u7vuXjWkqqJnBXPphbruh4q3VzOf EYiQtcnpkVuoWrFv54pwSmzpmg18h9OujEAIIqdPwFmu+14kVVWc/OuZiWOp4YltMr 20V+GcMJtpdWw== Date: Fri, 28 Apr 2023 16:10:38 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: bchihi@baylibre.com Cc: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, wenst@chromium.org, james.lo@mediatek.com, rex-bc.chen@mediatek.com, abailon@baylibre.com, amergnat@baylibre.com, khilman@baylibre.com Subject: Re: [PATCH v2 3/5] thermal/drivers/mediatek/lvts_thermal: Add mt8192 support Message-ID: <37680c5e-e61c-410b-b48d-829914200e4a@notapiano> References: <20230425133052.199767-1-bchihi@baylibre.com> <20230425133052.199767-4-bchihi@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230425133052.199767-4-bchihi@baylibre.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Tue, Apr 25, 2023 at 03:30:50PM +0200, bchihi@baylibre.com wrote: > From: Balsam CHIHI > > Add LVTS Driver support for MT8192. > > Signed-off-by: Balsam CHIHI > Co-developed-by : N?colas F. R. A. Prado > Signed-off-by: N?colas F. R. A. Prado > --- > drivers/thermal/mediatek/lvts_thermal.c | 92 +++++++++++++++++++++++++ > 1 file changed, 92 insertions(+) > > diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c > index 5ea8a9d569ea6..8df7b4c72a658 100644 > --- a/drivers/thermal/mediatek/lvts_thermal.c > +++ b/drivers/thermal/mediatek/lvts_thermal.c [..] > +static const struct lvts_ctrl_data mt8192_lvts_mcu_data_ctrl[] = { > + { > + .cal_offset = { 0x04, 0x08 }, > + .lvts_sensor = { > + { .dt_id = MT8192_MCU_BIG_CPU0 }, > + { .dt_id = MT8192_MCU_BIG_CPU1 } > + }, > + .num_lvts_sensor = 2, > + .offset = 0x0, > + .hw_tshut_temp = LVTS_HW_SHUTDOWN_MT8192, Hi Balsam, during the investigation I did to fix the interrupt issues I mentioned in v1, I noticed that the threshold interrupts (hot, hot to normal, cold), only trigger when the controller is configured to filtered mode. In immediate mode the threshold interrupts are not triggered. So I say we add .mode = LVTS_MSR_FILTERED_MODE, for all the controllers here. Same for MT8195, although I guess that'd be better done in a separate series. And I haven't had time to test more on MT8195 to see if I can get any interrupts there. One issue with filtered mode is that the data read is often not ready (valid bit unset), so most of the time it returns -EAGAIN. But I think that should be easy to address by reading with a timeout (equal to the measurement interval we already know), instead of a single time, if on filtered mode. I'll also try to review the other commits in this series, though that'll have to wait for next week. Thanks, N?colas