From patchwork Thu Dec 17 19:13:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 7876361 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E254B9F32E for ; Thu, 17 Dec 2015 19:15:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A5C62042C for ; Thu, 17 Dec 2015 19:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 33B582015A for ; Thu, 17 Dec 2015 19:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755504AbbLQTNg (ORCPT ); Thu, 17 Dec 2015 14:13:36 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34881 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755502AbbLQTNe (ORCPT ); Thu, 17 Dec 2015 14:13:34 -0500 Received: by mail-pa0-f48.google.com with SMTP id jx14so18070128pad.2; Thu, 17 Dec 2015 11:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kKSK4poQyFrtXiuKK8smGHAOwFUAAELoroAKHj4yup4=; b=JUBX2fSt8Wpf7Yhca5bvmNtNGPdL5WQIJ1tVTcDoKjgOTsDFjoFVwsWoJckzIf4M06 Ep8rG7Oy0aYD6hWOYmr/NoptWcG98hdbg0BjZgpaXA0rIBDh8+x+betwDdPc6oCWMkNG lJb/4lR5DWuvvJyIShKyy6omsahX58P+rmyLyX4pWFdhgRA8BrOJodgZK0G1Y5gL1+pX TF5VU0YnvEHuK7jUj/6Egmf3eGiNsxMBYcA1nktIHAdHmuDJ+u5bhgmc14+xnR38Rmxk CZO57xMYqZABMlbK80zUWDyqxqiOtk0+ktAr29GOJqkWy7kD+ZKfs2gB6KW8wGnVyrU6 BXHw== X-Received: by 10.66.221.42 with SMTP id qb10mr74205593pac.51.1450379613866; Thu, 17 Dec 2015 11:13:33 -0800 (PST) Received: from localhost ([209.119.72.78]) by smtp.gmail.com with ESMTPSA id g10sm12994950pfj.15.2015.12.17.11.13.32 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 17 Dec 2015 11:13:33 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , Eduardo Valentin Subject: [PATCHv2 1/3] thermal: setup monitor only once after handling trips Date: Thu, 17 Dec 2015 11:13:27 -0800 Message-Id: <1450379609-7826-2-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1450379609-7826-1-git-send-email-edubezval@gmail.com> References: <1450379609-7826-1-git-send-email-edubezval@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Pandruvada, Srinivas Signed-off-by: Eduardo Valentin --- 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);