Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1926719rwb; Fri, 5 Aug 2022 10:02:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR6E0ErRZbVTRu3VIqRhRmRV7Typ8y0RRSa3mIKOz311jVBRIiRAJwMHmV4y6Y8suP+DQq4A X-Received: by 2002:a17:902:ac97:b0:16e:eb08:fb15 with SMTP id h23-20020a170902ac9700b0016eeb08fb15mr7732518plr.7.1659718924769; Fri, 05 Aug 2022 10:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659718924; cv=none; d=google.com; s=arc-20160816; b=AONu5bWLPTtetJOAdnecnQNpKDMZ+kEolnF4RVQ9xcmprK5aruihto+cFk73Gig7hs zTp1hgjpheo8pO9KLYq+sl7CgRzB2hgBD7MsRndIifx+pDxE33zPoP4S/pvsT3q3VDTX Je8BDlhdOfAq7llpzrvkGshtcz/i8a7XSFImsY5uC77Ll5FHw1gq1sm4VachrqsVuxto /GvNlynXf36lWyTZSqKq2ceZYBiSpm7jOpvNZkGNNfU86eTANmWCpxnI8G/V07ZMqMDW 5l1Y+9zGZZAZ79UMuZqTcEOiOv2bHbk7KZ+4qMkLkftx6g4vg3vrru417sNdBX01tbHc y8oQ== 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; bh=JpK4cKjWfUdf5fiTOgPLG1JC3Xe7mGK2psxBpm/kgz0=; b=gpGXOxtpNtTC5d0hDSNYOcfo9zESCc1f6+KElX8xzRru3uCEHP3eKCxNduQcSMfHjI 7Zk3LrSUAJE26Fk/W4WfmLn8HHC1nCAxG+SKvEuc0H5o/k7iqlYCRVGs4Kh/LAiImjbu I3i+5gjBRmcSgRnSYGCc1KUaVyG+8Wa/Xw43wJN5h14ShkrZR/HyAOA933BKR8acqHdf AfUunQBLMDX+OwULyPuEdfQKWnr7ZEBCylw7oRaZTxSmLQKlGR0ZDfUtl266VQlqZdW+ P73mG7HNffXp6xJYMY/+qCKV9cwiE0U1MldEIzYHAHW320dkf8Is5Nb8pnJsM3rG9964 UMuQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g7-20020a63be47000000b00412a9c29e5bsi3799448pgo.702.2022.08.05.10.01.50; Fri, 05 Aug 2022 10:02:04 -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; 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 S241364AbiHEQ3c (ORCPT + 99 others); Fri, 5 Aug 2022 12:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241349AbiHEQ3X (ORCPT ); Fri, 5 Aug 2022 12:29:23 -0400 Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14D651EAC1; Fri, 5 Aug 2022 09:29:22 -0700 (PDT) Received: by mail-yb1-f178.google.com with SMTP id j63so4509738ybb.13; Fri, 05 Aug 2022 09:29:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=JpK4cKjWfUdf5fiTOgPLG1JC3Xe7mGK2psxBpm/kgz0=; b=5WmvgU3LEnUUlhoZvFAANJwRfEBY0n0UwBf2M7r7VbcsC//hRMH0CahIzWYYQpe7Y4 UvNAXCjug+d09y5p4dngiLK0+QAV/TaV57+LQc9bsTpOaJx5Qza+zsri7ODpKGVujXIO bIZsNR1ZIPoCwpp5V48xoUvDzXQn9jnFemS6ofNEGcrd7/LbnS0QsNgnD44cVSJezucc lTzFnagbCXpKyEM56vM+XKlhO71vJNrK7NShs2hmW27BxLOk1nEpU6M+nCpnMWdCpHtQ gTtnsi5qH7K4CixJWsT0BFOlrWrOOer17BtX/EJkOrSCt7iRvFQu98fPhLUhWG52KfS+ vTJw== X-Gm-Message-State: ACgBeo0oDEqwOK+M4vgyeEK8YJn+eVK4JB0rrOPID19i5sZAZMd40V9D diGI6JW3faDuUWg+91xcJMmtVIZdb6GVnno98e4= X-Received: by 2002:a25:cc51:0:b0:676:ccba:875 with SMTP id l78-20020a25cc51000000b00676ccba0875mr6093715ybf.137.1659716960892; Fri, 05 Aug 2022 09:29:20 -0700 (PDT) MIME-Version: 1.0 References: <20220805153834.2510142-1-daniel.lezcano@linaro.org> In-Reply-To: <20220805153834.2510142-1-daniel.lezcano@linaro.org> From: "Rafael J. Wysocki" Date: Fri, 5 Aug 2022 18:29:09 +0200 Message-ID: Subject: Re: [PATCH 1/5] thermal/core: Rearm the monitoring only one time To: Daniel Lezcano Cc: "Rafael J. Wysocki" , "Zhang, Rui" , Linux PM , Linux Kernel Mailing List , Amit Kucheria Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Aug 5, 2022 at 5:38 PM Daniel Lezcano wrote: > > The current code calls monitor_thermal_zone() inside the > handle_thermal_trip() function. But this one is called in a loop for > each trip point which means the monitoring is rearmed several times > for nothing (assuming there could be several passive and active trip > points). > > Move the monitor_thermal_zone() function out of the > handle_thermal_trip() function and after the thermal trip loop, so the > timer will be disabled or rearmed one time. > > Signed-off-by: Daniel Lezcano Does this series depend on any other? You've been sending quite a lot of material lately and it is not always easy to tell what the dependencies between the different patch series are. > --- > drivers/thermal/thermal_core.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c > index b4c68410c158..4e1a83987b99 100644 > --- a/drivers/thermal/thermal_core.c > +++ b/drivers/thermal/thermal_core.c > @@ -383,11 +383,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) > handle_critical_trips(tz, trip, trip_temp, type); > else > handle_non_critical_trips(tz, trip); > - /* > - * Alright, we handled this trip successfully. > - * So, start monitoring again. > - */ > - monitor_thermal_zone(tz); > } > > static void update_temperature(struct thermal_zone_device *tz) > @@ -503,6 +498,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz, > > for (count = 0; count < tz->num_trips; count++) > handle_thermal_trip(tz, count); > + > + monitor_thermal_zone(tz); > } > EXPORT_SYMBOL_GPL(thermal_zone_device_update); > > -- > 2.25.1 >