Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8217430rwl; Tue, 10 Jan 2023 10:25:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWJeZhEa4gUlKbqNVC+o+c7VXAUu/XUz/AMc1LblW5ZA82ntsiBF1XLG59MjFvomRiSAD3 X-Received: by 2002:a17:902:bd0a:b0:192:fe0a:11c8 with SMTP id p10-20020a170902bd0a00b00192fe0a11c8mr18873955pls.46.1673375100872; Tue, 10 Jan 2023 10:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673375100; cv=none; d=google.com; s=arc-20160816; b=OXWrT571qWaMOS/qHjV5aMlXqERSvAAOm0i5uvVaP91PDT2wttRyy9BtR3oDXawF0P IE42E5N+n+Qbdxc6ttQsPDlbFbBony3vpFy9LtG0380A3FeH2q8FYyXVPQ0XK5lj7Y9/ eCSweo50r45fSBBfp0B0jjtN1s7GkWMwGZ1wcnvbr47/0VKineJ8Ct7TZCZqQvNdKZAA 13HFf8IIqe9/bT+xEhTtM+1N5mJ7wekyvHHfJm38Ph13weHK81/BjSWTm3u5g7APmv+r Ku5hDciIDfjEKM7w7aYSbBU8k2fQqGTHtyViSBQLvZVylxHmp5i0pNht3cDKV8PO2upQ m3Hg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cG4PXkTojndtx29ZWzOpVPzt746a7jm0qsavdDGeMJk=; b=QdUERJLUEuLrpr0p8EqxgsHYFrjfZ8LCEGiBpxum9KSuvUXJEP5O41ytc4qOSXZYDM P8lo9dviH9XxXtdDPD2eThaAG+JMGtIPsKx71ytOBuX5wN2RSoMbvSpiNuyXIqZ60rsz DOfsZ1sJ46l6RYuI6qbXqB59d06NO8dhXaOv0+bj8C4dvhq1kkcbO7Lf7FEo5+b7E3V1 kqCeuTa7kg/9MXtTNOU/4k5r8eZA8hpVIBSGWOCHmpZueLVrr9BW3OKdpu73orZyxdgD AdcYXsaHq3s2y+2MzcwRlVusngxAUQpSrbonuWkxINPVvBF2HvUtroKCA0uUeQdje5nf 8d6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ds02guDf; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170902b49100b00192b23b8444si10763542plr.109.2023.01.10.10.24.53; Tue, 10 Jan 2023 10:25:00 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=ds02guDf; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239112AbjAJSQE (ORCPT + 53 others); Tue, 10 Jan 2023 13:16:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239085AbjAJSPk (ORCPT ); Tue, 10 Jan 2023 13:15:40 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC6E65E3; Tue, 10 Jan 2023 10:13:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9B92BB81904; Tue, 10 Jan 2023 18:13:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82F6EC433F2; Tue, 10 Jan 2023 18:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673374411; bh=0FExIvtCBuDgN4Q1DsAwXCC705QWCujVlzrI+6iicBw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ds02guDfC3kBWRPNotDONLCnVWWbw/azwOtWDTHxR6O34rPma3RbnYjtCp6gwDjsH +0SxyskEkYVNrxvsScRGKgb+mr6PMbd5BlW1snEW5Eaw4tsPsn1D7BVcPviEIom2Oi 9NFt6fSpllWOb7rdLtvc+GuiJ7wntTpCgc5PtyrJ5ZIJPBzW478rpsrqbDcSr/v3/7 bpsC2QoBRBHMabYTOPAwvJLGnYMtG+BvN5ZbGQp5nN5qPY8srbZzdt1oLsCPX1i2P5 LrhwkYetp8r40o8FCQ5dCaEW9Zke6aINQXH/Gt4jAIkQqdqq5JNMX+7x7Jf9Tgafoe w41kc/jHDUK9A== Date: Tue, 10 Jan 2023 12:13:28 -0600 From: Bjorn Andersson To: Daniel Lezcano Cc: rafael@kernel.org, dmitry.baryshkov@linaro.org, konrad.dybcio@linaro.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, Amit Kucheria , Thara Gopinath , Andy Gross , Zhang Rui , open list Subject: Re: [PATCH] thermal/drivers/qcom: Remove duplicate set next trip point interrupt code Message-ID: <20230110181328.el2kicyrg2j554c2@builder.lan> References: <20230110103420.2430518-1-daniel.lezcano@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230110103420.2430518-1-daniel.lezcano@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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, Jan 10, 2023 at 11:34:20AM +0100, Daniel Lezcano wrote: > From: Daniel Lezcano > > The tsens driver reprogram the next trip points in the irq > handler. This function then call thermal_zone_device_update(). > > However, thermal_zone_device_update() calls thermal_zone_set_trips() > and from there it calls the backend 'set_trips' ops. This one in turn > reprogram the next trip points (low/high). > > Consequently, the code setting the next trip points interrupt in the > interrupt handle is not needed and could be removed. > Reviewed-by: Bjorn Andersson > Signed-off-by: Daniel Lezcano > Signed-off-by: Daniel Lezcano The last one should be the address you sent your patch from, and that was the first one. So I think you should drop this one. Regards, Bjorn > --- > drivers/thermal/qcom/tsens.c | 46 +----------------------------------- > 1 file changed, 1 insertion(+), 45 deletions(-) > > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > index b5b136ff323f..58693ee8c430 100644 > --- a/drivers/thermal/qcom/tsens.c > +++ b/drivers/thermal/qcom/tsens.c > @@ -472,52 +472,8 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) > continue; > if (!tsens_threshold_violated(priv, hw_id, &d)) > continue; > - ret = get_temp_tsens_valid(s, &temp); > - if (ret) { > - dev_err(priv->dev, "[%u] %s: error reading sensor\n", > - hw_id, __func__); > - continue; > - } > > - spin_lock_irqsave(&priv->ul_lock, flags); > - > - tsens_read_irq_state(priv, hw_id, s, &d); > - > - if (d.up_viol && > - !masked_irq(hw_id, d.up_irq_mask, tsens_version(priv))) { > - tsens_set_interrupt(priv, hw_id, UPPER, disable); > - if (d.up_thresh > temp) { > - dev_dbg(priv->dev, "[%u] %s: re-arm upper\n", > - hw_id, __func__); > - tsens_set_interrupt(priv, hw_id, UPPER, enable); > - } else { > - trigger = true; > - /* Keep irq masked */ > - } > - } else if (d.low_viol && > - !masked_irq(hw_id, d.low_irq_mask, tsens_version(priv))) { > - tsens_set_interrupt(priv, hw_id, LOWER, disable); > - if (d.low_thresh < temp) { > - dev_dbg(priv->dev, "[%u] %s: re-arm low\n", > - hw_id, __func__); > - tsens_set_interrupt(priv, hw_id, LOWER, enable); > - } else { > - trigger = true; > - /* Keep irq masked */ > - } > - } > - > - spin_unlock_irqrestore(&priv->ul_lock, flags); > - > - if (trigger) { > - dev_dbg(priv->dev, "[%u] %s: TZ update trigger (%d mC)\n", > - hw_id, __func__, temp); > - thermal_zone_device_update(s->tzd, > - THERMAL_EVENT_UNSPECIFIED); > - } else { > - dev_dbg(priv->dev, "[%u] %s: no violation: %d\n", > - hw_id, __func__, temp); > - } > + thermal_zone_device_update(s->tzd, THERMAL_EVENT_UNSPECIFIED); > > if (tsens_version(priv) < VER_0_1) { > /* Constraint: There is only 1 interrupt control register for all > -- > 2.34.1 >