diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-06-18 12:32:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-21 13:10:02 -0400 |
commit | c75c95bb4bb656d1d2914caf17d71317941100f2 (patch) | |
tree | 019b68d8462e562ae6cc2d4016d8c88ca757090c /include/linux/acpi.h | |
parent | 5ab4a6010600c24c37f5178d6da981e18cbb090a (diff) |
ACPI / PNP: Avoid conflicting resource reservations
commit 0f1b414d190724617eb1cdd615592fa8cd9d0b50 upstream.
Commit b9a5e5e18fbf "ACPI / init: Fix the ordering of
acpi_reserve_resources()" overlooked the fact that the memory
and/or I/O regions reserved by acpi_reserve_resources() may
conflict with those reserved by the PNP "system" driver.
If that conflict actually takes place, it causes the reservations
made by the "system" driver to fail while before commit b9a5e5e18fbf
all reservations made by it and by acpi_reserve_resources() would be
successful. In turn, that allows the resources that haven't been
reserved by the "system" driver to be used by others (e.g. PCI) which
sometimes leads to functional problems (up to and including boot
failures).
To fix that issue, introduce a common resource reservation routine,
acpi_reserve_region(), to be used by both acpi_reserve_resources()
and the "system" driver, that will track all resources reserved by
it and avoid making conflicting requests.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=99831
Link: http://marc.info/?t=143389402600001&r=1&w=2
Fixes: b9a5e5e18fbf "ACPI / init: Fix the ordering of acpi_reserve_resources()"
Reported-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r-- | include/linux/acpi.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 4550be3bb63b..5da2d2e9d38e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -332,6 +332,9 @@ int acpi_check_region(resource_size_t start, resource_size_t n, | |||
332 | 332 | ||
333 | int acpi_resources_are_enforced(void); | 333 | int acpi_resources_are_enforced(void); |
334 | 334 | ||
335 | int acpi_reserve_region(u64 start, unsigned int length, u8 space_id, | ||
336 | unsigned long flags, char *desc); | ||
337 | |||
335 | #ifdef CONFIG_HIBERNATION | 338 | #ifdef CONFIG_HIBERNATION |
336 | void __init acpi_no_s4_hw_signature(void); | 339 | void __init acpi_no_s4_hw_signature(void); |
337 | #endif | 340 | #endif |
@@ -527,6 +530,13 @@ static inline int acpi_check_region(resource_size_t start, resource_size_t n, | |||
527 | return 0; | 530 | return 0; |
528 | } | 531 | } |
529 | 532 | ||
533 | static inline int acpi_reserve_region(u64 start, unsigned int length, | ||
534 | u8 space_id, unsigned long flags, | ||
535 | char *desc) | ||
536 | { | ||
537 | return -ENXIO; | ||
538 | } | ||
539 | |||
530 | struct acpi_table_header; | 540 | struct acpi_table_header; |
531 | static inline int acpi_table_parse(char *id, | 541 | static inline int acpi_table_parse(char *id, |
532 | int (*handler)(struct acpi_table_header *)) | 542 | int (*handler)(struct acpi_table_header *)) |