All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Rui Zhang <rui.zhang@intel.com>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Eduardo Valentin <edubezval@gmail.com>
Subject: [PATCHv2 1/3] thermal: setup monitor only once after handling trips
Date: Thu, 17 Dec 2015 11:13:27 -0800	[thread overview]
Message-ID: <1450379609-7826-2-git-send-email-edubezval@gmail.com> (raw)
In-Reply-To: <1450379609-7826-1-git-send-email-edubezval@gmail.com>

Instead of changing the monitoring setup every time after
handling each trip, this patch simplifies the monitoring
setup by moving the setup call to a place where all
trips have been treated already.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
V2: Added Srinivas reviewed by.
---
 drivers/thermal/thermal_core.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index d9e525c..8fa82c0 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
 		handle_critical_trips(tz, trip, type);
 	else
 		handle_non_critical_trips(tz, trip, type);
-	/*
-	 * Alright, we handled this trip successfully.
-	 * So, start monitoring again.
-	 */
-	monitor_thermal_zone(tz);
 }
 
 /**
@@ -547,6 +542,12 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
 
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
+
+	/*
+	 * Alright, we handled these trips successfully.
+	 * So, start monitoring again.
+	 */
+	monitor_thermal_zone(tz);
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 
-- 
2.5.0


  reply	other threads:[~2015-12-17 19:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 19:13 [PATCHv2 0/3] thermal: rework core to improve userspace interaction Eduardo Valentin
2015-12-17 19:13 ` Eduardo Valentin [this message]
2015-12-17 19:13 ` [PATCHv2 2/3] thermal: rework core to allow emul_temp to be treated as regular temp Eduardo Valentin
2016-03-16  0:09   ` Pandruvada, Srinivas
2015-12-17 19:13 ` [PATCHv2 3/3] thermal: improve hot trip handling Eduardo Valentin
2016-01-05  9:46   ` Geert Uytterhoeven
2016-01-05  9:46     ` Geert Uytterhoeven
2016-02-03 23:24     ` Srikar Srimath Tirumala
2016-03-16  0:14   ` Pandruvada, Srinivas
  -- strict thread matches above, loose matches on Subject: below --
2015-12-16  3:49 [PATCH 0/3] thermal: rework core to improve userspace interaction Eduardo Valentin
2015-12-16  3:49 ` [PATCHv2 1/3] thermal: setup monitor only once after handling trips Eduardo Valentin
2015-12-16 23:46   ` Pandruvada, Srinivas
2015-12-16 23:46     ` Pandruvada, Srinivas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450379609-7826-2-git-send-email-edubezval@gmail.com \
    --to=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.