From patchwork Thu Jul 6 15:37:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 116768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2656023vqx; Thu, 6 Jul 2023 08:49:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGsz2yTXrWAmO6fx3fbAeCzS6S0eIiZEAJdeScXro+YKnQT5clZ3ZmVYljbtJ0A/csNejmb X-Received: by 2002:a17:902:db03:b0:1b8:904e:b265 with SMTP id m3-20020a170902db0300b001b8904eb265mr1750561plx.61.1688658574200; Thu, 06 Jul 2023 08:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688658574; cv=none; d=google.com; s=arc-20160816; b=awymqo4QIjX9Vq3O/1HmLaXmQw9q3Z+HvEvYP9M8z4HMDSGdSfPM4zfPfuMNQKLUb6 SPXTvRJarVK+KMqZ0eSnMO4xlFaO/qcsIZLyh9Q4x9Y7Oc0Kl0WsSxdNgrNvr+Ukoxfw 5vsb3HMwNd1qqvy9zqcC6l+mUw18dBHuDmvDKIqSy9rKmM93PT1b8SpMh+44oi52HpzF lUuABGktBh2ZyJuP5kPyJVishV8aN+JN6UgkHC0Sezg+xYC2BUoF14fELYNY8zrsHVR+ hyFF03Ms0kYss+gubB6QiuGDRG6Rq301gjmgSmvgsz0ZKKtnSPVIfjsn2GRMrtBahP7l 2t6w== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kv14-20020a17090328ce00b001b8867a7ce2si1467734plb.273.2023.07.06.08.49.20; Thu, 06 Jul 2023 08:49:34 -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 S233818AbjGFPjL (ORCPT + 99 others); Thu, 6 Jul 2023 11:39:11 -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?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Daniel Lezcano Cc: Alexandre Bailon , Balsam CHIHI , AngeloGioacchino Del Regno , Chen-Yu Tsai , Alexandre Mergnat , kernel@collabora.com, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770686853129825027?= X-GMAIL-MSGID: =?utf-8?q?1770686853129825027?= 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 Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat --- (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