Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286485
b: refs/heads/master
c: 4134b8c
h: refs/heads/master
i:
  286483: 86894d4
v: v3
  • Loading branch information
Huang Ying authored and Len Brown committed Jan 17, 2012
1 parent 80bd3c7 commit 93fa267
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b54ac6d2a25084667da781c7ca2cebef52a2bcdd
refs/heads/master: 4134b8c8811f23aa8a281db50dcee64dda414736
29 changes: 28 additions & 1 deletion trunk/drivers/acpi/apei/apei-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,19 @@ int apei_resources_sub(struct apei_resources *resources1,
}
EXPORT_SYMBOL_GPL(apei_resources_sub);

static int apei_get_nvs_callback(__u64 start, __u64 size, void *data)
{
struct apei_resources *resources = data;
return apei_res_add(&resources->iomem, start, size);
}

static int apei_get_nvs_resources(struct apei_resources *resources)
{
return acpi_nvs_for_each_region(apei_get_nvs_callback, resources);
}

/*
* IO memory/port rersource management mechanism is used to check
* IO memory/port resource management mechanism is used to check
* whether memory/port area used by GARs conflicts with normal memory
* or IO memory/port of devices.
*/
Expand All @@ -459,12 +470,26 @@ int apei_resources_request(struct apei_resources *resources,
{
struct apei_res *res, *res_bak = NULL;
struct resource *r;
struct apei_resources nvs_resources;
int rc;

rc = apei_resources_sub(resources, &apei_resources_all);
if (rc)
return rc;

/*
* Some firmware uses ACPI NVS region, that has been marked as
* busy, so exclude it from APEI resources to avoid false
* conflict.
*/
apei_resources_init(&nvs_resources);
rc = apei_get_nvs_resources(&nvs_resources);
if (rc)
goto res_fini;
rc = apei_resources_sub(resources, &nvs_resources);
if (rc)
goto res_fini;

rc = -EINVAL;
list_for_each_entry(res, &resources->iomem, list) {
r = request_mem_region(res->start, res->end - res->start,
Expand Down Expand Up @@ -511,6 +536,8 @@ int apei_resources_request(struct apei_resources *resources,
break;
release_mem_region(res->start, res->end - res->start);
}
res_fini:
apei_resources_fini(&nvs_resources);
return rc;
}
EXPORT_SYMBOL_GPL(apei_resources_request);
Expand Down

0 comments on commit 93fa267

Please sign in to comment.