Skip to contentSkip to conversation

ACPI paches for 2.6.33-rc8

PATCH In review Len Brown 1 participant 12 messages Feb 16, 2010 – Feb 18, 2010

Subsystems (7)
lore
Share & tools
lore

Len Brown

author reviewer
#0 lore raw

Please let me know if you have any trouble with these candidates, or have others that merit inclusion in 2.6.33.

thanks,
-Len

author reviewer
#1 lore raw

PATCH 1/10 ACPI: processor: add kernel command line support for early _PDC eval

From: Alex Chiang <[email protected]>

Allow platforms not listed in DMI table
to opt-in and evaluate _PDC early.

---
 Documentation/kernel-parameters.txt |    4 ++++
 drivers/acpi/processor_pdc.c        |    7 +++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
Documentation/kernel-parameters.txt +4 -0
index 736d456..826b6e1 100644
@@ -199,6 +199,10 @@ and is between 256 and 4096 characters. It is defined in the file
 			acpi_display_output=video
 			See above.
 
+	acpi_early_pdc_eval	[HW,ACPI] Evaluate processor _PDC methods
+				early. Needed on some platforms to properly
+				initialize the EC.
+
 	acpi_irq_balance [HW,ACPI]
 			ACPI will balance active IRQs
 			default in APIC mode
drivers/acpi/processor_pdc.c +7 -0
index 7247819..3bbafe9 100644
@@ -151,6 +151,13 @@ static int set_early_pdc_optin(const struct dmi_system_id *id)
 	return 0;
 }
 
+static int param_early_pdc_optin(char *s)
+{
+	early_pdc_optin = 1;
+	return 1;
+}
+__setup("acpi_early_pdc_eval", param_early_pdc_optin);
+
 static struct dmi_system_id __cpuinitdata early_pdc_optin_table[] = {
 	{
 	set_early_pdc_optin, "HP Envy", {
Signature · 1 line
1.6.0.6
author reviewer
#2 lore raw

PATCH 2/10 ACPI: processor: only evaluate _PDC once per processor

In reply to Len Brown

From: Alex Chiang <[email protected]>

If we evaluate _PDC in the early path, we do not want to evaluate it again when the processor driver is loaded.

---
 drivers/acpi/processor_pdc.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/acpi/processor_pdc.c +7 -0
index 3bbafe9..e306ba9 100644
@@ -125,6 +125,8 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
 	return status;
 }
 
+static int early_pdc_done;
+
 void acpi_processor_set_pdc(acpi_handle handle)
 {
 	struct acpi_object_list *obj_list;
@@ -132,6 +134,9 @@ void acpi_processor_set_pdc(acpi_handle handle)
 	if (arch_has_acpi_pdc() == false)
 		return;
 
+	if (early_pdc_done)
+		return;
+
 	obj_list = acpi_processor_alloc_pdc();
 	if (!obj_list)
 		return;
@@ -199,4 +204,6 @@ void __init acpi_early_processor_set_pdc(void)
 	acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
 			    ACPI_UINT32_MAX,
 			    early_init_pdc, NULL, NULL, NULL);
+
+	early_pdc_done = 1;
 }
Signature · 1 line
1.6.0.6
author reviewer
#3 lore raw

PATCH 3/10 ACPI: Add NULL pointer check in acpi_bus_start

In reply to Len Brown

From: Thomas Renninger <[email protected]>

If acpi_bus_add does not return a device and it's passed to acpi_bus_start, bad things will happen:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffff8128402d>] acpi_bus_start+0x14/0x24
...
[<ffffffffa008977a>] acpiphp_bus_add+0xba/0x130 [acpiphp]
[<ffffffffa008aa72>] enable_device+0x132/0x2ff [acpiphp]
[<ffffffffa0089b68>] acpiphp_enable_slot+0xb8/0x130 [acpiphp]
[<ffffffffa0089df7>] handle_hotplug_event_func+0x87/0x190 [acpiphp]

Next patch would make this NULL pointer check obsolete, but better having one more than one missing...

---
 drivers/acpi/scan.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/acpi/scan.c +3 -0
index ff9f622..8044583 100644
@@ -1357,6 +1357,9 @@ int acpi_bus_start(struct acpi_device *device)
 {
 	struct acpi_bus_ops ops;
 
+	if (!device)
+		return -EINVAL;
+
 	memset(&ops, 0, sizeof(ops));
 	ops.acpi_op_start = 1;
 
Signature · 1 line
1.6.0.6
author reviewer
#4 lore raw

PATCH 4/10 ACPI: acpi_bus_{scan,bus,add}: return -ENODEV if no device was found

In reply to Len Brown

From: Thomas Renninger <[email protected]>

Callers (acpi_memhotplug.c, dock.c and others) check for the return value of acpi_bus_add() and assume a valid device was returned in case zero was returned.

Thus return -ENODEV if no device was found in acpi_bus_scan and propagate this through acpi_bus_add and acpi_bus_start.

Also remove a confusing comment in acpiphp_glue.c, acpi_bus_scan will and cannot invoke if acpi_bus_add returns no valid device.

---
 drivers/acpi/scan.c                |   24 +++++++++++++++++++-----
 drivers/pci/hotplug/acpiphp_glue.c |    6 ------
 2 files changed, 19 insertions(+), 11 deletions(-)
drivers/acpi/scan.c +19 -5
index 8044583..3e00967 100644
@@ -1336,9 +1336,25 @@ static int acpi_bus_scan(acpi_handle handle, struct acpi_bus_ops *ops,
 
 	if (child)
 		*child = device;
-	return 0;
+
+	if (device)
+		return 0;
+	else
+		return -ENODEV;
 }
 
+/*
+ * acpi_bus_add and acpi_bus_start
+ *
+ * scan a given ACPI tree and (probably recently hot-plugged)
+ * create and add or starts found devices.
+ *
+ * If no devices were found -ENODEV is returned which does not
+ * mean that this is a real error, there just have been no suitable
+ * ACPI objects in the table trunk from which the kernel could create
+ * a device and add/start an appropriate driver.
+ */
+
 int
 acpi_bus_add(struct acpi_device **child,
 	     struct acpi_device *parent, acpi_handle handle, int type)
@@ -1348,8 +1364,7 @@ acpi_bus_add(struct acpi_device **child,
 	memset(&ops, 0, sizeof(ops));
 	ops.acpi_op_add = 1;
 
-	acpi_bus_scan(handle, &ops, child);
-	return 0;
+	return acpi_bus_scan(handle, &ops, child);
 }
 EXPORT_SYMBOL(acpi_bus_add);
 
@@ -1363,8 +1378,7 @@ int acpi_bus_start(struct acpi_device *device)
 	memset(&ops, 0, sizeof(ops));
 	ops.acpi_op_start = 1;
 
-	acpi_bus_scan(device->handle, &ops, NULL);
-	return 0;
+	return acpi_bus_scan(device->handle, &ops, NULL);
 }
 EXPORT_SYMBOL(acpi_bus_start);
 
drivers/pci/hotplug/acpiphp_glue.c +0 -6
index 8e952fd..cb2fd01 100644
@@ -720,12 +720,6 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
 			-ret_val);
 		goto acpiphp_bus_add_out;
 	}
-	/*
-	 * try to start anyway.  We could have failed to add
-	 * simply because this bus had previously been added
-	 * on another add.  Don't bother with the return value
-	 * we just keep going.
-	 */
 	ret_val = acpi_bus_start(device);
 
 acpiphp_bus_add_out:
Signature · 1 line
1.6.0.6
author reviewer
#5 lore raw

PATCH 5/10 thinkpad-acpi: wrong thermal attribute_group removed in thermal_exit()

In reply to Len Brown

From: Roel Kluin <[email protected]>

sysfs_remove_group() removed the wrong attribute_group for thermal_read_mode TPEC_8, ACPI_TMP07 and ACPI_UPDT

---
 drivers/platform/x86/thinkpad_acpi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +1 -1
index e67e4fe..eb603f1 100644
@@ -5771,7 +5771,7 @@ static void thermal_exit(void)
 	case TPACPI_THERMAL_ACPI_TMP07:
 	case TPACPI_THERMAL_ACPI_UPDT:
 		sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj,
-				   &thermal_temp_input16_group);
+				   &thermal_temp_input8_group);
 		break;
 	case TPACPI_THERMAL_NONE:
 	default:
Signature · 1 line
1.6.0.6
author reviewer
#6 lore raw

PATCH 6/10 ACPI: remove Asus P2B-DS from acpi=ht blacklist

In reply to Len Brown

From: Len Brown <[email protected]>

We realized when we broke acpi=ht
http://bugzilla.kernel.org/show_bug.cgi?id=14886
that acpi=ht is not needed on this box
and folks have been using acpi=force on it anyway.

---
 arch/x86/kernel/acpi/boot.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
arch/x86/kernel/acpi/boot.c +0 -8
index 0acbcdf..af1c583 100644
@@ -1344,14 +1344,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
 	 },
 	{
 	 .callback = force_acpi_ht,
-	 .ident = "ASUS P2B-DS",
-	 .matches = {
-		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-		     DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
-		     },
-	 },
-	{
-	 .callback = force_acpi_ht,
 	 .ident = "ASUS CUR-DLS",
 	 .matches = {
 		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
Signature · 1 line
1.6.0.6
author reviewer
#7 lore raw

PATCH 7/10 ACPI: fix "acpi=ht" boot option

In reply to Len Brown

From: Len Brown <[email protected]>

We broke "acpi=ht" in 2.6.32 by disabling MADT parsing for acpi=disabled. e5b8fc6ac158f65598f58dba2c0d52ba3b412f52 This also broke systems which invoked acpi=ht via DMI blacklist.

acpi=ht is a really ugly hack,
but restore it for those that still use it.

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

---
 drivers/acpi/tables.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/tables.c +2 -2
index f336bca..8a0ed28 100644
@@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id,
 	unsigned long table_end;
 	acpi_size tbl_size;
 
-	if (acpi_disabled)
+	if (acpi_disabled && !acpi_ht)
 		return -ENODEV;
 
 	if (!handler)
@@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
 	struct acpi_table_header *table = NULL;
 	acpi_size tbl_size;
 
-	if (acpi_disabled)
+	if (acpi_disabled && !acpi_ht)
 		return -ENODEV;
 
 	if (!handler)
Signature · 1 line
1.6.0.6
author reviewer
#8 lore raw

Re: [PATCH 07/10] ACPI: fix "acpi=ht" boot option (take two, don't break ia64 build)

From: Len Brown <[email protected]>

We broke "acpi=ht" in 2.6.32 by disabling MADT parsing for acpi=disabled. e5b8fc6ac158f65598f58dba2c0d52ba3b412f52 This also broke systems which invoked acpi=ht via DMI blacklist.

acpi=ht is a really ugly hack,
but restore it for those that still use it.

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

---
 arch/ia64/include/asm/acpi.h |    1 +
 drivers/acpi/tables.c        |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/ia64/include/asm/acpi.h +1 -0
index 7ae5889..e97b255 100644
@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
 #define acpi_noirq 0	/* ACPI always enabled on IA64 */
 #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
 #define acpi_strict 1	/* no ACPI spec workarounds on IA64 */
+#define acpi_ht 0	/* no HT-only mode on IA64 */
 #endif
 #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
 static inline void disable_acpi(void) { }
drivers/acpi/tables.c +2 -2
index f336bca..8a0ed28 100644
@@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id,
 	unsigned long table_end;
 	acpi_size tbl_size;
 
-	if (acpi_disabled)
+	if (acpi_disabled && !acpi_ht)
 		return -ENODEV;
 
 	if (!handler)
@@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
 	struct acpi_table_header *table = NULL;
 	acpi_size tbl_size;
 
-	if (acpi_disabled)
+	if (acpi_disabled && !acpi_ht)
 		return -ENODEV;
 
 	if (!handler)
Signature · 1 line
1.7.0.17.g7e5eb
author reviewer
#9 lore raw

PATCH 8/10 ACPI: dock: properly initialize local struct dock_station in dock_add()

In reply to Len Brown

From: Alex Chiang <[email protected]>

Commit fe06fba2 (ACPI: dock: add struct dock_station * directly to platform device data) changed dock_add() to use the platform_device_register_data() API.

We passed that interface a stack variable, which is kmemdup'ed and assigned to the device's platform_data pointer.

Unfortunately, whatever random garbage is in the stack variable gets coped during the kmemdup, and that leads to broken behavior.

Explicitly zero out the structure before passing it to the API.

This fixes the T41 docking button issue:
http://bugzilla.kernel.org/show_bug.cgi?id=15000

---
 drivers/acpi/dock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/acpi/dock.c +1 -0
index bbc2c13..b2586f5 100644
@@ -935,6 +935,7 @@ static int dock_add(acpi_handle handle)
 	struct platform_device *dd;
 
 	id = dock_station_count;
+	memset(&ds, 0, sizeof(ds));
 	dd = platform_device_register_data(NULL, "dock", id, &ds, sizeof(ds));
 	if (IS_ERR(dd))
 		return PTR_ERR(dd);
Signature · 1 line
1.6.0.6
author reviewer
#10 lore raw

PATCH 9/10 ACPI: fix High cpu temperature with 2.6.32

In reply to Len Brown

From: Arjan van de Ven <[email protected]>

Since the rewrite of the CPU idle governor in 2.6.32, two laptops have surfaced where the BIOS advertises a C2 power state, but for some reason this state is not functioning (as verified in both cases by powertop before the patch in .32).

The old governor had the accidental behavior that if a non-working state was chosen too many times, it would end up falling back to C1. The new governor works differently and this accidental behavior is no longer there; the result is a high temperature on these two machines.

This patch adds these 2 machines to the DMI table for C state anomalies; by just not using C2 both these machines are better off (the TSC can be used instead of the pm timer, giving a performance boost for example).

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

---
 drivers/acpi/processor_idle.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/acpi/processor_idle.c +8 -0
index 7c0441f..e88e8ae 100644
@@ -110,6 +110,14 @@ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
 	  DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
 	  DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")},
 	 (void *)2},
+	{ set_max_cstate, "Pavilion zv5000", {
+	  DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"Pavilion zv5000 (DS502A#ABA)")},
+	 (void *)1},
+	{ set_max_cstate, "Asus L8400B", {
+	  DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")},
+	 (void *)1},
 	{},
 };
 
Signature · 1 line
1.6.0.6
author reviewer
#11 lore raw

PATCH 10/10 ACPI, i915: blacklist Clevo M5x0N bad_lid state

In reply to Len Brown

From: Zhang Rui <[email protected]>

Wrong Lid state reported.
Need to blacklist this machine for LVDS detection.

---
 drivers/gpu/drm/i915/intel_lvds.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +7 -0
index b1d0acb..c2e8a45 100644
@@ -636,6 +636,13 @@ static const struct dmi_system_id bad_lid_status[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"),
 		},
 	},
+	{
+		.ident = "Clevo M5x0N",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
+			DMI_MATCH(DMI_BOARD_NAME, "M5x0N"),
+		},
+	},
 	{ }
 };
 
Signature · 1 line
1.6.0.6