From 18ffafaac49ee2f23a4986653b5f24f18341218d Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Tue, 10 Jun 2008 14:16:47 +0800 Subject: [PATCH] --- yaml --- r: 102018 b: refs/heads/master c: d0e184abc5983281ef189db2c759d65d56eb1b80 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/resources/rscreate.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d4b3ff9c4c84..a39ff5b58e69 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b25d2a470bc9ffef4c34248952d914bd6fc0fcf6 +refs/heads/master: d0e184abc5983281ef189db2c759d65d56eb1b80 diff --git a/trunk/drivers/acpi/resources/rscreate.c b/trunk/drivers/acpi/resources/rscreate.c index faddaee1bc07..70c84ece87f1 100644 --- a/trunk/drivers/acpi/resources/rscreate.c +++ b/trunk/drivers/acpi/resources/rscreate.c @@ -284,6 +284,23 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, } } + /* + * If the BIOS has erroneously reversed the _PRT source_name (index 2) + * and the source_index (index 3), fix it. _PRT is important enough to + * workaround this BIOS error. This also provides compatibility with + * other ACPI implementations. + */ + obj_desc = sub_object_list[3]; + if (!obj_desc + || (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER)) { + sub_object_list[3] = sub_object_list[2]; + sub_object_list[2] = obj_desc; + + ACPI_WARNING((AE_INFO, + "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed", + index)); + } + /* * 3) Third subobject: Dereference the PRT.source_name * The name may be unresolved (slack mode), so allow a null object