From patchwork Wed May 4 06:02:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9010251 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 2703F9F1C1 for ; Wed, 4 May 2016 06:04:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48AB6202B8 for ; Wed, 4 May 2016 06:04:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 688692026F for ; Wed, 4 May 2016 06:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757374AbcEDGEQ (ORCPT ); Wed, 4 May 2016 02:04:16 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:32808 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757352AbcEDGDj (ORCPT ); Wed, 4 May 2016 02:03:39 -0400 Received: by mail-pf0-f180.google.com with SMTP id 206so21192171pfu.0; Tue, 03 May 2016 23:03:38 -0700 (PDT) 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=F2qv+JZ7GIM4OIy2Z87APtCRsH7VX6nufpaeLA4MNp4=; b=VfpG+UVanmUUBg8FjTJ5CscnBmNJdcDGQa3RgcVVD464lomFvbT56pxhLJWMdgvMIp FpWDX2Blr/YXe6bt5mVesykeypHfdL/j+CbhRq50J6I1lzaOhqe4g1brOisqSc6UCWX9 U+4FVSRKD6TgBUnMkQf2+eV+wHxQfed+QzR4a/SpXxClIiuwk4ZbrVchhyW/DavG31L1 /we9tAFWkoV+euxNoRZxjyPuBE/aYmXWEXL10K6TtkOLxE2lDliEvFGFnKgH5gWBCPah OzQs+LwAxFFbQsLZNN/Uvkon9SxVKVY6Phkwg8mJLUukaxMsyZbSYjNW88ufHEfFaR6E h07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=F2qv+JZ7GIM4OIy2Z87APtCRsH7VX6nufpaeLA4MNp4=; b=WRjUXETHtEhtHyU0ySDoCWoMiRXh9ODyidN2Cf71N+3evHxpioMEnGME1FKHbmmUcD EqpJq+ykV0jI0phcHL7R3tV+EKcfIa9BJh5wOMenBoE6xCa4Z5zXQTTjk/RSCIlDiY5y wFJEzjrYI13kx1Vw0oTVYkJHMDaLhTFZBr6/ycHgNOTEbB6dQWN/44AoneJwnrr/9t8w xJWn/f2M6y97vtce69rowL43gSKcYTZoU2IsLQeZFs2pajVVxabIaEnBob9Jh5vf1OiR syuzyfOhk+HwOPLsQzKAh9kmLFOG92HFyD8NTlY/sEnZ2O73K+yVbXlIoSOteGW0lXCc gRGA== X-Gm-Message-State: AOPr4FUqLPwN463zaweWmURmDtshYu75x0hfhF25b0yg0Cc9xUFfHduqpEOpcHM5GM4fFQ== X-Received: by 10.98.7.153 with SMTP id 25mr9749275pfh.38.1462341818258; Tue, 03 May 2016 23:03:38 -0700 (PDT) Received: from localhost ([2601:647:4203:c8e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id s197sm2631499pfs.62.2016.05.03.23.03.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 23:03:37 -0700 (PDT) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , Eduardo Valentin Subject: [PATCH 29/31] thermal: core: add a comment describing the main update loop Date: Tue, 3 May 2016 23:02:43 -0700 Message-Id: <1462341765-13268-30-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462341765-13268-1-git-send-email-edubezval@gmail.com> References: <1462341765-13268-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=-8.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Simply marking the main update loop section and adding a comment describing it. Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin --- drivers/thermal/thermal_core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 0317aea..d552183 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -286,6 +286,17 @@ static void thermal_unregister_governors(void) thermal_gov_power_allocator_unregister(); } +/* + * Zone update section: main control loop applied to each zone while monitoring + * + * in polling mode. The monitoring is done using a workqueue. + * Same update may be done on a zone by calling thermal_zone_device_update(). + * + * An update means: + * - Non-critical trips will invoke the governor responsible for that zone; + * - Hot trips will produce a notification to userspace; + * - Critical trip point will cause a system shutdown. + */ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, int delay) {