public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* ACPI patches for 2.6.25-rc6
@ 2008-03-18  6:02 Len Brown
  2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi

Here is the current queue for 2.6.25-rc6

thanks,
-Len



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5
  2008-03-18  6:02 ACPI patches for 2.6.25-rc6 Len Brown
@ 2008-03-18  6:02 ` Len Brown
  2008-03-18  6:02   ` [PATCH 2/6] ACPI: battery: Don't return -EFAIL on broken packages Len Brown
                     ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi; +Cc: Venki Pallipadi, Len Brown

From: Venki Pallipadi <venkatesh.pallipadi@intel.com>

This avoids the harmless WARNING by lockdep in acpi_processor_idle().

The reason for WARNING is because at the depth of idle handling code,
some of the idle handlers disable interrupts, some times, while returning from
the idle handler. After return, acpi_processor_idle and few other routines
in the file did an unconditional local_irq_enable(). With LOCKDEP, enabling
irq when it is already enabled generates the below WARNING.

> > [    0.593038] ------------[ cut here ]------------
> > [    0.593267] WARNING: at kernel/lockdep.c:2035 trace_hardirqs_on+0xa0/0x115()
> > [    0.593596] Modules linked in:
> > [    0.593756] Pid: 0, comm: swapper Not tainted 2.6.25-rc5 #8
> > [    0.594017]
> > [    0.594017] Call Trace:
> > [    0.594216]  [<ffffffff80231663>] warn_on_slowpath+0x58/0x6b
> > [    0.594495]  [<ffffffff80495966>] ? _spin_unlock_irqrestore+0x38/0x47
> > [    0.594809]  [<ffffffff80329a86>] ? acpi_os_release_lock+0x9/0xb
> > [    0.595103]  [<ffffffff80337840>] ? acpi_set_register+0x161/0x173
> > [    0.595401]  [<ffffffff8034c8d4>] ? acpi_processor_idle+0x1de/0x546
> > [    0.595706]  [<ffffffff8020a23b>] ? default_idle+0x0/0x73
> > [    0.595970]  [<ffffffff8024fc0e>] trace_hardirqs_on+0xa0/0x115
> > [    0.596049]  [<ffffffff8034c6f6>] ? acpi_processor_idle+0x0/0x546
> > [    0.596346]  [<ffffffff8034c8d4>] acpi_processor_idle+0x1de/0x546
> > [    0.596642]  [<ffffffff8020a23b>] ? default_idle+0x0/0x73
> > [    0.596912]  [<ffffffff8034c6f6>] ? acpi_processor_idle+0x0/0x546
> > [    0.597209]  [<ffffffff8020a23b>] ? default_idle+0x0/0x73
> > [    0.597472]  [<ffffffff8020a355>] cpu_idle+0xa7/0xd1
> > [    0.597717]  [<ffffffff80485fa1>] rest_init+0x55/0x57
> > [    0.597957]  [<ffffffff8062fb49>] start_kernel+0x29d/0x2a8
> > [    0.598215]  [<ffffffff8062f1da>] _sinittext+0x1da/0x1e1
> > [    0.598464]
> > [    0.598546] ---[ end trace 778e504de7e3b1e3 ]---

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/processor_idle.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 6f3b217..e8e2d88 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -216,8 +216,10 @@ static void acpi_safe_halt(void)
 	 * test NEED_RESCHED:
 	 */
 	smp_mb();
-	if (!need_resched())
+	if (!need_resched()) {
 		safe_halt();
+		local_irq_disable();
+	}
 	current_thread_info()->status |= TS_POLLING;
 }
 
@@ -421,7 +423,9 @@ static void acpi_processor_idle(void)
 		else
 			acpi_safe_halt();
 
-		local_irq_enable();
+		if (irqs_disabled())
+			local_irq_enable();
+
 		return;
 	}
 
@@ -530,7 +534,9 @@ static void acpi_processor_idle(void)
 		 *       skew otherwise.
 		 */
 		sleep_ticks = 0xFFFFFFFF;
-		local_irq_enable();
+		if (irqs_disabled())
+			local_irq_enable();
+
 		break;
 
 	case ACPI_STATE_C2:
-- 
1.5.5.rc0.6.gdeda


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/6] ACPI: battery: Don't return -EFAIL on broken packages.
  2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
@ 2008-03-18  6:02   ` Len Brown
  2008-03-18  6:02   ` [PATCH 3/6] Revert "thermal: fix generic thermal I/F for hwmon" Len Brown
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi; +Cc: Alexey Starikovskiy, Len Brown

From: Alexey Starikovskiy <astarikovskiy@suse.de>

Acer BIOS has a bug which is exposed when a dead battery is present.

The package template that is used to describe battery status is
over-written with sane values when the battery is live.
But when the batter is dead, a bogus reference in the template
is used.  In this case, Linux returns a fault, when instead
it should simply return that it doesn't know the missing value.

http://bugzilla.kernel.org/show_bug.cgi?id=8573
http://bugzilla.kernel.org/show_bug.cgi?id=10202

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/battery.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index f6215e8..d5729d5 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -293,13 +293,12 @@ static int extract_package(struct acpi_battery *battery,
 				strncpy(ptr, (u8 *)&element->integer.value,
 					sizeof(acpi_integer));
 				ptr[sizeof(acpi_integer)] = 0;
-			} else return -EFAULT;
+			} else
+				*ptr = 0; /* don't have value */
 		} else {
-			if (element->type == ACPI_TYPE_INTEGER) {
-				int *x = (int *)((u8 *)battery +
-						offsets[i].offset);
-				*x = element->integer.value;
-			} else return -EFAULT;
+			int *x = (int *)((u8 *)battery + offsets[i].offset);
+			*x = (element->type == ACPI_TYPE_INTEGER) ?
+				element->integer.value : -1;
 		}
 	}
 	return 0;
-- 
1.5.5.rc0.6.gdeda


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/6] Revert "thermal: fix generic thermal I/F for hwmon"
  2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
  2008-03-18  6:02   ` [PATCH 2/6] ACPI: battery: Don't return -EFAIL on broken packages Len Brown
@ 2008-03-18  6:02   ` Len Brown
  2008-03-18  6:02   ` [PATCH 4/6] thermal: re-document thermal units Len Brown
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

This reverts commit 3152fb9f11cdd2fd8688c2c5cb805e5c09b53dd9.

This broke libsensors.

Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 Documentation/thermal/sysfs-api.txt |   22 +++---
 drivers/thermal/Kconfig             |    1 -
 drivers/thermal/thermal.c           |  169 ++++++-----------------------------
 3 files changed, 37 insertions(+), 155 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index d9f28be..ba9c2da 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -143,10 +143,10 @@ type				Strings which represent the thermal zone type.
 				This is given by thermal zone driver as part of registration.
 				Eg: "ACPI thermal zone" indicates it's a ACPI thermal device
 				RO
-				Required
+				Optional
 
 temp				Current temperature as reported by thermal zone (sensor)
-				Unit: millidegree Celsius
+				Unit: degree Celsius
 				RO
 				Required
 
@@ -163,7 +163,7 @@ mode				One of the predefined values in [kernel, user]
 					  charge of the thermal management.
 
 trip_point_[0-*]_temp		The temperature above which trip point will be fired
-				Unit: millidegree Celsius
+				Unit: degree Celsius
 				RO
 				Optional
 
@@ -193,7 +193,7 @@ type				String which represents the type of device
 				eg. For memory controller device on intel_menlow platform:
 				this should be "Memory controller"
 				RO
-				Required
+				Optional
 
 max_state			The maximum permissible cooling state of this cooling device.
 				RO
@@ -219,16 +219,16 @@ the sys I/F structure will be built like this:
 
 |thermal_zone1:
 	|-----type:			ACPI thermal zone
-	|-----temp:			37000
+	|-----temp:			37
 	|-----mode:			kernel
-	|-----trip_point_0_temp:	100000
+	|-----trip_point_0_temp:	100
 	|-----trip_point_0_type:	critical
-	|-----trip_point_1_temp:	80000
+	|-----trip_point_1_temp:	80
 	|-----trip_point_1_type:	passive
-	|-----trip_point_2_temp:	70000
-	|-----trip_point_2_type:	active0
-	|-----trip_point_3_temp:	60000
-	|-----trip_point_3_type:	active1
+	|-----trip_point_2_temp:	70
+	|-----trip_point_2_type:	active[0]
+	|-----trip_point_3_temp:	60
+	|-----trip_point_3_type:	active[1]
 	|-----cdev0:			--->/sys/class/thermal/cooling_device0
 	|-----cdev0_trip_point:		1	/* cdev0 can be used for passive */
 	|-----cdev1:			--->/sys/class/thermal/cooling_device3
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 3ab313e..69f19f2 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -4,7 +4,6 @@
 
 menuconfig THERMAL
 	bool "Generic Thermal sysfs driver"
-	select HWMON
 	default y
 	help
 	  Generic Thermal Sysfs driver offers a generic mechanism for
diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c
index 41bd4c8..8b86e53 100644
--- a/drivers/thermal/thermal.c
+++ b/drivers/thermal/thermal.c
@@ -30,10 +30,8 @@
 #include <linux/idr.h>
 #include <linux/thermal.h>
 #include <linux/spinlock.h>
-#include <linux/hwmon.h>
-#include <linux/hwmon-sysfs.h>
 
-MODULE_AUTHOR("Zhang Rui");
+MODULE_AUTHOR("Zhang Rui")
 MODULE_DESCRIPTION("Generic thermal management sysfs support");
 MODULE_LICENSE("GPL");
 
@@ -58,9 +56,6 @@ static LIST_HEAD(thermal_tz_list);
 static LIST_HEAD(thermal_cdev_list);
 static DEFINE_MUTEX(thermal_list_lock);
 
-static struct device *thermal_hwmon;
-#define MAX_THERMAL_ZONES	10
-
 static int get_idr(struct idr *idr, struct mutex *lock, int *id)
 {
 	int err;
@@ -92,67 +87,7 @@ static void release_idr(struct idr *idr, struct mutex *lock, int id)
 		mutex_unlock(lock);
 }
 
-/* hwmon sys I/F*/
-static ssize_t
-name_show(struct device *dev, struct device_attribute *attr, char *buf)
-{
-	return sprintf(buf, "thermal_sys_class\n");
-}
-
-static ssize_t
-temp_input_show(struct device *dev, struct device_attribute *attr, char *buf)
-{
-	struct thermal_zone_device *tz;
-	struct sensor_device_attribute *sensor_attr
-						= to_sensor_dev_attr(attr);
-
-	list_for_each_entry(tz, &thermal_tz_list, node)
-		if (tz->id == sensor_attr->index)
-			return tz->ops->get_temp(tz, buf);
-
-	return -ENODEV;
-}
-
-static ssize_t
-temp_crit_show(struct device *dev, struct device_attribute *attr,
-		char *buf)
-{
-	struct thermal_zone_device *tz;
-	struct sensor_device_attribute *sensor_attr
-						= to_sensor_dev_attr(attr);
-
-	list_for_each_entry(tz, &thermal_tz_list, node)
-		if (tz->id == sensor_attr->index)
-			return tz->ops->get_trip_temp(tz, 0, buf);
-
-	return -ENODEV;
-}
-
-static DEVICE_ATTR(name, 0444, name_show, NULL);
-static struct sensor_device_attribute sensor_attrs[] = {
-	SENSOR_ATTR(temp1_input, 0444, temp_input_show, NULL, 0),
-	SENSOR_ATTR(temp1_crit, 0444, temp_crit_show, NULL, 0),
-	SENSOR_ATTR(temp2_input, 0444, temp_input_show, NULL, 1),
-	SENSOR_ATTR(temp2_crit, 0444, temp_crit_show, NULL, 1),
-	SENSOR_ATTR(temp3_input, 0444, temp_input_show, NULL, 2),
-	SENSOR_ATTR(temp3_crit, 0444, temp_crit_show, NULL, 2),
-	SENSOR_ATTR(temp4_input, 0444, temp_input_show, NULL, 3),
-	SENSOR_ATTR(temp4_crit, 0444, temp_crit_show, NULL, 3),
-	SENSOR_ATTR(temp5_input, 0444, temp_input_show, NULL, 4),
-	SENSOR_ATTR(temp5_crit, 0444, temp_crit_show, NULL, 4),
-	SENSOR_ATTR(temp6_input, 0444, temp_input_show, NULL, 5),
-	SENSOR_ATTR(temp6_crit, 0444, temp_crit_show, NULL, 5),
-	SENSOR_ATTR(temp7_input, 0444, temp_input_show, NULL, 6),
-	SENSOR_ATTR(temp7_crit, 0444, temp_crit_show, NULL, 6),
-	SENSOR_ATTR(temp8_input, 0444, temp_input_show, NULL, 7),
-	SENSOR_ATTR(temp8_crit, 0444, temp_crit_show, NULL, 7),
-	SENSOR_ATTR(temp9_input, 0444, temp_input_show, NULL, 8),
-	SENSOR_ATTR(temp9_crit, 0444, temp_crit_show, NULL, 8),
-	SENSOR_ATTR(temp10_input, 0444, temp_input_show, NULL, 9),
-	SENSOR_ATTR(temp10_crit, 0444, temp_crit_show, NULL, 9),
-};
-
-/* thermal zone sys I/F */
+/* sys I/F for thermal zone */
 
 #define to_thermal_zone(_dev) \
 	container_of(_dev, struct thermal_zone_device, device)
@@ -279,7 +214,7 @@ do {	\
 	device_remove_file(_dev, &trip_point_attrs[_index * 2 + 1]);	\
 } while (0)
 
-/* cooling device sys I/F */
+/* sys I/F for cooling device */
 #define to_cooling_device(_dev)	\
 	container_of(_dev, struct thermal_cooling_device, device)
 
@@ -512,9 +447,6 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
 	struct thermal_zone_device *pos;
 	int result;
 
-	if (!type)
-		return ERR_PTR(-EINVAL);
-
 	if (strlen(type) >= THERMAL_NAME_LENGTH)
 		return ERR_PTR(-EINVAL);
 
@@ -545,9 +477,11 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *type,
 	}
 
 	/* sys I/F */
-	result = device_create_file(&cdev->device, &dev_attr_cdev_type);
-	if (result)
-		goto unregister;
+	if (type) {
+		result = device_create_file(&cdev->device, &dev_attr_cdev_type);
+		if (result)
+			goto unregister;
+	}
 
 	result = device_create_file(&cdev->device, &dev_attr_max_state);
 	if (result)
@@ -613,8 +547,8 @@ void thermal_cooling_device_unregister(struct
 		tz->ops->unbind(tz, cdev);
 	}
 	mutex_unlock(&thermal_list_lock);
-
-	device_remove_file(&cdev->device, &dev_attr_cdev_type);
+	if (cdev->type[0])
+		device_remove_file(&cdev->device, &dev_attr_cdev_type);
 	device_remove_file(&cdev->device, &dev_attr_max_state);
 	device_remove_file(&cdev->device, &dev_attr_cur_state);
 
@@ -646,9 +580,6 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
 	int result;
 	int count;
 
-	if (!type)
-		return ERR_PTR(-EINVAL);
-
 	if (strlen(type) >= THERMAL_NAME_LENGTH)
 		return ERR_PTR(-EINVAL);
 
@@ -670,13 +601,6 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
 		kfree(tz);
 		return ERR_PTR(result);
 	}
-	if (tz->id >= MAX_THERMAL_ZONES) {
-		printk(KERN_ERR PREFIX
-			"Too many thermal zones\n");
-		release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id);
-		kfree(tz);
-		return ERR_PTR(-EINVAL);
-	}
 
 	strcpy(tz->type, type);
 	tz->ops = ops;
@@ -691,27 +615,12 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
 		return ERR_PTR(result);
 	}
 
-	/* hwmon sys I/F */
-	result = device_create_file(thermal_hwmon,
-					&sensor_attrs[tz->id * 2].dev_attr);
-	if (result)
-		goto unregister;
-
-	if (trips > 0) {
-		char buf[40];
-		result = tz->ops->get_trip_type(tz, 0, buf);
-		if (result > 0 && !strcmp(buf, "critical\n")) {
-			result = device_create_file(thermal_hwmon,
-					&sensor_attrs[tz->id * 2 + 1].dev_attr);
-			if (result)
-				goto unregister;
-		}
-	}
-
 	/* sys I/F */
-	result = device_create_file(&tz->device, &dev_attr_type);
-	if (result)
-		goto unregister;
+	if (type) {
+		result = device_create_file(&tz->device, &dev_attr_type);
+		if (result)
+			goto unregister;
+	}
 
 	result = device_create_file(&tz->device, &dev_attr_temp);
 	if (result)
@@ -778,17 +687,8 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 		    tz->ops->unbind(tz, cdev);
 	mutex_unlock(&thermal_list_lock);
 
-	device_remove_file(thermal_hwmon,
-				&sensor_attrs[tz->id * 2].dev_attr);
-	if (tz->trips > 0) {
-		char buf[40];
-		if (tz->ops->get_trip_type(tz, 0, buf) > 0)
-			if (!strcmp(buf, "critical\n"))
-				device_remove_file(thermal_hwmon,
-				&sensor_attrs[tz->id * 2 + 1].dev_attr);
-	}
-
-	device_remove_file(&tz->device, &dev_attr_type);
+	if (tz->type[0])
+		device_remove_file(&tz->device, &dev_attr_type);
 	device_remove_file(&tz->device, &dev_attr_temp);
 	if (tz->ops->get_mode)
 		device_remove_file(&tz->device, &dev_attr_mode);
@@ -805,19 +705,6 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 
 EXPORT_SYMBOL(thermal_zone_device_unregister);
 
-static void thermal_exit(void)
-{
-	if (thermal_hwmon) {
-		device_remove_file(thermal_hwmon, &dev_attr_name);
-		hwmon_device_unregister(thermal_hwmon);
-	}
-	class_unregister(&thermal_class);
-	idr_destroy(&thermal_tz_idr);
-	idr_destroy(&thermal_cdev_idr);
-	mutex_destroy(&thermal_idr_lock);
-	mutex_destroy(&thermal_list_lock);
-}
-
 static int __init thermal_init(void)
 {
 	int result = 0;
@@ -829,21 +716,17 @@ static int __init thermal_init(void)
 		mutex_destroy(&thermal_idr_lock);
 		mutex_destroy(&thermal_list_lock);
 	}
-
-	thermal_hwmon = hwmon_device_register(NULL);
-	if (IS_ERR(thermal_hwmon)) {
-		result = PTR_ERR(thermal_hwmon);
-		thermal_hwmon = NULL;
-		printk(KERN_ERR PREFIX
-			"unable to register hwmon device\n");
-		thermal_exit();
-		return result;
-	}
-
-	result = device_create_file(thermal_hwmon, &dev_attr_name);
-
 	return result;
 }
 
+static void __exit thermal_exit(void)
+{
+	class_unregister(&thermal_class);
+	idr_destroy(&thermal_tz_idr);
+	idr_destroy(&thermal_cdev_idr);
+	mutex_destroy(&thermal_idr_lock);
+	mutex_destroy(&thermal_list_lock);
+}
+
 subsys_initcall(thermal_init);
 module_exit(thermal_exit);
-- 
1.5.5.rc0.6.gdeda


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/6] thermal: re-document thermal units
  2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
  2008-03-18  6:02   ` [PATCH 2/6] ACPI: battery: Don't return -EFAIL on broken packages Len Brown
  2008-03-18  6:02   ` [PATCH 3/6] Revert "thermal: fix generic thermal I/F for hwmon" Len Brown
@ 2008-03-18  6:02   ` Len Brown
  2008-03-18  6:02   ` [PATCH 5/6] thermal: delete "default y" Len Brown
  2008-03-18  6:02   ` [PATCH 6/6] Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware" Len Brown
  4 siblings, 0 replies; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi; +Cc: Zhang, Rui, Len Brown

From: Zhang, Rui <rui.zhang@intel.com>

(reverting the previous sysfs patch also reverted a fix
 to the thermal units documentation, which is restored by this commit)

The generic thermal driver shows temperature in millidegree Celsius.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 Documentation/thermal/sysfs-api.txt |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index ba9c2da..d9f28be 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -143,10 +143,10 @@ type				Strings which represent the thermal zone type.
 				This is given by thermal zone driver as part of registration.
 				Eg: "ACPI thermal zone" indicates it's a ACPI thermal device
 				RO
-				Optional
+				Required
 
 temp				Current temperature as reported by thermal zone (sensor)
-				Unit: degree Celsius
+				Unit: millidegree Celsius
 				RO
 				Required
 
@@ -163,7 +163,7 @@ mode				One of the predefined values in [kernel, user]
 					  charge of the thermal management.
 
 trip_point_[0-*]_temp		The temperature above which trip point will be fired
-				Unit: degree Celsius
+				Unit: millidegree Celsius
 				RO
 				Optional
 
@@ -193,7 +193,7 @@ type				String which represents the type of device
 				eg. For memory controller device on intel_menlow platform:
 				this should be "Memory controller"
 				RO
-				Optional
+				Required
 
 max_state			The maximum permissible cooling state of this cooling device.
 				RO
@@ -219,16 +219,16 @@ the sys I/F structure will be built like this:
 
 |thermal_zone1:
 	|-----type:			ACPI thermal zone
-	|-----temp:			37
+	|-----temp:			37000
 	|-----mode:			kernel
-	|-----trip_point_0_temp:	100
+	|-----trip_point_0_temp:	100000
 	|-----trip_point_0_type:	critical
-	|-----trip_point_1_temp:	80
+	|-----trip_point_1_temp:	80000
 	|-----trip_point_1_type:	passive
-	|-----trip_point_2_temp:	70
-	|-----trip_point_2_type:	active[0]
-	|-----trip_point_3_temp:	60
-	|-----trip_point_3_type:	active[1]
+	|-----trip_point_2_temp:	70000
+	|-----trip_point_2_type:	active0
+	|-----trip_point_3_temp:	60000
+	|-----trip_point_3_type:	active1
 	|-----cdev0:			--->/sys/class/thermal/cooling_device0
 	|-----cdev0_trip_point:		1	/* cdev0 can be used for passive */
 	|-----cdev1:			--->/sys/class/thermal/cooling_device3
-- 
1.5.5.rc0.6.gdeda


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/6] thermal: delete "default y"
  2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
                     ` (2 preceding siblings ...)
  2008-03-18  6:02   ` [PATCH 4/6] thermal: re-document thermal units Len Brown
@ 2008-03-18  6:02   ` Len Brown
  2008-03-18  6:02   ` [PATCH 6/6] Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware" Len Brown
  4 siblings, 0 replies; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

The generic thermal I/F gets selected by ACPI_THERMAL --
its only current customer.
it doesn't need to clutter other configs by default.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/thermal/Kconfig |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 69f19f2..17e71d5 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -4,7 +4,6 @@
 
 menuconfig THERMAL
 	bool "Generic Thermal sysfs driver"
-	default y
 	help
 	  Generic Thermal Sysfs driver offers a generic mechanism for
 	  thermal management. Usually it's made up of one or more thermal
-- 
1.5.5.rc0.6.gdeda


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/6] Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
  2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
                     ` (3 preceding siblings ...)
  2008-03-18  6:02   ` [PATCH 5/6] thermal: delete "default y" Len Brown
@ 2008-03-18  6:02   ` Len Brown
       [not found]     ` <1205852061.21619.192.camel@queen.suse.de>
  4 siblings, 1 reply; 9+ messages in thread
From: Len Brown @ 2008-03-18  6:02 UTC (permalink / raw)
  To: linux-acpi; +Cc: Len Brown

From: Len Brown <len.brown@intel.com>

This reverts commit 3fa2cdcc45a0176de15cac9dbf4ed2834ebf8932.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown>
---
 drivers/acpi/video.c |   31 +------------------------------
 1 files changed, 1 insertions(+), 30 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1bc0c74..98f1d4e 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -807,40 +807,11 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
 static int acpi_video_bus_check(struct acpi_video_bus *video)
 {
 	acpi_status status = -ENOENT;
-	long device_id;
-	struct device *dev;
-	struct acpi_device *device;
+
 
 	if (!video)
 		return -EINVAL;
 
-	device = video->device;
-
-	status =
-	    acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
-
-	if (!ACPI_SUCCESS(status))
-		return -ENODEV;
-
-	/* We need to attempt to determine whether the _ADR refers to a
-	   PCI device or not. There's no terribly good way to do this,
-	   so the best we can hope for is to assume that there'll never
-	   be a video device in the host bridge */
-	if (device_id >= 0x10000) {
-		/* It looks like a PCI device. Does it exist? */
-		dev = acpi_get_physical_device(device->handle);
-	} else {
-		/* It doesn't look like a PCI device. Does its parent
-		   exist? */
-		acpi_handle phandle;
-		if (acpi_get_parent(device->handle, &phandle))
-			return -ENODEV;
-		dev = acpi_get_physical_device(phandle);
-	}
-	if (!dev)
-		return -ENODEV;
-	put_device(dev);
-
 	/* Since there is no HID, CID and so on for VGA driver, we have
 	 * to check well known required nodes.
 	 */
-- 
1.5.5.rc0.6.gdeda


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 6/6] Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
       [not found]     ` <1205852061.21619.192.camel@queen.suse.de>
@ 2008-03-18 21:01       ` Len Brown
  2008-03-19  9:10         ` Thomas Renninger
  0 siblings, 1 reply; 9+ messages in thread
From: Len Brown @ 2008-03-18 21:01 UTC (permalink / raw)
  To: trenn; +Cc: linux-acpi, Adrian Bunk

On Tuesday 18 March 2008, Thomas Renninger wrote:
> On Tue, 2008-03-18 at 02:02 -0400, Len Brown wrote:
> > From: Len Brown <len.brown@intel.com>
> > 
> > This reverts commit 3fa2cdcc45a0176de15cac9dbf4ed2834ebf8932.
> > 
> > http://bugzilla.kernel.org/show_bug.cgi?id=9995
> 
> This is so wrong...
> You register a driver on a device which does not exist.
> You do this because on T61 ThinkPads, the external graphics device
> method (soft-int 10) for brightness switching also works for the
> internal Intel graphics card by pure luck...
>
> You introduce this obviously wrong approach and break other machines
> intentionally (this is not a regression, because brightness switching
> was done through thinkpad_acpi before).

acpi video brightness worked on the T61 before this patch, eg. in 2.6.24.
acpi video brightness stopped working when this patch was applied.
acpi video brightness works again when this patch (and its clone) were reverted.

> This is known for months and reverting this in last minute is the wrong
> action.
> This should be:
>   - fixed up in BIOS through a OSI("IGD") string

IGD isn't part of this discussion, since that support didn't ship
in 2.6.24, and isn't shipping in 2.6.25.

Enabling IGD, or any other feature, via OSI on a platform that has
already shipped is effectively impossible.  It would require every
BIOS and every OS to be updated.

>   - get workarounded (as it always has been done) in thinkpad-acpi
>     meanwhile.
>
> Please try to not load the ACPI video driver.
> Instead load the thinkpad_acpi driver with:
> brightness_enable=1
> parameter. Does this work?
> If that works, this is the right workaround for T61 with
> internal/on-board
> Intel graphics card.

Yes, the thinkpad_acpi driver with brightness_enable=1 works.

The thinkpad_acpi driver is really useful.
It provides ways to get to thinkpad features for which
no standard interface in Linux currently exists.

However, the thinkpad_acpi driver should not be used
to provide features for which a generic method exists.

I understand that a distro may latch onto thinkpad_acpi
to get features in the hands of customers as soon as possible.
I understand that the transition off of custom solutions
is never easy.  brightness_enable=1 was added to ease that
transition.  If you have additional suggestions, please speak up.

> You can get a dmi blacklisting so that video driver is not loaded on the
> ThinkPads or this can be done in user-space, but pls do not revert this
> obvious fix.

This patch was far from obvious, including to Matthew, who created it.

-Len

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 6/6] Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
  2008-03-18 21:01       ` Len Brown
@ 2008-03-19  9:10         ` Thomas Renninger
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Renninger @ 2008-03-19  9:10 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Adrian Bunk


On Tue, 2008-03-18 at 17:01 -0400, Len Brown wrote:
> On Tuesday 18 March 2008, Thomas Renninger wrote:
> > On Tue, 2008-03-18 at 02:02 -0400, Len Brown wrote:
> > > From: Len Brown <len.brown@intel.com>
> > > 
> > > This reverts commit 3fa2cdcc45a0176de15cac9dbf4ed2834ebf8932.
> > > 
> > > http://bugzilla.kernel.org/show_bug.cgi?id=9995
> > 
> > This is so wrong...
> > You register a driver on a device which does not exist.
> > You do this because on T61 ThinkPads, the external graphics device
> > method (soft-int 10) for brightness switching also works for the
> > internal Intel graphics card by pure luck...
> >
> > You introduce this obviously wrong approach and break other machines
> > intentionally (this is not a regression, because brightness switching
> > was done through thinkpad_acpi before).
> 
> acpi video brightness worked on the T61 before this patch, eg. in 2.6.24.
> acpi video brightness stopped working when this patch was applied.
> acpi video brightness works again when this patch (and its clone) were reverted.
It worked in a very broken way, by using the Nvidia ACPI graphics
device, even you have an Intel graphics card plugged in.
> 
> > This is known for months and reverting this in last minute is the wrong
> > action.
> > This should be:
> >   - fixed up in BIOS through a OSI("IGD") string
> 
> IGD isn't part of this discussion, since that support didn't ship
> in 2.6.24, and isn't shipping in 2.6.25.
IGD is the reason why this does not work as expected.

> Enabling IGD, or any other feature, via OSI on a platform that has
> already shipped is effectively impossible.  It would require every
> BIOS and every OS to be updated.
The only correct fix (as long as Linux does not support IGD) is a BIOS
fix like this:

Nvidia device
    _BCM implementation: use_int10
Intel device
    if (OSI="IGD")
        _BCM implementation: use_IGD
    else
        _BCM implementation: use_int10

and everything could work fine with the video.c implementation.
I just realize that this does not work because we return true for
OSI=Windows and these do not know about OSI="IGD".
This must be changed in future (I am still waiting for examples where it
really makes sense and does some good to return OSI=Windows). We now are
lucky because on ThinkPads the thinkpad_acpi driver can ugly, but easily
work around this.
There may pop up other things (e.g. IGD on other machines and whatever
other stuff) which will end in a Linux support impasse then.

Now this could get inverted and it would work (it is a bit embarrassing
to suggest this to a vendor: Can you please invert the logic because we
return true for Windows also)...:
Nvidia device
    _BCM implementation: use_int10
Intel device
    if (OSI="NOIGD")
        _BCM implementation: use_int10
    else
        _BCM implementation: use_IGD

That vendors are publishing OSI="Linux feature support" in their BIOS is
a bit optimistic and we might end up trying to dig in the dark fiddling
together things in vendor_acpi drivers as we always did.
But currently there is a move towards Linux also on laptops/workstations
and those vendors who care to publish a BIOS which fully works on Linux
and always should need the ability to do this.

> >   - get workarounded (as it always has been done) in thinkpad-acpi
> >     meanwhile.
> >
> > Please try to not load the ACPI video driver.
> > Instead load the thinkpad_acpi driver with:
> > brightness_enable=1
> > parameter. Does this work?
> > If that works, this is the right workaround for T61 with
> > internal/on-board
> > Intel graphics card.
> 
> Yes, the thinkpad_acpi driver with brightness_enable=1 works.
> 
> The thinkpad_acpi driver is really useful.
> It provides ways to get to thinkpad features for which
> no standard interface in Linux currently exists.
> 
> However, the thinkpad_acpi driver should not be used
> to provide features for which a generic method exists.
> 
> I understand that a distro may latch onto thinkpad_acpi
> to get features in the hands of customers as soon as possible.
> I understand that the transition off of custom solutions
> is never easy.  brightness_enable=1 was added to ease that
> transition.  If you have additional suggestions, please speak up.
> 
> > You can get a dmi blacklisting so that video driver is not loaded on the
> > ThinkPads or this can be done in user-space, but pls do not revert this
> > obvious fix.
> 
> This patch was far from obvious, including to Matthew, who created it.
PCI devices do not have a _STA function.
Therefore one has to look up PCI slot:dev.func and check whether the
device is present and really plugged into the board.

   Thomas

--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-03-20  1:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-18  6:02 ACPI patches for 2.6.25-rc6 Len Brown
2008-03-18  6:02 ` [PATCH 1/6] ACPI: lockdep warning on boot, 2.6.25-rc5 Len Brown
2008-03-18  6:02   ` [PATCH 2/6] ACPI: battery: Don't return -EFAIL on broken packages Len Brown
2008-03-18  6:02   ` [PATCH 3/6] Revert "thermal: fix generic thermal I/F for hwmon" Len Brown
2008-03-18  6:02   ` [PATCH 4/6] thermal: re-document thermal units Len Brown
2008-03-18  6:02   ` [PATCH 5/6] thermal: delete "default y" Len Brown
2008-03-18  6:02   ` [PATCH 6/6] Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware" Len Brown
     [not found]     ` <1205852061.21619.192.camel@queen.suse.de>
2008-03-18 21:01       ` Len Brown
2008-03-19  9:10         ` Thomas Renninger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox