diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-07-29 17:18:45 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-07-29 17:18:45 -0700 |
commit | 2f82dda4a9bf41e64e864889bf06564bdf826e25 (patch) | |
tree | 118a7b483ae5de4dbf83d20001302f1404866ef0 /wmi-survive-bios-with-duplicate-guids.patch | |
parent | 64ba2e5ffde5f2418eb26c700cb0ab62b04e5013 (diff) | |
download | dom0-kernel-2f82dda4a9bf41e64e864889bf06564bdf826e25.tar.gz dom0-kernel-2f82dda4a9bf41e64e864889bf06564bdf826e25.tar.xz dom0-kernel-2f82dda4a9bf41e64e864889bf06564bdf826e25.zip |
initial srpm import
Diffstat (limited to 'wmi-survive-bios-with-duplicate-guids.patch')
-rw-r--r-- | wmi-survive-bios-with-duplicate-guids.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/wmi-survive-bios-with-duplicate-guids.patch b/wmi-survive-bios-with-duplicate-guids.patch new file mode 100644 index 0000000..15c7be3 --- /dev/null +++ b/wmi-survive-bios-with-duplicate-guids.patch @@ -0,0 +1,76 @@ +From: Carlos Corbacho <carlos@strangeworlds.co.uk> +Date: Sat, 26 Dec 2009 19:14:59 +0000 (+0000) +Subject: ACPI: WMI: Survive BIOS with duplicate GUIDs +X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=d1f9e4970742bb1e22d07b01bd44f9c357d25c42 + +ACPI: WMI: Survive BIOS with duplicate GUIDs + +It would appear that in BIOS's with nVidia hooks, the GUID +05901221-D566-11D1-B2F0-00A0C9062910 is duplicated. For now, the simplest +solution is to just ignore any duplicate GUIDs. These particular hooks are not +currently supported/ used in the kernel, so whoever does that can figure out +what the 'right' solution should be (if there's a better one). + +http://bugzilla.kernel.org/show_bug.cgi?id=14846 + +Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk> +Reported-by: Larry Finger <Larry.Finger@lwfinger.net> +Reported-by: Oldřich Jedlička <oldium.pro@seznam.cz> +Signed-off-by: Len Brown <len.brown@intel.com> +--- + +diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c +index cc9ad74..b104302 100644 +--- a/drivers/platform/x86/wmi.c ++++ b/drivers/platform/x86/wmi.c +@@ -714,6 +714,22 @@ static int wmi_class_init(void) + return ret; + } + ++static bool guid_already_parsed(const char *guid_string) ++{ ++ struct guid_block *gblock; ++ struct wmi_block *wblock; ++ struct list_head *p; ++ ++ list_for_each(p, &wmi_blocks.list) { ++ wblock = list_entry(p, struct wmi_block, list); ++ gblock = &wblock->gblock; ++ ++ if (strncmp(gblock->guid, guid_string, 16) == 0) ++ return true; ++ } ++ return false; ++} ++ + /* + * Parse the _WDG method for the GUID data blocks + */ +@@ -723,6 +739,7 @@ static __init acpi_status parse_wdg(acpi_handle handle) + union acpi_object *obj; + struct guid_block *gblock; + struct wmi_block *wblock; ++ char guid_string[37]; + acpi_status status; + u32 i, total; + +@@ -745,6 +762,19 @@ static __init acpi_status parse_wdg(acpi_handle handle) + memcpy(gblock, obj->buffer.pointer, obj->buffer.length); + + for (i = 0; i < total; i++) { ++ /* ++ Some WMI devices, like those for nVidia hooks, have a ++ duplicate GUID. It's not clear what we should do in this ++ case yet, so for now, we'll just ignore the duplicate. ++ Anyone who wants to add support for that device can come ++ up with a better workaround for the mess then. ++ */ ++ if (guid_already_parsed(gblock[i].guid) == true) { ++ wmi_gtoa(gblock[i].guid, guid_string); ++ printk(KERN_INFO PREFIX "Skipping duplicate GUID %s\n", ++ guid_string); ++ continue; ++ } + wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); + if (!wblock) + return AE_NO_MEMORY; |