From patchwork Sat Mar 13 19:09:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Lee X-Patchwork-Id: 47729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 0ED9AB7D6E for ; Mon, 15 Mar 2010 02:21:53 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NqpdQ-0001Q9-Hu; Sun, 14 Mar 2010 15:21:44 +0000 Received: from mail-iw0-f203.google.com ([209.85.223.203]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NqWil-0000YB-Ic for kernel-team@lists.ubuntu.com; Sat, 13 Mar 2010 19:09:59 +0000 Received: by iwn41 with SMTP id 41so2144655iwn.20 for ; Sat, 13 Mar 2010 11:09:58 -0800 (PST) Received: by 10.231.149.10 with SMTP id r10mr191331ibv.63.1268507398711; Sat, 13 Mar 2010 11:09:58 -0800 (PST) Received: from [192.168.0.22] (bas2-windsor12-1088718681.dsl.bell.ca [64.228.135.89]) by mx.google.com with ESMTPS id 21sm2168065iwn.11.2010.03.13.11.09.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 13 Mar 2010 11:09:57 -0800 (PST) Subject: Pavilion dv6 AHCI Suspend Patch From: Edward Lee To: kernel-team@lists.ubuntu.com Date: Sat, 13 Mar 2010 14:09:51 -0500 Message-ID: <1268507391.3585.4.camel@fish-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 X-Mailman-Approved-At: Sun, 14 Mar 2010 15:21:41 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Upstream patch from Tejun Heo that fixes LP#529477. Filed against Lucid/2.6.32-16 kernel upstream. diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 6bd930b..9e122ea 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -3022,6 +3022,14 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) * On HP dv[4-6] and HDX18 with earlier BIOSen, link * to the harddisk doesn't become online after * resuming from STR. Warn and fail suspend. + * + * http://bugzilla.kernel.org/show_bug.cgi?id=12276 + * + * Use dates instead of versions to match as HP is + * apparently recycling both product and version + * strings. + * + * http://bugzilla.kernel.org/show_bug.cgi?id=15462 */ { .ident = "dv4", @@ -3030,7 +3038,7 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), }, - .driver_data = "F.30", /* cutoff BIOS version */ + .driver_data = "20090105", /* F.30 */ }, { .ident = "dv5", @@ -3039,7 +3047,7 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv5 Notebook PC"), }, - .driver_data = "F.16", /* cutoff BIOS version */ + .driver_data = "20090506", /* F.16 */ }, { .ident = "dv6", @@ -3048,7 +3056,7 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"), }, - .driver_data = "F.21", /* cutoff BIOS version */ + .driver_data = "20090423", /* F.21 */ }, { .ident = "HDX18", @@ -3057,7 +3065,7 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) DMI_MATCH(DMI_PRODUCT_NAME, "HP HDX18 Notebook PC"), }, - .driver_data = "F.23", /* cutoff BIOS version */ + .driver_data = "20090430", /* F.23 */ }, /* * Acer eMachines G725 has the same problem. BIOS @@ -3065,6 +3073,8 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) * work. Inbetween, there are V1.06, V2.06 and V3.03 * that we don't have much idea about. For now, * blacklist anything older than V3.04. + * + * http://bugzilla.kernel.org/show_bug.cgi?id=15104 */ { .ident = "G725", @@ -3072,19 +3082,21 @@ static bool ahci_broken_suspend(struct pci_dev *pdev) DMI_MATCH(DMI_SYS_VENDOR, "eMachines"), DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"), }, - .driver_data = "V3.04", /* cutoff BIOS version */ + .driver_data = "20091216", /* V3.04 */ }, { } /* terminate list */ }; const struct dmi_system_id *dmi = dmi_first_match(sysids); - const char *ver; + int year, month, date; + char buf[9]; if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2)) return false; - ver = dmi_get_system_info(DMI_BIOS_VERSION); + dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); + snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); - return !ver || strcmp(ver, dmi->driver_data) < 0; + return strcmp(buf, dmi->driver_data) < 0; } static bool ahci_broken_online(struct pci_dev *pdev)