Skip to content

Commit 8631475

Browse files
committed
ACPI / processor: Avoid reserving IO regions too early
Roland Dreier reports that one of his systems cannot boot because of the changes made by commit ac212b6 (ACPI / processor: Use common hotplug infrastructure). The problematic part of it is the request_region() call in acpi_processor_get_info() that used to run at module init time before the above commit and now it runs much earlier. Unfortunately, the region(s) reserved by it fall into a range the PCI subsystem attempts to reserve for AHCI IO BARs. As a result, the PCI reservation fails and AHCI doesn't work, while previously the PCI reservation would be made before acpi_processor_get_info() and it would succeed. That request_region() call, however, was overlooked by commit ac212b6, as it is not necessary for the enumeration of the processors. It only is needed when the ACPI processor driver actually attempts to handle them which doesn't happen before loading the ACPI processor driver module. Therefore that call should have been moved from acpi_processor_get_info() into that module. Address the problem by moving the request_region() call in question out of acpi_processor_get_info() and use the observation that the region reserved by it is only needed if the FADT-based CPU throttling method is going to be used, which means that it should be sufficient to invoke it from acpi_processor_get_throttling_fadt(). Fixes: ac212b6 (ACPI / processor: Use common hotplug infrastructure) Reported-by: Roland Dreier <[email protected]> Tested-by: Roland Dreier <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1a695a9 commit 8631475

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

drivers/acpi/acpi_processor.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,6 @@ static int acpi_processor_get_info(struct acpi_device *device)
331331
pr->throttling.duty_width = acpi_gbl_FADT.duty_width;
332332

333333
pr->pblk = object.processor.pblk_address;
334-
335-
/*
336-
* We don't care about error returns - we just try to mark
337-
* these reserved so that nobody else is confused into thinking
338-
* that this region might be unused..
339-
*
340-
* (In particular, allocating the IO range for Cardbus)
341-
*/
342-
request_region(pr->throttling.address, 6, "ACPI CPU throttle");
343334
}
344335

345336
/*

drivers/acpi/processor_throttling.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,15 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr)
676676
if (!pr->flags.throttling)
677677
return -ENODEV;
678678

679+
/*
680+
* We don't care about error returns - we just try to mark
681+
* these reserved so that nobody else is confused into thinking
682+
* that this region might be unused..
683+
*
684+
* (In particular, allocating the IO range for Cardbus)
685+
*/
686+
request_region(pr->throttling.address, 6, "ACPI CPU throttle");
687+
679688
pr->throttling.state = 0;
680689

681690
duty_mask = pr->throttling.state_count - 1;

0 commit comments

Comments
 (0)