mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
ACPI / PNP: Reserve ACPI resources at the fs_initcall_sync stage
This effectively reverts the following three commits:7bc10388cc
ACPI / resources: free memory on error in add_region_before()0f1b414d19
ACPI / PNP: Avoid conflicting resource reservationsb9a5e5e18f
ACPI / init: Fix the ordering of acpi_reserve_resources() (commitb9a5e5e18f
introduced regressions some of which, but not all, were addressed by commit0f1b414d19
and commit7bc10388cc
was a fixup on top of the latter) and causes ACPI fixed hardware resources to be reserved at the fs_initcall_sync stage of system initialization. The story is as follows. First, a boot regression was reported due to an apparent resource reservation ordering change after a commit that shouldn't lead to such changes. Investigation led to the conclusion that the problem happened because acpi_reserve_resources() was executed at the device_initcall() stage of system initialization which wasn't strictly ordered with respect to driver initialization (and with respect to the initialization of the pcieport driver in particular), so a random change causing the device initcalls to be run in a different order might break things. The response to that was to attempt to run acpi_reserve_resources() as soon as we knew that ACPI would be in use (commitb9a5e5e18f
). However, that turned out to be too early, because it caused resource reservations made by the PNP system driver to fail on at least one system and that failure was addressed by commit0f1b414d19
. That fix still turned out to be insufficient, though, because calling acpi_reserve_resources() before the fs_initcall stage of system initialization caused a boot regression to happen on the eCAFE EC-800-H20G/S netbook. That meant that we only could call acpi_reserve_resources() at the fs_initcall initialization stage or later, but then we might just as well call it after the PNP initalization in which case commit0f1b414d19
wouldn't be necessary any more. For this reason, the changes made by commit0f1b414d19
are reverted (along with a memory leak fixup on top of that commit), the changes made by commitb9a5e5e18f
that went too far are reverted too and acpi_reserve_resources() is changed into fs_initcall_sync, which will cause it to be executed after the PNP subsystem initialization (which is an fs_initcall) and before device initcalls (including the pcieport driver initialization) which should avoid the initial issue. Link: https://bugzilla.kernel.org/show_bug.cgi?id=100581 Link: http://marc.info/?t=143092384600002&r=1&w=2 Link: https://bugzilla.kernel.org/show_bug.cgi?id=99831 Link: http://marc.info/?t=143389402600001&r=1&w=2 Fixes:b9a5e5e18f
"ACPI / init: Fix the ordering of acpi_reserve_resources()" Reported-by: Roland Dreier <roland@purestorage.com> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
d770e558e2
commit
0294112ee3
4 changed files with 18 additions and 201 deletions
|
@ -309,9 +309,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
|
|||
|
||||
int acpi_resources_are_enforced(void);
|
||||
|
||||
int acpi_reserve_region(u64 start, unsigned int length, u8 space_id,
|
||||
unsigned long flags, char *desc);
|
||||
|
||||
#ifdef CONFIG_HIBERNATION
|
||||
void __init acpi_no_s4_hw_signature(void);
|
||||
#endif
|
||||
|
@ -507,13 +504,6 @@ static inline int acpi_check_region(resource_size_t start, resource_size_t n,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int acpi_reserve_region(u64 start, unsigned int length,
|
||||
u8 space_id, unsigned long flags,
|
||||
char *desc)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
struct acpi_table_header;
|
||||
static inline int acpi_table_parse(char *id,
|
||||
int (*handler)(struct acpi_table_header *))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue