Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9709405rwl; Wed, 11 Jan 2023 09:00:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtLGscbyGFMOJn/CCMCu+HAYF/Tbqwpuy10z7jLl4qcEtCy+c6KP9k4G07WWe3B65jhy94r X-Received: by 2002:aa7:9735:0:b0:582:34f1:574b with SMTP id k21-20020aa79735000000b0058234f1574bmr39243932pfg.12.1673456454443; Wed, 11 Jan 2023 09:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673456454; cv=none; d=google.com; s=arc-20160816; b=udw7jx7onHY3RK00m/lUNo9GFj3YI4ItLmTuJhVcl7cZ/8szbbAZUpZ1LQ+rDdjxsT Qo/NavKJvRzJSd0ZkYAgokSEDDFPe+esYaDCT229uk/L8aLfgJMO9EpkvwQz1m2qXr9/ ESKNgtMcf8RsiSfffQGI2AoMMdoS5aWUsD+KJbEJjsGj9MLda38TR2KdxdqiUPtIoh8V 1NqG6eIUSz9rHmD7tqZyrrwcCZFlZTOl2TLhmguh1YDZFEcBUVNdMKmUo5X4BP/cSOGl P8PdXmEbcrHB1ToXA/Wt8By/WT4sZLR0CrOVtzQScM+oRMTCat7zlPXXQ1NYfQGsEyQs PxjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=G11s3pNUjD7sKJ5SU4sl2Ji1el3redIWmK9hXl2o+LM=; b=JBA9jiylyC44AP/qtz9kzrZTKI2s68KbLKUf9K7fM1jjAwZdaINsfEnta9ywRfDGhO Fscs3jPLnSOHl6yDyeBD3SBntJCMoK5dtNjC/aNKQe8BWrfIYWBpbYOS/gkSyzFCbUqS ZADBb8u0Pv1FqrV9mirdBMm8QlbBgQAGQ+oFswowwepvpeCuQOl6yMJ/vXaWW7qD8pCA U8xiJeacrTR64f25czPO1y8i8O2ChjyL0FF3/3xFWxwZV0FK328/vmb0FI1sQ1kCkuUo dhqfSEBmaEV4flQSl94xfR8ERj6OC+81GPv/paiO/XK2IfEP9zqpveHhSfMF5myixUjQ pIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=srRV6h75; 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 d1-20020a056a00244100b005739d652a89si15120482pfj.223.2023.01.11.09.00.46; Wed, 11 Jan 2023 09:00:54 -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=srRV6h75; 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 S239078AbjAKQnA (ORCPT + 51 others); Wed, 11 Jan 2023 11:43:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234403AbjAKQmd (ORCPT ); Wed, 11 Jan 2023 11:42:33 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64FC1CE21 for ; Wed, 11 Jan 2023 08:41:46 -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 sin.source.kernel.org (Postfix) with ESMTPS id 79013CE1C03 for ; Wed, 11 Jan 2023 16:41:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8970DC433A0 for ; Wed, 11 Jan 2023 16:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673455302; bh=HAiGsZVdZ7bRLRhnBgYD+v8uX7S+LNMDjafB7ePSsPE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=srRV6h7579FD9/vtNnis7ZrO/GqsYNLwbmDaz24PDJNMbgv7klXK5jutPYQbMun9x tBedsxB0fRKJeMO7hY8AQ3SO1b2q+cBiisk6pMe1/sPCLKTuo+QNncc9KX/fishber +rzZlvNLXfbt65doUfW4pk1HT/ke7Uxreq4UdPet3DkhVoEEEPfB+wI1k6jj6RknOg JR5KN6Op46lVZRYRSS0rxHJwTZLq9d2vWDzQMottX/72pmUV38GoE3W3ncKbd15/E4 E247tYUiGwI3bP1a4HpfHkIx4MJqQyoGqJCspRsPfmDlBVgMU0khNACZMd5/wDjuq8 NvAbeyRXfFo8g== Received: by mail-vs1-f46.google.com with SMTP id a64so16302058vsc.2 for ; Wed, 11 Jan 2023 08:41:42 -0800 (PST) X-Gm-Message-State: AFqh2koTbPRSXAvmd3cRH7+hhY5x6sYu55V3mrnUnnZXN/BaTUrCaOxb JKAwpphIGWY3e1pbjtcXH2NnFKtHaQhFUvYETCdG8Q== X-Received: by 2002:a05:6102:374d:b0:3d0:af13:3b6 with SMTP id u13-20020a056102374d00b003d0af1303b6mr1504766vst.65.1673455301431; Wed, 11 Jan 2023 08:41:41 -0800 (PST) MIME-Version: 1.0 References: <20230110103420.2430518-1-daniel.lezcano@kernel.org> In-Reply-To: <20230110103420.2430518-1-daniel.lezcano@kernel.org> From: Amit Kucheria Date: Wed, 11 Jan 2023 22:11:30 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] thermal/drivers/qcom: Remove duplicate set next trip point interrupt code To: Daniel Lezcano Cc: rafael@kernel.org, dmitry.baryshkov@linaro.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, Thara Gopinath , Andy Gross , Zhang Rui , open list Content-Type: text/plain; charset="UTF-8" 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=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 Tue, Jan 10, 2023 at 4:04 PM 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. > > Signed-off-by: Daniel Lezcano > Signed-off-by: Daniel Lezcano Acked-by: Amit Kucheria > --- > 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 >