Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30659283rwd; Thu, 6 Jul 2023 08:55:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/dMwx4PQ/Zh4V+ILszR6awMNoiHOH1cSvWJxu8jKNeI/wpNOLlRnlwTlPtluU2twkSTPw X-Received: by 2002:a05:6808:210d:b0:3a3:dda9:b90d with SMTP id r13-20020a056808210d00b003a3dda9b90dmr2405103oiw.45.1688658938947; Thu, 06 Jul 2023 08:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688658938; cv=none; d=google.com; s=arc-20160816; b=qTdAXUHX9N9XLc8dua15i6fGS16AiEWNFXH+Kz13l5ndkH3yv9H6V8l4Xke1XZphj9 6Zsi2rKp2Qw/z2URBaAsYn/HNOH75OweB5YcMWu9IyW4g28dS/GG/xfQAZKIrCs/p4CA jHKPaXjQZNqqTDDYaINl003SFj80VHi8hnmhpyL3I48xnemt4xih19tKim3Pg8PFV6iA 50bYSgzNdWSDCPUEKi/B+1FUWIq0G9c112WtcNT+2jeokZ4mf2sqG/9pqPanDfP/djCc 7ISqb4VLYMKkOfxmSWkIFi7x3rpDqrK+aDjKLzA8ehTvNU9ZUOJJ2CYLXxPNgZzmbjD8 RbWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7n6J9FnhQpGV+Db5R/CsM8VaQoCyxM0dcIqMik70fO8=; fh=4pMxnUSgEw1DnZMrJ0q1qssSvnBh1iy+HC6hGNd/a0o=; b=Lwxl+U4wo/Z8eg180P4hA2sstcjf+22xrnYzhC+a1vqPCh5jfI+o3dVcmtxOQqVOKS wUV/v9x8Lu2afmWpy2Ns8d5jNHuQz/lfIVlPY+dvKKgfES5VeAjAS1Z8ka+/aR/biOv0 OhYOxG1YyBXWGd62v24jstE9+R+pMcAO5yPhclWgeX10UUFx/MPI6ETMdEgUdZIDryiz cjQQMnUBYH2OiUp73Fmxsl6ki7TYzQVQKhIWLufF4EdXI8pryO9tpLzeeCVWufOG+/1e z8GnBRWcXHfLPcBfFwNu6Hs3bnD75B8M1xt1SARrDIimVDV9bnEkSZQ55OUpF5qiKILS KOOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ItS+zNto; 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 q62-20020a632a41000000b0055ba60a3303si1718400pgq.582.2023.07.06.08.55.23; Thu, 06 Jul 2023 08:55:38 -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=ItS+zNto; 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 S233812AbjGFPjK (ORCPT + 99 others); Thu, 6 Jul 2023 11:39:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbjGFPjE (ORCPT ); Thu, 6 Jul 2023 11:39:04 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9661FC8; Thu, 6 Jul 2023 08:38:51 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 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 BAF7C6606FDA; Thu, 6 Jul 2023 16:38:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688657930; bh=cmWDOMtnLjeBZz0rySziJQizEHpaOTQr14x0H4Tr8Vc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ItS+zNtoKSJJ3ss7q984TMNi7VVJlrctgRrn6FvY9ppk95zLHjDX7RbtcREmUXOUX OKEj2M5m8wJOy7sWy1D3lItSiHWCevocJzEf53uW4x3sUQ0b536gemzJY07QMNWavG G/nVZVD1N4uhT8e6C6Rcd7J7C2TEy8qAMlxFrSxuATSaAMkPGLY5x1p4E4/OgPZd+C YOz9goVGaMcbnlPp1FPN63Unx1sRGpk7jvGmMHDj1GEMIOzlBzUDo5WIb//3EUubdh 5d79Bqvnlb98+nCiTTJNTYqJmHvb7mF1da9jZaKTzI5aNAPWvPpR8jrHmhM4RY7OPi 2dd9jSd0FwWdQ== From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Daniel Lezcano Cc: Alexandre Bailon , Balsam CHIHI , AngeloGioacchino Del Regno , Chen-Yu Tsai , Alexandre Mergnat , kernel@collabora.com, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , 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 Subject: [PATCH v3 4/6] thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts Date: Thu, 6 Jul 2023 11:37:35 -0400 Message-ID: <20230706153823.201943-5-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230706153823.201943-1-nfraprado@collabora.com> References: <20230706153823.201943-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 Out of the many interrupts supported by the hardware, the only ones of interest to the driver currently are: * The temperature went over the high offset threshold, for any of the sensors * The temperature went below the low offset threshold, for any of the sensors * The temperature went over the stage3 threshold These are the only thresholds configured by the driver through the OFFSETH, OFFSETL, and PROTTC registers, respectively. The current interrupt mask in LVTS_MONINT_CONF, enables many more interrupts, including data ready on sensors for both filtered and immediate mode. These are not only not handled by the driver, but they are also triggered too often, causing unneeded overhead. Disable these unnecessary interrupts. The meaning of each bit can be seen in the comment describing LVTS_MONINTST in the IRQ handler. Fixes: f5f633b18234 ("thermal/drivers/mediatek: Add the Low Voltage Thermal Sensor driver") Signed-off-by: NĂ­colas F. R. A. Prado --- (no changes since v2) Changes in v2: - Reworded commit and changed flag to use offset interrupts instead drivers/thermal/mediatek/lvts_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index e7cbfe0426b5..e6dd4d120e54 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -65,7 +65,7 @@ #define LVTS_HW_FILTER 0x2 #define LVTS_TSSEL_CONF 0x13121110 #define LVTS_CALSCALE_CONF 0x300 -#define LVTS_MONINT_CONF 0x9FBF7BDE +#define LVTS_MONINT_CONF 0x8300318C #define LVTS_INT_SENSOR0 0x0009001F #define LVTS_INT_SENSOR1 0x001203E0 -- 2.41.0