From patchwork Tue May 3 09:33:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 9001331 X-Patchwork-Delegate: eduardo.valentin@ti.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 0DEE99F1D3 for ; Tue, 3 May 2016 09:35:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 223D420270 for ; Tue, 3 May 2016 09:35:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D82C20225 for ; Tue, 3 May 2016 09:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932626AbcECJey (ORCPT ); Tue, 3 May 2016 05:34:54 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35059 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932543AbcECJew (ORCPT ); Tue, 3 May 2016 05:34:52 -0400 Received: by mail-pf0-f194.google.com with SMTP id r187so1246022pfr.2; Tue, 03 May 2016 02:34:52 -0700 (PDT) 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=Y/Hsk9I3u9s2vQ2Tp7ilhBb5e0Mvb1Ssnw49q6fqFvM=; b=VlqkVTfD+EZSQBJY2y3s2TD8QJA/ElBysV5XJXsnmeE36qHR+x2c0beYPqqJ+0O27+ q5YyZTktDm0vOzO54Ptk0QuWTrhuY8vXPuzVCuqJi3Mw8OhhPCY971ZOND1rZnOxLdVI zhbcgzlJ8GUu3ObxivbfhJqL/yxZWYw4pYyChGoUe5kNsdFPFyZjZr069Fc2XXldd1y4 A8rjhfkbt+K3fJiv0cQcJw/qsxM3fzwrJ35/wjPLngTKjvNMn8mwnn7pdp/1HL3/633S e2OQu0VAkA/7hfbJD4ZlMsWGrS+hjCf2GZTr3QUVObvVL8Vge3akvsDcjGhLTHIDxlRW ThbA== X-Gm-Message-State: AOPr4FVWaBLZdC2bcpz7Z0eOB3/fmtSJnId5NZpR1zKLGQjJPz6G+173oQac4pzf0GHWvQ== X-Received: by 10.98.50.67 with SMTP id y64mr1954846pfy.128.1462268091814; Tue, 03 May 2016 02:34:51 -0700 (PDT) Received: from localhost.localdomain ([104.37.5.210]) by smtp.gmail.com with ESMTPSA id f16sm4201829pfj.71.2016.05.03.02.34.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 May 2016 02:34:50 -0700 (PDT) From: Caesar Wang To: edubezval@gmail.com Cc: Heiko Stuebner , dianders@chromium.org, briannorris@google.com, smbarber@google.com, linux-rockchip@lists.infradead.org, cf@rock-chips.com, huangtao@rock-chips.com, dmitry.torokhov@gmail.com, Sascha Hauer , Caesar Wang , Zhang Rui , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] thermal: bang-bang governor: act on lower trip boundary Date: Tue, 3 May 2016 17:33:32 +0800 Message-Id: <1462268013-14992-5-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462268013-14992-1-git-send-email-wxt@rock-chips.com> References: <1462268013-14992-1-git-send-email-wxt@rock-chips.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=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Sascha Hauer With interrupt driven thermal zones we pass the lower and upper temperature on which shall be acted, so in the governor we have to act on the exact lower temperature to be consistent. Otherwise an interrupt maybe generated on the exact lower temperature, but the bang bang governor does not react since The polling driven zones have to be one step cooler before the governor reacts. Signed-off-by: Sascha Hauer Signed-off-by: Caesar Wang Cc: Zhang Rui Cc: Eduardo Valentin Cc: linux-pm@vger.kernel.org Acked-by: Peter Feuerer --- Changes in v2: - Update the commit for patch[v2 4/5]. drivers/thermal/gov_bang_bang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c index 70836c5..9d1dfea 100644 --- a/drivers/thermal/gov_bang_bang.c +++ b/drivers/thermal/gov_bang_bang.c @@ -59,7 +59,7 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) if (instance->target == 0 && tz->temperature >= trip_temp) instance->target = 1; else if (instance->target == 1 && - tz->temperature < trip_temp - trip_hyst) + tz->temperature <= trip_temp - trip_hyst) instance->target = 0; dev_dbg(&instance->cdev->device, "target=%d\n",