From patchwork Wed May 6 17:34:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zajac X-Patchwork-Id: 22096 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n46HYSrE020496 for ; Wed, 6 May 2009 17:34:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbZEFRe0 (ORCPT ); Wed, 6 May 2009 13:34:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753306AbZEFRe0 (ORCPT ); Wed, 6 May 2009 13:34:26 -0400 Received: from fg-out-1718.google.com ([72.14.220.153]:42415 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753112AbZEFReZ (ORCPT ); Wed, 6 May 2009 13:34:25 -0400 Received: by fg-out-1718.google.com with SMTP id 16so95135fgg.17 for ; Wed, 06 May 2009 10:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject :content-disposition:from:cc:date:mime-version:content-type :content-transfer-encoding:message-id; bh=Y19FNb85DOjyl/rmupEJae94vnX/hF2LVMoLN3l7kAo=; b=Re/V22AhmSFX2ceReea+VfgcUr66R49PuqBRZcUFIzBqSxnIBYjBRM3QkiTSoKXTx+ zfLFLOoONf2Jn8rYHsLePyfmfihnEoa8jpXWZNgf6AfRPbD3cThzt1wQXrLBz0IVrihQ b+xmDqZqOg7DcDOdt1fHlKAeiASqS58OqOiaA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:content-disposition:from:cc:date:mime-version :content-type:content-transfer-encoding:message-id; b=N3U/apQK1vXj72xufgHLOa+FVic5LBWFSqdiO1GwVDNqjnlks0GAdOODpCeP9mehUm sXhrtAYSah/EWJq4bdTLJ03XDXEmW7frYO5KbbXqybIvo0z+W1NUIHuGhbRTWQyHw+p3 ahlPlgd2MA3SKuFLkOKTJD9B8Xoi+jLn595n8= Received: by 10.86.98.10 with SMTP id v10mr1528960fgb.76.1241631263005; Wed, 06 May 2009 10:34:23 -0700 (PDT) Received: from ?192.168.11.144? (host-77-247-224-23.isper.sk [77.247.224.23]) by mx.google.com with ESMTPS id 4sm15479285fgg.3.2009.05.06.10.34.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 10:34:22 -0700 (PDT) To: rui.zhang@intel.com Subject: [PATCH 2.6.30-rc4] thermal: fix off-by-1 error in trip point trigger condition Content-Disposition: inline From: Vladimir Zajac Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 6 May 2009 19:34:21 +0200 MIME-Version: 1.0 Message-Id: <200905061934.21821.eightgraph@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This patch fixes a regression caused by commit b1569e99c795bf83b4ddf41c4f1c42761ab7f75e "ACPI: move thermal trip handling to generic thermal layer" which accidentally changed trip point trigger condition to temp > trip_temp This patch changes the trigger condition back to temp >= trip_temp Signed-off-by: Vladimir Zajac Acked-by: Zhang Rui Acked-by: Matthew Garrett --- thermal_sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux-2.6.30-rc4/drivers/thermal/thermal_sys.c 2009-04-30 23:52:59.000000000 +0200 +++ linux-2.6.30-rc4-p1/drivers/thermal/thermal_sys.c 2009-05-04 19:58:30.000000000 +0200 @@ -961,7 +961,7 @@ void thermal_zone_device_update(struct t switch (trip_type) { case THERMAL_TRIP_CRITICAL: - if (temp > trip_temp) { + if (temp >= trip_temp) { if (tz->ops->notify) ret = tz->ops->notify(tz, count, trip_type); @@ -974,7 +974,7 @@ void thermal_zone_device_update(struct t } break; case THERMAL_TRIP_HOT: - if (temp > trip_temp) + if (temp >= trip_temp) if (tz->ops->notify) tz->ops->notify(tz, count, trip_type); break; @@ -986,14 +986,14 @@ void thermal_zone_device_update(struct t cdev = instance->cdev; - if (temp > trip_temp) + if (temp >= trip_temp) cdev->ops->set_cur_state(cdev, 1); else cdev->ops->set_cur_state(cdev, 0); } break; case THERMAL_TRIP_PASSIVE: - if (temp > trip_temp || tz->passive) + if (temp >= trip_temp || tz->passive) thermal_zone_device_passive(tz, temp, trip_temp, count); break;