From patchwork Tue Nov 8 05:09:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9416505 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C330A60512 for ; Tue, 8 Nov 2016 05:12:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B33F928B99 for ; Tue, 8 Nov 2016 05:12:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A759128B9B; Tue, 8 Nov 2016 05:12:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C40C28B99 for ; Tue, 8 Nov 2016 05:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbcKHFM2 (ORCPT ); Tue, 8 Nov 2016 00:12:28 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33000 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932461AbcKHFK6 (ORCPT ); Tue, 8 Nov 2016 00:10:58 -0500 Received: by mail-pf0-f196.google.com with SMTP id 144so9693436pfv.0; Mon, 07 Nov 2016 21:10:58 -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=D9MIEbDQtakCmB/xTBi59NVRQw8ysaqeSTUBb4PahB4=; b=CgjYY8uOA0m4ZGtkywVQwgmIzOXTp4Qrzjv7Tq/FaaCy47vStKwAKt1VBXJNbV5mv/ sDtTF2P7sKX8xBXGCT4nM159iplzb0ruX88CJrQVYBCOgIBCQjAX1ZXgkogQQO/bZYVx lN4JGZFUD1oPHmsYYzYB9n4ESYiCQdISLHRf9gixGTFcgirK31zBN0X+vuvEda9eMZJE RETdNgdRkeSiKVgi8lrWdnjUlEuHjwJz8AmGTwYtXpIOp5hlPH1mHlF3w1q/ru8dOdnd yG2xzOZ0F+6RCr5ARfJDamHVOiCwwi80bv61CIth5AyJ98TiwVc0vjoQ3+51WJLZphrN y1Ng== 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=D9MIEbDQtakCmB/xTBi59NVRQw8ysaqeSTUBb4PahB4=; b=WdYALM5fWYWH6Sd3ARTm85sBMR98UOok+VNwxg/9TTTcxMLjusNbBtlylltjtJff6o nI/sGIcwNyjy5prglcRznXA7fTB481MNO9s+BF3RDy2D4+2D0/1J+Pc0VB9zhXMXZATs tPxxcpBEJYSBX8ZdXVbMQrnmZZ0nbCC7b/17oL1GUfmyHUmPp1zMaIxeA7dOqKafQ+gT F62KPFCHIijt6B4O0J2eTDpUZDMwm3fq1sQOAL0CKDxV1Hqa1tiHfXtAeHCezHPw7Jp1 foijhptRD2yKUc8DsPVAFA7AoctJuZUbGPu7LvomXS5AL3OnOs71xQu3Lubc1v1WdBh6 9eUg== X-Gm-Message-State: ABUngvfVG57dk7lfB89ko5j+beff+sJdAo+W0Hp9HTJXltlVKiy8oai543k3cW3ucj9nDw== X-Received: by 10.98.217.153 with SMTP id b25mr20256156pfl.77.1478581857971; Mon, 07 Nov 2016 21:10:57 -0800 (PST) Received: from localhost ([2601:647:4401:a2f0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id c128sm9894693pfc.39.2016.11.07.21.10.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 21:10:57 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: LKML , Linux PM , Eduardo Valentin Subject: [PATCHv2 37/49] thermal: core: add a comment describing the main update loop Date: Mon, 7 Nov 2016 21:09:15 -0800 Message-Id: <1478581767-7009-38-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1478581767-7009-1-git-send-email-edubezval@gmail.com> References: <1478581767-7009-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-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 884235f..bf108db 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) {