Skip to contentSkip to conversation

Patch "ACPI / init: Fix the ordering of acpi_reserve_resources()" has been added to the 4.0-stable tree

PATCH [email protected] 1 participant 1 message Jun 3, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ACPI / init: Fix the ordering of acpi_reserve_resources()

to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
acpi-init-fix-the-ordering-of-acpi_reserve_resources.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b9a5e5e18fbf223502c0b2264c15024e393da928 Mon Sep 17 00:00:00 2001

From: "Rafael J. Wysocki" <[email protected]>
Date: Thu, 7 May 2015 21:19:39 +0200
Subject: ACPI / init: Fix the ordering of acpi_reserve_resources()

From: "Rafael J. Wysocki" <[email protected]>

commit b9a5e5e18fbf223502c0b2264c15024e393da928 upstream.

Since acpi_reserve_resources() is defined as a device_initcall(), there's no guarantee that it will be executed in the right order with respect to the rest of the ACPI initialization code. On some systems this leads to breakage if, for example, the address range that should be reserved for the ACPI fixed registers is given to the PCI host bridge instead if the race is won by the wrong code path.

Fix this by turning acpi_reserve_resources() into a void function and calling it directly from within the ACPI initialization sequence.

---
 drivers/acpi/osl.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/acpi/osl.c +2 -4
@@ -182,7 +182,7 @@ static void __init acpi_request_region (
 		request_mem_region(addr, length, desc);
 }
 
-static int __init acpi_reserve_resources(void)
+static void __init acpi_reserve_resources(void)
 {
 	acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length,
 		"ACPI PM1a_EVT_BLK");
@@ -211,10 +211,7 @@ static int __init acpi_reserve_resources
 	if (!(acpi_gbl_FADT.gpe1_block_length & 0x1))
 		acpi_request_region(&acpi_gbl_FADT.xgpe1_block,
 			       acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK");
-
-	return 0;
 }
-device_initcall(acpi_reserve_resources);
 
 void acpi_os_printf(const char *fmt, ...)
 {
@@ -1845,6 +1842,7 @@ acpi_status __init acpi_os_initialize(vo
 
 acpi_status __init acpi_os_initialize1(void)
 {
+	acpi_reserve_resources();
 	kacpid_wq = alloc_workqueue("kacpid", 0, 1);
 	kacpi_notify_wq = alloc_workqueue("kacpi_notify", 0, 1);
 	kacpi_hotplug_wq = alloc_ordered_workqueue("kacpi_hotplug", 0);

Patches currently in stable-queue which might be from [email protected] are

queue-4.0/acpi-init-fix-the-ordering-of-acpi_reserve_resources.patch