Skip to contentSkip to conversation

ACPI patches for 2.6.25-rc5

PATCH New Len Brown 4 participants 17 messages Mar 11, 2008

Subsystems (3)
lore
Share & tools
lore

Len Brown

author reviewer
#0 lore raw

Here is the current queue for 2.6.25-rc5

If you see anything that isn't rc5 worthy
or you see that I missed something that is,
please let me know.

thanks,
-Len

author reviewer
#1 lore raw

PATCH 1/12 ACPI: fix section mismatch in processor_core.c:acpi_processor_hotplug_notify

From: Sam Ravnborg <[email protected]>

Fix following warning:
WARNING: vmlinux.o(.text+0x55586c): Section mismatch in reference from the function acpi_processor_hotplug_notify() to the function .cpuinit.text:acpi_processor_start()

acpi_processor_hotplug_notify() may safely reference __cpuinit stuff as it ids defined inside an ACPI_HOTPLUG_CPU block. So annotate it __ref to silence the warning.

---
 drivers/acpi/processor_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/processor_core.c +2 -2
index 75ccf5d..d3cc07f 100644
@@ -881,8 +881,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
 	return 0;
 }
 
-static void
-acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
+static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
+						u32 event, void *data)
 {
 	struct acpi_processor *pr;
 	struct acpi_device *device = NULL;
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#2 lore raw

PATCH 2/12 acer-wmi: fix section mismatch warnings

In reply to Len Brown

From: Sam Ravnborg <[email protected]>

Fix following warnings:
WARNING: vmlinux.o(.text+0x672615): Section mismatch in reference from the function acer_platform_remove() to the function .exit.text:acer_backlight_exit()
WARNING: vmlinux.o(.devinit.text+0x1e859): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_led_init()
WARNING: vmlinux.o(.devinit.text+0x1e878): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_backlight_init()

Remove __exit annotation from acer_backlight_exit(). We cannot reference a __exit annotated function from non __exit functions.

acer_led_init() and acer_backlight_init() where both annotated __init but used from a __devinit function. This would result in an oops should gcc drop their inlining and the module are hot plugged.

Fix by annotating acer_led_init() and acer_backlight_init() __devinit.

---
 drivers/misc/acer-wmi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/misc/acer-wmi.c +3 -3
index d7aea93..cdc733b 100644
@@ -756,7 +756,7 @@ static struct led_classdev mail_led = {
 	.brightness_set = mail_led_set,
 };
 
-static int __init acer_led_init(struct device *dev)
+static int __devinit acer_led_init(struct device *dev)
 {
 	return led_classdev_register(dev, &mail_led);
 }
@@ -789,7 +789,7 @@ static struct backlight_ops acer_bl_ops = {
 	.update_status = update_bl_status,
 };
 
-static int __init acer_backlight_init(struct device *dev)
+static int __devinit acer_backlight_init(struct device *dev)
 {
 	struct backlight_device *bd;
 
@@ -808,7 +808,7 @@ static int __init acer_backlight_init(struct device *dev)
 	return 0;
 }
 
-static void __exit acer_backlight_exit(void)
+static void acer_backlight_exit(void)
 {
 	backlight_device_unregister(acer_backlight_device);
 }
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#3 lore raw

PATCH 3/12 ACPI: fix section mismatch in acpi_pci_root_add

In reply to Len Brown

From: Sam Ravnborg <[email protected]>

Fix following warning:
WARNING: vmlinux.o(.text+0x550e85): Section mismatch in reference from the function acpi_pci_root_add() to the function .devinit.text:pci_acpi_scan_root()

acpi_pci_root_add uses a __devinit annotated function and it looks like annotating it __devinit too is the correct fix.

---
 drivers/acpi/pci_root.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/pci_root.c +1 -1
index f14ff1f..c3fed31 100644
@@ -184,7 +184,7 @@ static void acpi_pci_bridge_scan(struct acpi_device *device)
 		}
 }
 
-static int acpi_pci_root_add(struct acpi_device *device)
+static int __devinit acpi_pci_root_add(struct acpi_device *device)
 {
 	int result = 0;
 	struct acpi_pci_root *root = NULL;
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#4 lore raw

PATCH 4/12 sony-laptop.c: fix off-by-one

In reply to Len Brown

From: Adrian Bunk <[email protected]>

This patch fixes an off-by-one spotted by the Coverity checker.

---
 drivers/misc/sony-laptop.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/misc/sony-laptop.c +1 -1
index 899e3f7..02ff3d1 100644
@@ -315,7 +315,7 @@ static void sony_laptop_report_input_event(u8 event)
 		break;
 
 	default:
-		if (event > ARRAY_SIZE(sony_laptop_input_index)) {
+		if (event >= ARRAY_SIZE(sony_laptop_input_index)) {
 			dprintk("sony_laptop_report_input_event, event not known: %d\n", event);
 			break;
 		}
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#5 lore raw

PATCH 5/12 ACPI: Do not pass NULL to acpi_get_handle() when looking for _EJD

In reply to Len Brown

From: Holger Macht <[email protected]>

When trying to get the acpi_handle from an acpi_buffer, pass ACPI_ROOT_OBJECT instead of NULL to acpi_get_handle(). This fixes the detection of dock dependent bays.

---
 drivers/acpi/scan.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/acpi/scan.c +2 -1
index 3fac011..d9b9143 100644
@@ -609,7 +609,8 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
 	status = acpi_evaluate_object(handle, "_EJD", NULL, &buffer);
 	if (ACPI_SUCCESS(status)) {
 		obj = buffer.pointer;
-		status = acpi_get_handle(NULL, obj->string.pointer, ejd);
+		status = acpi_get_handle(ACPI_ROOT_OBJECT, obj->string.pointer,
+					 ejd);
 		kfree(buffer.pointer);
 	}
 	return status;
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#6 lore raw

PATCH 6/12 ACPI: prevent randconfig build failure on empty ACPI_CUSTOM_DSDT_FILE

In reply to Len Brown

From: Randy Dunlap <[email protected]>

Make ACPI_CUSTOM_DSDT boolean config symbol a hidden and derived value, based on the value of ACPI_CUSTOM_DSDT_FILE (string). Only the latter is presented to the user as a config option.

This fixes problems with "make randconfig" setting ACPI_CUSTOM_DSDT but leaving ACPI_CUSTOM_DSDT_FILE empty/blank.

---
 drivers/acpi/Kconfig |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)
drivers/acpi/Kconfig +9 -10
index f688c21..fbcaa06 100644
@@ -283,24 +283,23 @@ config ACPI_TOSHIBA
 	  If you have a legacy free Toshiba laptop (such as the Libretto L1
 	  series), say Y.
 
-config ACPI_CUSTOM_DSDT
-	bool "Include Custom DSDT"
+config ACPI_CUSTOM_DSDT_FILE
+	string "Custom DSDT Table file to include"
+	default ""
 	depends on !STANDALONE
-	default n 
 	help
 	  This option supports a custom DSDT by linking it into the kernel.
 	  See Documentation/acpi/dsdt-override.txt
 
-	  If unsure, say N.
-
-config ACPI_CUSTOM_DSDT_FILE
-	string "Custom DSDT Table file to include"
-	depends on ACPI_CUSTOM_DSDT
-	default ""
-	help
 	  Enter the full path name to the file which includes the AmlCode
 	  declaration.
 
+	  If unsure, don't enter a file name.
+
+config ACPI_CUSTOM_DSDT
+	bool
+	default ACPI_CUSTOM_DSDT_FILE != ""
+
 config ACPI_CUSTOM_DSDT_INITRD
 	bool "Read Custom DSDT from initramfs"
 	depends on BLK_DEV_INITRD
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#7 lore raw

PATCH 7/12 ACPI: acpi_pci_set_power_state() cleanups

In reply to Len Brown

From: David Brownell <[email protected]>

Minor cleanups to acpi_pci_set_power_state(): use the ACPI and PCI state symbols to make clear that a mapping is being done between PCI and ACPI states, instead of using magic numbers. For paranoia's sake, report any errors. Save five bytes (x86_64) too.

---
 drivers/pci/pci-acpi.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)
drivers/pci/pci-acpi.c +16 -8
index 4a23654..72f7476 100644
@@ -272,21 +272,29 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 {
 	acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
 	acpi_handle tmp;
-	static int state_conv[] = {
-		[0] = 0,
-		[1] = 1,
-		[2] = 2,
-		[3] = 3,
-		[4] = 3
+	static const u8 state_conv[] = {
+		[PCI_D0] = ACPI_STATE_D0,
+		[PCI_D1] = ACPI_STATE_D1,
+		[PCI_D2] = ACPI_STATE_D2,
+		[PCI_D3hot] = ACPI_STATE_D3,
+		[PCI_D3cold] = ACPI_STATE_D3
 	};
-	int acpi_state = state_conv[(int __force) state];
 
 	if (!handle)
 		return -ENODEV;
 	/* If the ACPI device has _EJ0, ignore the device */
 	if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp)))
 		return 0;
-	return acpi_bus_set_power(handle, acpi_state);
+
+	switch (state) {
+	case PCI_D0:
+	case PCI_D1:
+	case PCI_D2:
+	case PCI_D3hot:
+	case PCI_D3cold:
+		return acpi_bus_set_power(handle, state_conv[state]);
+	}
+	return -EINVAL;
 }
 
 
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#8 lore raw

PATCH 8/12 ACPI Exception (): AE_NOT_FOUND, Processor Device is not present (update)

In reply to Len Brown

From: Zhang Rui <[email protected]>

update cfaf3747ff3d431fba33f75083b7f50f58ae22ff
ACPI: ACPI Exception (): AE_NOT_FOUND, Processor Device is not present

is_processor_present is only called in the processor hotplug case, and _STA method is mandatory at this time.

We should ignore those processors that are disabled in the MADT and don't have _STA methods.
Because they will never exist in this system.
For the processors that don't physically exist but can be hot plugged later, we still need this debug info.

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

---
 drivers/acpi/processor_core.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
drivers/acpi/processor_core.c +9 -7
index a3cc8a9..d9316ab 100644
@@ -840,17 +840,19 @@ static int is_processor_present(acpi_handle handle)
 
 
 	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
-	/*
-	 * if a processor object does not have an _STA object,
-	 * OSPM assumes that the processor is present.
-	 */
-	if (status == AE_NOT_FOUND)
-		return 1;
 
 	if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT))
 		return 1;
 
-	ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
+	/*
+	 * _STA is mandatory for a processor that supports hot plug
+	 */
+	if (status == AE_NOT_FOUND)
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+				"Processor does not support hot plug\n"));
+	else
+		ACPI_EXCEPTION((AE_INFO, status,
+				"Processor Device is not present"));
 	return 0;
 }
 
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#9 lore raw

PATCH 9/12 ACPI: fix boot oops regression in thermal

In reply to Len Brown

From: Lin Ming <[email protected]>

Fix a memory overflow bug when copying NULL internal package element object to external.

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

---
 drivers/acpi/utilities/utobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/utilities/utobject.c +1 -1
index 76ee766..e08b3fa 100644
@@ -432,7 +432,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
 	 * element -- which is legal)
 	 */
 	if (!internal_object) {
-		*obj_length = 0;
+		*obj_length = sizeof(union acpi_object);
 		return_ACPI_STATUS(AE_OK);
 	}
 
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#10 lore raw

PATCH 10/12 Revert "ACPI: EC: Use proper handle for boot EC"

In reply to Len Brown

From: Len Brown <[email protected]>

This reverts commit 208c70a45624400fafd7511b96bc426bf01f8f5e.

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

---
 drivers/acpi/ec.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/acpi/ec.c +1 -5
index caf873c..7222a18 100644
@@ -943,11 +943,7 @@ int __init acpi_ec_ecdt_probe(void)
 		boot_ec->command_addr = ecdt_ptr->control.address;
 		boot_ec->data_addr = ecdt_ptr->data.address;
 		boot_ec->gpe = ecdt_ptr->gpe;
-		if (ACPI_FAILURE(acpi_get_handle(NULL, ecdt_ptr->id,
-				&boot_ec->handle))) {
-			pr_info("Failed to locate handle for boot EC\n");
-			boot_ec->handle = ACPI_ROOT_OBJECT;
-		}
+		boot_ec->handle = ACPI_ROOT_OBJECT;
 	} else {
 		/* This workaround is needed only on some broken machines,
 		 * which require early EC, but fail to provide ECDT */
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#11 lore raw

PATCH 11/12 ACPI: Fix a duplicate log level

In reply to Len Brown

From: Jean Delvare <[email protected]>

---
 drivers/acpi/osl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/osl.c +1 -1
index 8edba7b..065819b 100644
@@ -1237,7 +1237,7 @@ int acpi_check_resource_conflict(struct resource *res)
 
 	if (clash) {
 		if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) {
-			printk(KERN_INFO "%sACPI: %s resource %s [0x%llx-0x%llx]"
+			printk("%sACPI: %s resource %s [0x%llx-0x%llx]"
 			       " conflicts with ACPI region %s"
 			       " [0x%llx-0x%llx]\n",
 			       acpi_enforce_resources == ENFORCE_RESOURCES_LAX
Signature · 1 line
1.5.4.3.422.g34cd6
author reviewer
#12 lore raw

PATCH 12/12 ACPI: replace remaining __FUNCTION__ occurrences

In reply to Len Brown

From: Harvey Harrison <[email protected]>

__FUNCTION__ is gcc-specific, use __func__

---
 drivers/acpi/bus.c               |    2 +-
 drivers/acpi/scan.c              |    2 +-
 drivers/acpi/sleep/main.c        |    2 +-
 drivers/acpi/utilities/utdebug.c |    2 +-
 drivers/acpi/video.c             |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
drivers/acpi/bus.c +1 -1
index ce3c0a2..5b6760e 100644
@@ -776,7 +776,7 @@ static int __init acpi_init(void)
 
 	acpi_kobj = kobject_create_and_add("acpi", firmware_kobj);
 	if (!acpi_kobj) {
-		printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__);
+		printk(KERN_WARNING "%s: kset create error\n", __func__);
 		acpi_kobj = NULL;
 	}
 
drivers/acpi/scan.c +1 -1
index 3fac011..b26e301 100644
@@ -966,7 +966,7 @@ static void acpi_device_set_id(struct acpi_device *device,
 	case ACPI_BUS_TYPE_DEVICE:
 		status = acpi_get_object_info(handle, &buffer);
 		if (ACPI_FAILURE(status)) {
-			printk(KERN_ERR PREFIX "%s: Error reading device info\n", __FUNCTION__);
+			printk(KERN_ERR PREFIX "%s: Error reading device info\n", __func__);
 			return;
 		}
 
drivers/acpi/sleep/main.c +1 -1
index 293a1cb..d2f71a5 100644
@@ -504,7 +504,7 @@ static void acpi_power_off_prepare(void)
 static void acpi_power_off(void)
 {
 	/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
-	printk("%s called\n", __FUNCTION__);
+	printk("%s called\n", __func__);
 	local_irq_disable();
 	acpi_enable_wakeup_device(ACPI_STATE_S5);
 	acpi_enter_sleep_state(ACPI_STATE_S5);
drivers/acpi/utilities/utdebug.c +1 -1
index c7e128e..7361204 100644
@@ -109,7 +109,7 @@ void acpi_ut_track_stack_ptr(void)
  * RETURN:      Updated pointer to the function name
  *
  * DESCRIPTION: Remove the "Acpi" prefix from the function name, if present.
- *              This allows compiler macros such as __FUNCTION__ to be used
+ *              This allows compiler macros such as __func__ to be used
  *              with no change to the debug output.
  *
  ******************************************************************************/
drivers/acpi/video.c +1 -1
index 12cce69..d64a142 100644
@@ -1201,7 +1201,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset)
 	if (!video)
 		goto end;
 
-	printk(KERN_INFO PREFIX "Please implement %s\n", __FUNCTION__);
+	printk(KERN_INFO PREFIX "Please implement %s\n", __func__);
 	seq_printf(seq, "<TODO>\n");
 
       end:
Signature · 1 line
1.5.4.3.422.g34cd6
#13 lore raw
In reply to Len Brown
Quoted 2 lines · On Tuesday 11 March 2008 06:51:37 Len Brown wrote:

or you see that I missed something that is,
please let me know.

I posted a patch series two weeks ago for WMI & acer-wmi ("ACPI-WMI patches for 2.6.25-rc3") that aren't in this (three minor clean ups to acer-wmi, one real bug fix to WMI - the patch 4/4 is the critical one that needs to go upstream now).

-Carlos

Signature · 3 lines
E-Mail: [email protected]
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
#14 lore raw
In reply to Len Brown
Quoted 5 lines · Len Brown

Here is the current queue for 2.6.25-rc5

If you see anything that isn't rc5 worthy
or you see that I missed something that is,
please let me know.

Hi, len,

Please consider the patches of adding hwmon sys I/F for generic thermal driver.

thanks,
rui

#15 lore raw
Quoted 2 lines · Rui

Please consider the patches of adding hwmon sys I/F for generic thermal driver.

I second this request very, very strongly. Please do NOT let the older, non-hwmon-friendly API leak to any stable kernels.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
author reviewer
#16 lore raw
Quoted 7 lines · Henrique de Moraes Holschuh
Quoted 2 lines · Rui

Please consider the patches of adding hwmon sys I/F for generic thermal driver.

I second this request very, very strongly. Please do NOT let the older, non-hwmon-friendly API leak to any stable kernels.

my oversight -- i thought i had that in there already...

thanks,
-len