diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-02 18:45:22 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-02 18:45:22 -0500 |
commit | 0cb3b79efabd4174ddeee40c2c1e5499ba67e067 (patch) | |
tree | 38ef0d5e38240589bac8c7d752295cdbd556742e | |
parent | 43e31e40473a00c936ffb9c2eebedc0566c92e89 (diff) | |
parent | 41139ac3cd76c6dff8286102a8ac62933c680463 (diff) |
Merge branch 'acpi-apei'
* acpi-apei:
ACPI: APEI: Fix BERT resources conflict with ACPI NVS area
-rw-r--r-- | drivers/acpi/apei/bert.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/acpi/apei/bert.c b/drivers/acpi/apei/bert.c index a05b5c0cf181..12771fcf0417 100644 --- a/drivers/acpi/apei/bert.c +++ b/drivers/acpi/apei/bert.c | |||
@@ -97,6 +97,7 @@ static int __init bert_check_table(struct acpi_table_bert *bert_tab) | |||
97 | 97 | ||
98 | static int __init bert_init(void) | 98 | static int __init bert_init(void) |
99 | { | 99 | { |
100 | struct apei_resources bert_resources; | ||
100 | struct acpi_bert_region *boot_error_region; | 101 | struct acpi_bert_region *boot_error_region; |
101 | struct acpi_table_bert *bert_tab; | 102 | struct acpi_table_bert *bert_tab; |
102 | unsigned int region_len; | 103 | unsigned int region_len; |
@@ -127,13 +128,14 @@ static int __init bert_init(void) | |||
127 | } | 128 | } |
128 | 129 | ||
129 | region_len = bert_tab->region_length; | 130 | region_len = bert_tab->region_length; |
130 | if (!request_mem_region(bert_tab->address, region_len, "APEI BERT")) { | 131 | apei_resources_init(&bert_resources); |
131 | pr_err("Can't request iomem region <%016llx-%016llx>.\n", | 132 | rc = apei_resources_add(&bert_resources, bert_tab->address, |
132 | (unsigned long long)bert_tab->address, | 133 | region_len, true); |
133 | (unsigned long long)bert_tab->address + region_len - 1); | 134 | if (rc) |
134 | return -EIO; | 135 | return rc; |
135 | } | 136 | rc = apei_resources_request(&bert_resources, "APEI BERT"); |
136 | 137 | if (rc) | |
138 | goto out_fini; | ||
137 | boot_error_region = ioremap_cache(bert_tab->address, region_len); | 139 | boot_error_region = ioremap_cache(bert_tab->address, region_len); |
138 | if (boot_error_region) { | 140 | if (boot_error_region) { |
139 | bert_print_all(boot_error_region, region_len); | 141 | bert_print_all(boot_error_region, region_len); |
@@ -142,7 +144,9 @@ static int __init bert_init(void) | |||
142 | rc = -ENOMEM; | 144 | rc = -ENOMEM; |
143 | } | 145 | } |
144 | 146 | ||
145 | release_mem_region(bert_tab->address, region_len); | 147 | apei_resources_release(&bert_resources); |
148 | out_fini: | ||
149 | apei_resources_fini(&bert_resources); | ||
146 | 150 | ||
147 | return rc; | 151 | return rc; |
148 | } | 152 | } |