Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262357
b: refs/heads/master
c: 9fb0bfe
h: refs/heads/master
i:
  262355: 3939092
v: v3
  • Loading branch information
Huang Ying authored and Len Brown committed Jul 14, 2011
1 parent a4d81fe commit ef3b359
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eccddd32ced0df8f9130024157bf8d37df860d76
refs/heads/master: 9fb0bfe1408d5506b7b83d13d1eed573fd71d67d
26 changes: 26 additions & 0 deletions trunk/drivers/acpi/apei/apei-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,29 @@ struct dentry *apei_get_debugfs_dir(void)
return dapei;
}
EXPORT_SYMBOL_GPL(apei_get_debugfs_dir);

int apei_osc_setup(void)
{
static u8 whea_uuid_str[] = "ed855e0c-6c90-47bf-a62a-26de0fc5ad5c";
acpi_handle handle;
u32 capbuf[3];
struct acpi_osc_context context = {
.uuid_str = whea_uuid_str,
.rev = 1,
.cap.length = sizeof(capbuf),
.cap.pointer = capbuf,
};

capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE;
capbuf[OSC_SUPPORT_TYPE] = 0;
capbuf[OSC_CONTROL_TYPE] = 0;

if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))
|| ACPI_FAILURE(acpi_run_osc(handle, &context)))
return -EIO;
else {
kfree(context.ret.pointer);
return 0;
}
}
EXPORT_SYMBOL_GPL(apei_osc_setup);
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/apei/apei-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,6 @@ void apei_estatus_print(const char *pfx,
const struct acpi_hest_generic_status *estatus);
int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus);
int apei_estatus_check(const struct acpi_hest_generic_status *estatus);

int apei_osc_setup(void);
#endif
10 changes: 10 additions & 0 deletions trunk/drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,16 @@ static int __init ghes_init(void)
if (rc)
goto err_ioremap_exit;

rc = apei_osc_setup();
if (rc == 0 && osc_sb_apei_support_acked)
pr_info(GHES_PFX "APEI firmware first mode is enabled by APEI bit and WHEA _OSC.\n");
else if (rc == 0 && !osc_sb_apei_support_acked)
pr_info(GHES_PFX "APEI firmware first mode is enabled by WHEA _OSC.\n");
else if (rc && osc_sb_apei_support_acked)
pr_info(GHES_PFX "APEI firmware first mode is enabled by APEI bit.\n");
else
pr_info(GHES_PFX "Failed to enable APEI firmware first mode.\n");

return 0;
err_ioremap_exit:
ghes_ioremap_exit();
Expand Down

0 comments on commit ef3b359

Please sign in to comment.