From patchwork Wed Nov 21 22:26:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Herrmann X-Patchwork-Id: 1787171 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B6E8ADF24C for ; Thu, 22 Nov 2012 19:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965154Ab2KVTzn (ORCPT ); Thu, 22 Nov 2012 14:55:43 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:33888 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932281Ab2KVTzj (ORCPT ); Thu, 22 Nov 2012 14:55:39 -0500 Received: by mail-ea0-f174.google.com with SMTP id e13so3332366eaa.19 for ; Thu, 22 Nov 2012 11:55:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=uuPFfBtHe0fiTJjwvEvSdpZjkuvJL0qqqVS8F1ZkgNU=; b=gZGzxdAC5IcvJ/C0VbqTFwOjZY0g8vwZnJolyZ2FQM0o5Qjoq32rb4POgeXxOO45ow CrzHp+xWlbDPcVe6FZObOMLzMSRN+GyQ/Iw0NgOb1WRg4cEQ/VYK9HFB3XT5S/NgHudN cd4nTe0y31FiLbrWHuLUcSURWpyYQ7P8jnmFe7Hw2E3y0C4aXyRBDZeHMft0OPUd45KU q7MZ9gLN52JHFCNmgIyQFFhjLTqdSO3W7t/qVc7JPs1yL5kFx3RCkLjBIlQdkay51NPo fNwcdmV6L5nmzqRGfe4nMx3+GOKjoYJUiUuJuPKzU7CA4q/Epqcas/yXmq/APJGWWJyi 9mAg== Received: by 10.14.193.136 with SMTP id k8mr50174296een.30.1353536785056; Wed, 21 Nov 2012 14:26:25 -0800 (PST) Received: from tweety ([2.174.3.188]) by mx.google.com with ESMTPS id o49sm2999012eep.5.2012.11.21.14.26.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 14:26:24 -0800 (PST) Date: Wed, 21 Nov 2012 23:26:20 +0100 From: Andreas Herrmann To: Len Brown Cc: Suloev Dmitry , Thomas Renninger , Katabami Kohei , Matthew Garrett , linux-acpi@vger.kernel.org Subject: [PATCH] acpi: Read temperature before trip points for HP Compaq 6715b and 6715s Message-ID: <20121121222619.GA9078@tweety> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Katabami Kohei For HP Compaq 6715b and 6715s, temperature has to be read before trip points. This fixes bug #43284 which is introduced by: commit 9bcb8118965ab4631a65ee0726e6518f75cda6c5 Author: Matthew Garrett redhat.com> Date: Wed Feb 1 10:26:54 2012 -0500 ACPI: Evaluate thermal trip points before reading temperature The patch is originally written by Jason Vas Dias: http://thread.gmane.org/gmane.linux.kernel/1324409/focus=1324503 Katabami cleaned it up. Cc: stable@vger.kernel.org # >= 3.4 Reported-by: Suloev Dmitry Reviewed-by: Thomas Renninger Signed-off-by: Katabami Kohei Signed-off-by: Andreas Herrmann --- drivers/acpi/thermal.c | 56 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 8 deletions(-) Hi Len, I didn't find Katabami's patch in your git tree. Please apply this patch as soon as possible as in fact it's fixing a regression that was introduced with Matthew's change. The corresponding bug report is http://bugzilla.kernel.org/show_bug.cgi?id=43284 I've rebased the patch on v3.7-rc6-46-g45e7715 and also added a stable tag. Thanks, Andreas diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 804204d..5efb9de 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -96,6 +96,8 @@ static int psv; module_param(psv, int, 0644); MODULE_PARM_DESC(psv, "Disable or override all passive trip points."); +static int temp_before_trip; + static int acpi_thermal_add(struct acpi_device *device); static int acpi_thermal_remove(struct acpi_device *device, int type); static void acpi_thermal_notify(struct acpi_device *device, u32 event); @@ -992,15 +994,32 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz) if (!tz) return -EINVAL; - /* Get trip points [_CRT, _PSV, etc.] (required) */ - result = acpi_thermal_get_trip_points(tz); - if (result) - return result; + if (temp_before_trip) { + /* + * some hardwares need temperature before trip points + * can be obtained + */ - /* Get temperature [_TMP] (required) */ - result = acpi_thermal_get_temperature(tz); - if (result) - return result; + /* Get temperature [_TMP] (required) */ + result = acpi_thermal_get_temperature(tz); + if (result) + return result; + + /* Get trip points [_CRT, _PSV, etc.] (required) */ + result = acpi_thermal_get_trip_points(tz); + if (result) + return result; + } else { + /* Get trip points [_CRT, _PSV, etc.] (required) */ + result = acpi_thermal_get_trip_points(tz); + if (result) + return result; + + /* Get temperature [_TMP] (required) */ + result = acpi_thermal_get_temperature(tz); + if (result) + return result; + } /* Set the cooling mode [_SCP] to active cooling (default) */ result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); @@ -1164,6 +1183,15 @@ static int thermal_psv(const struct dmi_system_id *d) { return 0; } +static int thermal_temp_before_trip(const struct dmi_system_id *d) +{ + + printk(KERN_NOTICE "ACPI: %s detected: getting temperature before trip point initialisation\n", + d->ident); + temp_before_trip = 1; + return 0; +} + static struct dmi_system_id thermal_dmi_table[] __initdata = { /* * Award BIOS on this AOpen makes thermal control almost worthless. @@ -1201,6 +1229,18 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = { DMI_MATCH(DMI_BOARD_NAME, "7ZX"), }, }, + /* + * Some HP Compaq require temperature before trip points + * https://bugzilla.kernel.org/show_bug.cgi?id=43284 + */ + { + .callback = thermal_temp_before_trip, + .ident = "HP Compaq 6715b or 6715s", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715"), + }, + }, {} };