]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.drivers / libata-ata_piix-borked-tecra-m4-broken-suspend
diff --git a/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend b/src/patches/suse-2.6.27.31/patches.drivers/libata-ata_piix-borked-tecra-m4-broken-suspend
new file mode 100644 (file)
index 0000000..e3000a7
--- /dev/null
@@ -0,0 +1,54 @@
+From: Tejun Heo <tj@kernel.org>
+Subject: ata_piix: add borked Tecra M4 to broken suspend list
+References: bnc#398270
+
+Tecra M4 sometimes forget what it is and reports bogus data via DMI
+which makes the machine evade broken suspend matching and thus fail
+suspend/resume.  This patch updates piix_broken_suspend() such that it
+can match such case.  As the borked DMI data is a bit generic,
+matching many entries to make the match more specific is necessary.
+As the usual DMI matching is limited to four entries, this patch uses
+hard coded manual matching.
+
+This is reported by Alexandru Romanescu.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
+Signed-off-by: Tejun Heo <teheo@suse.de>
+---
+ drivers/ata/ata_piix.c |   22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+Index: linux-2.6.27/drivers/ata/ata_piix.c
+===================================================================
+--- linux-2.6.27.orig/drivers/ata/ata_piix.c
++++ linux-2.6.27/drivers/ata/ata_piix.c
+@@ -1119,6 +1119,28 @@ static int piix_broken_suspend(void)
+               if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL))
+                       return 1;
++      /* TECRA M4 sometimes forgets its identify and reports bogus
++       * DMI information.  As the bogus information is a bit
++       * generic, match as many entries as possible.  This manual
++       * matching is necessary because dmi_system_id.matches is
++       * limited to four entries.
++       */
++      if (dmi_get_system_info(DMI_SYS_VENDOR) &&
++          dmi_get_system_info(DMI_PRODUCT_NAME) &&
++          dmi_get_system_info(DMI_PRODUCT_VERSION) &&
++          dmi_get_system_info(DMI_PRODUCT_SERIAL) &&
++          dmi_get_system_info(DMI_BOARD_VENDOR) &&
++          dmi_get_system_info(DMI_BOARD_NAME) &&
++          dmi_get_system_info(DMI_BOARD_VERSION) &&
++          !strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
++          !strcmp(dmi_get_system_info(DMI_PRODUCT_NAME), "000000") &&
++          !strcmp(dmi_get_system_info(DMI_PRODUCT_VERSION), "000000") &&
++          !strcmp(dmi_get_system_info(DMI_PRODUCT_SERIAL), "000000") &&
++          !strcmp(dmi_get_system_info(DMI_BOARD_VENDOR), "TOSHIBA") &&
++          !strcmp(dmi_get_system_info(DMI_BOARD_NAME), "Portable PC") &&
++          !strcmp(dmi_get_system_info(DMI_BOARD_VERSION), "Version A0"))
++              return 1;
++
+       return 0;
+ }