Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
ahci: pp->active_link is not reliable when FBS is enabled
ahci: use BIOS date in broken_suspend list
ahci: add missing nv IDs

+52 -14
+52 -14
drivers/ata/ahci.c
··· 641 { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci_yesncq }, /* MCP67 */ 642 { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci_yesncq }, /* MCP67 */ 643 { PCI_VDEVICE(NVIDIA, 0x0580), board_ahci_yesncq }, /* Linux ID */ 644 { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci_yesncq }, /* MCP73 */ 645 { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci_yesncq }, /* MCP73 */ 646 { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci_yesncq }, /* MCP73 */ ··· 2278 struct ahci_port_priv *pp = ap->private_data; 2279 struct ahci_host_priv *hpriv = ap->host->private_data; 2280 int resetting = !!(ap->pflags & ATA_PFLAG_RESETTING); 2281 - u32 status, qc_active; 2282 int rc; 2283 2284 status = readl(port_mmio + PORT_IRQ_STAT); ··· 2336 } 2337 } 2338 2339 - /* pp->active_link is valid iff any command is in flight */ 2340 - if (ap->qc_active && pp->active_link->sactive) 2341 - qc_active = readl(port_mmio + PORT_SCR_ACT); 2342 - else 2343 - qc_active = readl(port_mmio + PORT_CMD_ISSUE); 2344 2345 rc = ata_qc_complete_multiple(ap, qc_active); 2346 ··· 3048 * On HP dv[4-6] and HDX18 with earlier BIOSen, link 3049 * to the harddisk doesn't become online after 3050 * resuming from STR. Warn and fail suspend. 3051 */ 3052 { 3053 .ident = "dv4", ··· 3064 DMI_MATCH(DMI_PRODUCT_NAME, 3065 "HP Pavilion dv4 Notebook PC"), 3066 }, 3067 - .driver_data = "F.30", /* cutoff BIOS version */ 3068 }, 3069 { 3070 .ident = "dv5", ··· 3073 DMI_MATCH(DMI_PRODUCT_NAME, 3074 "HP Pavilion dv5 Notebook PC"), 3075 }, 3076 - .driver_data = "F.16", /* cutoff BIOS version */ 3077 }, 3078 { 3079 .ident = "dv6", ··· 3082 DMI_MATCH(DMI_PRODUCT_NAME, 3083 "HP Pavilion dv6 Notebook PC"), 3084 }, 3085 - .driver_data = "F.21", /* cutoff BIOS version */ 3086 }, 3087 { 3088 .ident = "HDX18", ··· 3091 DMI_MATCH(DMI_PRODUCT_NAME, 3092 "HP HDX18 Notebook PC"), 3093 }, 3094 - .driver_data = "F.23", /* cutoff BIOS version */ 3095 }, 3096 /* 3097 * Acer eMachines G725 has the same problem. BIOS ··· 3099 * work. Inbetween, there are V1.06, V2.06 and V3.03 3100 * that we don't have much idea about. For now, 3101 * blacklist anything older than V3.04. 3102 */ 3103 { 3104 .ident = "G725", ··· 3108 DMI_MATCH(DMI_SYS_VENDOR, "eMachines"), 3109 DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"), 3110 }, 3111 - .driver_data = "V3.04", /* cutoff BIOS version */ 3112 }, 3113 { } /* terminate list */ 3114 }; 3115 const struct dmi_system_id *dmi = dmi_first_match(sysids); 3116 - const char *ver; 3117 3118 if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2)) 3119 return false; 3120 3121 - ver = dmi_get_system_info(DMI_BIOS_VERSION); 3122 3123 - return !ver || strcmp(ver, dmi->driver_data) < 0; 3124 } 3125 3126 static bool ahci_broken_online(struct pci_dev *pdev)
··· 641 { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci_yesncq }, /* MCP67 */ 642 { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci_yesncq }, /* MCP67 */ 643 { PCI_VDEVICE(NVIDIA, 0x0580), board_ahci_yesncq }, /* Linux ID */ 644 + { PCI_VDEVICE(NVIDIA, 0x0581), board_ahci_yesncq }, /* Linux ID */ 645 + { PCI_VDEVICE(NVIDIA, 0x0582), board_ahci_yesncq }, /* Linux ID */ 646 + { PCI_VDEVICE(NVIDIA, 0x0583), board_ahci_yesncq }, /* Linux ID */ 647 + { PCI_VDEVICE(NVIDIA, 0x0584), board_ahci_yesncq }, /* Linux ID */ 648 + { PCI_VDEVICE(NVIDIA, 0x0585), board_ahci_yesncq }, /* Linux ID */ 649 + { PCI_VDEVICE(NVIDIA, 0x0586), board_ahci_yesncq }, /* Linux ID */ 650 + { PCI_VDEVICE(NVIDIA, 0x0587), board_ahci_yesncq }, /* Linux ID */ 651 + { PCI_VDEVICE(NVIDIA, 0x0588), board_ahci_yesncq }, /* Linux ID */ 652 + { PCI_VDEVICE(NVIDIA, 0x0589), board_ahci_yesncq }, /* Linux ID */ 653 + { PCI_VDEVICE(NVIDIA, 0x058a), board_ahci_yesncq }, /* Linux ID */ 654 + { PCI_VDEVICE(NVIDIA, 0x058b), board_ahci_yesncq }, /* Linux ID */ 655 + { PCI_VDEVICE(NVIDIA, 0x058c), board_ahci_yesncq }, /* Linux ID */ 656 + { PCI_VDEVICE(NVIDIA, 0x058d), board_ahci_yesncq }, /* Linux ID */ 657 + { PCI_VDEVICE(NVIDIA, 0x058e), board_ahci_yesncq }, /* Linux ID */ 658 + { PCI_VDEVICE(NVIDIA, 0x058f), board_ahci_yesncq }, /* Linux ID */ 659 { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci_yesncq }, /* MCP73 */ 660 { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci_yesncq }, /* MCP73 */ 661 { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci_yesncq }, /* MCP73 */ ··· 2263 struct ahci_port_priv *pp = ap->private_data; 2264 struct ahci_host_priv *hpriv = ap->host->private_data; 2265 int resetting = !!(ap->pflags & ATA_PFLAG_RESETTING); 2266 + u32 status, qc_active = 0; 2267 int rc; 2268 2269 status = readl(port_mmio + PORT_IRQ_STAT); ··· 2321 } 2322 } 2323 2324 + /* pp->active_link is not reliable once FBS is enabled, both 2325 + * PORT_SCR_ACT and PORT_CMD_ISSUE should be checked because 2326 + * NCQ and non-NCQ commands may be in flight at the same time. 2327 + */ 2328 + if (pp->fbs_enabled) { 2329 + if (ap->qc_active) { 2330 + qc_active = readl(port_mmio + PORT_SCR_ACT); 2331 + qc_active |= readl(port_mmio + PORT_CMD_ISSUE); 2332 + } 2333 + } else { 2334 + /* pp->active_link is valid iff any command is in flight */ 2335 + if (ap->qc_active && pp->active_link->sactive) 2336 + qc_active = readl(port_mmio + PORT_SCR_ACT); 2337 + else 2338 + qc_active = readl(port_mmio + PORT_CMD_ISSUE); 2339 + } 2340 2341 rc = ata_qc_complete_multiple(ap, qc_active); 2342 ··· 3022 * On HP dv[4-6] and HDX18 with earlier BIOSen, link 3023 * to the harddisk doesn't become online after 3024 * resuming from STR. Warn and fail suspend. 3025 + * 3026 + * http://bugzilla.kernel.org/show_bug.cgi?id=12276 3027 + * 3028 + * Use dates instead of versions to match as HP is 3029 + * apparently recycling both product and version 3030 + * strings. 3031 + * 3032 + * http://bugzilla.kernel.org/show_bug.cgi?id=15462 3033 */ 3034 { 3035 .ident = "dv4", ··· 3030 DMI_MATCH(DMI_PRODUCT_NAME, 3031 "HP Pavilion dv4 Notebook PC"), 3032 }, 3033 + .driver_data = "20090105", /* F.30 */ 3034 }, 3035 { 3036 .ident = "dv5", ··· 3039 DMI_MATCH(DMI_PRODUCT_NAME, 3040 "HP Pavilion dv5 Notebook PC"), 3041 }, 3042 + .driver_data = "20090506", /* F.16 */ 3043 }, 3044 { 3045 .ident = "dv6", ··· 3048 DMI_MATCH(DMI_PRODUCT_NAME, 3049 "HP Pavilion dv6 Notebook PC"), 3050 }, 3051 + .driver_data = "20090423", /* F.21 */ 3052 }, 3053 { 3054 .ident = "HDX18", ··· 3057 DMI_MATCH(DMI_PRODUCT_NAME, 3058 "HP HDX18 Notebook PC"), 3059 }, 3060 + .driver_data = "20090430", /* F.23 */ 3061 }, 3062 /* 3063 * Acer eMachines G725 has the same problem. BIOS ··· 3065 * work. Inbetween, there are V1.06, V2.06 and V3.03 3066 * that we don't have much idea about. For now, 3067 * blacklist anything older than V3.04. 3068 + * 3069 + * http://bugzilla.kernel.org/show_bug.cgi?id=15104 3070 */ 3071 { 3072 .ident = "G725", ··· 3072 DMI_MATCH(DMI_SYS_VENDOR, "eMachines"), 3073 DMI_MATCH(DMI_PRODUCT_NAME, "eMachines G725"), 3074 }, 3075 + .driver_data = "20091216", /* V3.04 */ 3076 }, 3077 { } /* terminate list */ 3078 }; 3079 const struct dmi_system_id *dmi = dmi_first_match(sysids); 3080 + int year, month, date; 3081 + char buf[9]; 3082 3083 if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2)) 3084 return false; 3085 3086 + dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); 3087 + snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); 3088 3089 + return strcmp(buf, dmi->driver_data) < 0; 3090 } 3091 3092 static bool ahci_broken_online(struct pci_dev *pdev)