]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.33.2/ahci-use-bios-date-in-broken_suspend-list.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.33.2 / ahci-use-bios-date-in-broken_suspend-list.patch
CommitLineData
52edb3f3
GKH
1From 9deb343189b3cf45e84dd08480f330575ffe2004 Mon Sep 17 00:00:00 2001
2From: Tejun Heo <tj@kernel.org>
3Date: Tue, 16 Mar 2010 09:50:26 +0900
4Subject: ahci: use BIOS date in broken_suspend list
5
6From: Tejun Heo <tj@kernel.org>
7
8commit 9deb343189b3cf45e84dd08480f330575ffe2004 upstream.
9
10HP is recycling both DMI_PRODUCT_NAME and DMI_BIOS_VERSION making
11ahci_broken_suspend() trigger for later products which are not
12affected by the original problems. Match BIOS date instead of version
13and add references to bko's so that full information can be found
14easier later.
15
16This fixes http://bugzilla.kernel.org/show_bug.cgi?id=15462
17
18Signed-off-by: Tejun Heo <tj@kernel.org>
19Reported-by: tigerfishdaisy@gmail.com
20Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23---
24 drivers/ata/ahci.c | 28 ++++++++++++++++++++--------
25 1 file changed, 20 insertions(+), 8 deletions(-)
26
27--- a/drivers/ata/ahci.c
28+++ b/drivers/ata/ahci.c
29@@ -2831,6 +2831,14 @@ static bool ahci_broken_suspend(struct p
30 * On HP dv[4-6] and HDX18 with earlier BIOSen, link
31 * to the harddisk doesn't become online after
32 * resuming from STR. Warn and fail suspend.
33+ *
34+ * http://bugzilla.kernel.org/show_bug.cgi?id=12276
35+ *
36+ * Use dates instead of versions to match as HP is
37+ * apparently recycling both product and version
38+ * strings.
39+ *
40+ * http://bugzilla.kernel.org/show_bug.cgi?id=15462
41 */
42 {
43 .ident = "dv4",
44@@ -2839,7 +2847,7 @@ static bool ahci_broken_suspend(struct p
45 DMI_MATCH(DMI_PRODUCT_NAME,
46 "HP Pavilion dv4 Notebook PC"),
47 },
48- .driver_data = "F.30", /* cutoff BIOS version */
49+ .driver_data = "20090105", /* F.30 */
50 },
51 {
52 .ident = "dv5",
53@@ -2848,7 +2856,7 @@ static bool ahci_broken_suspend(struct p
54 DMI_MATCH(DMI_PRODUCT_NAME,
55 "HP Pavilion dv5 Notebook PC"),
56 },
57- .driver_data = "F.16", /* cutoff BIOS version */
58+ .driver_data = "20090506", /* F.16 */
59 },
60 {
61 .ident = "dv6",
62@@ -2857,7 +2865,7 @@ static bool ahci_broken_suspend(struct p
63 DMI_MATCH(DMI_PRODUCT_NAME,
64 "HP Pavilion dv6 Notebook PC"),
65 },
66- .driver_data = "F.21", /* cutoff BIOS version */
67+ .driver_data = "20090423", /* F.21 */
68 },
69 {
70 .ident = "HDX18",
71@@ -2866,7 +2874,7 @@ static bool ahci_broken_suspend(struct p
72 DMI_MATCH(DMI_PRODUCT_NAME,
73 "HP HDX18 Notebook PC"),
74 },
75- .driver_data = "F.23", /* cutoff BIOS version */
76+ .driver_data = "20090430", /* F.23 */
77 },
78 /*
79 * Acer eMachines G725 has the same problem. BIOS
80@@ -2874,6 +2882,8 @@ static bool ahci_broken_suspend(struct p
81 * work. Inbetween, there are V1.06, V2.06 and V3.03
82 * that we don't have much idea about. For now,
83 * blacklist anything older than V3.04.
84+ *
85+ * http://bugzilla.kernel.org/show_bug.cgi?id=15104
86 */
87 {
88 .ident = "G725",
89@@ -2881,19 +2891,21 @@ static bool ahci_broken_suspend(struct p
90 DMI_MATCH(DMI_SYS_VENDOR, "eMachines"),
91 DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"),
92 },
93- .driver_data = "V3.04", /* cutoff BIOS version */
94+ .driver_data = "20091216", /* V3.04 */
95 },
96 { } /* terminate list */
97 };
98 const struct dmi_system_id *dmi = dmi_first_match(sysids);
99- const char *ver;
100+ int year, month, date;
101+ char buf[9];
102
103 if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2))
104 return false;
105
106- ver = dmi_get_system_info(DMI_BIOS_VERSION);
107+ dmi_get_date(DMI_BIOS_DATE, &year, &month, &date);
108+ snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date);
109
110- return !ver || strcmp(ver, dmi->driver_data) < 0;
111+ return strcmp(buf, dmi->driver_data) < 0;
112 }
113
114 static bool ahci_broken_online(struct pci_dev *pdev)