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:
sata_via: Remove redundant device ID for VIA VT8261
drivers/ata/libata: Move dereference after NULL test
ahci: Enable SB600 64bit DMA on MSI K9A2 Platinum v2

+41 -9
+35 -5
drivers/ata/ahci.c
··· 2718 }, 2719 .driver_data = "20071026", /* yyyymmdd */ 2720 }, 2721 { } 2722 }; 2723 const struct dmi_system_id *match; ··· 2753 !match) 2754 return false; 2755 2756 dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); 2757 snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); 2758 2759 - if (strcmp(buf, match->driver_data) >= 0) { 2760 - dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n", 2761 - match->ident); 2762 - return true; 2763 - } else { 2764 dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, " 2765 "forcing 32bit DMA, update BIOS\n", match->ident); 2766 return false; 2767 } 2768 } 2769 2770 static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
··· 2718 }, 2719 .driver_data = "20071026", /* yyyymmdd */ 2720 }, 2721 + /* 2722 + * All BIOS versions for the MSI K9A2 Platinum (MS-7376) 2723 + * support 64bit DMA. 2724 + * 2725 + * BIOS versions earlier than 1.5 had the Manufacturer DMI 2726 + * fields as "MICRO-STAR INTERANTIONAL CO.,LTD". 2727 + * This spelling mistake was fixed in BIOS version 1.5, so 2728 + * 1.5 and later have the Manufacturer as 2729 + * "MICRO-STAR INTERNATIONAL CO.,LTD". 2730 + * So try to match on DMI_BOARD_VENDOR of "MICRO-STAR INTER". 2731 + * 2732 + * BIOS versions earlier than 1.9 had a Board Product Name 2733 + * DMI field of "MS-7376". This was changed to be 2734 + * "K9A2 Platinum (MS-7376)" in version 1.9, but we can still 2735 + * match on DMI_BOARD_NAME of "MS-7376". 2736 + */ 2737 + { 2738 + .ident = "MSI K9A2 Platinum", 2739 + .matches = { 2740 + DMI_MATCH(DMI_BOARD_VENDOR, 2741 + "MICRO-STAR INTER"), 2742 + DMI_MATCH(DMI_BOARD_NAME, "MS-7376"), 2743 + }, 2744 + }, 2745 { } 2746 }; 2747 const struct dmi_system_id *match; ··· 2729 !match) 2730 return false; 2731 2732 + if (!match->driver_data) 2733 + goto enable_64bit; 2734 + 2735 dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); 2736 snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); 2737 2738 + if (strcmp(buf, match->driver_data) >= 0) 2739 + goto enable_64bit; 2740 + else { 2741 dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, " 2742 "forcing 32bit DMA, update BIOS\n", match->ident); 2743 return false; 2744 } 2745 + 2746 + enable_64bit: 2747 + dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n", 2748 + match->ident); 2749 + return true; 2750 } 2751 2752 static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
+6 -3
drivers/ata/libata-core.c
··· 4919 */ 4920 void ata_qc_free(struct ata_queued_cmd *qc) 4921 { 4922 - struct ata_port *ap = qc->ap; 4923 unsigned int tag; 4924 4925 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4926 4927 qc->flags = 0; 4928 tag = qc->tag; ··· 4935 4936 void __ata_qc_complete(struct ata_queued_cmd *qc) 4937 { 4938 - struct ata_port *ap = qc->ap; 4939 - struct ata_link *link = qc->dev->link; 4940 4941 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4942 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); 4943 4944 if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) 4945 ata_sg_clean(qc);
··· 4919 */ 4920 void ata_qc_free(struct ata_queued_cmd *qc) 4921 { 4922 + struct ata_port *ap; 4923 unsigned int tag; 4924 4925 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4926 + ap = qc->ap; 4927 4928 qc->flags = 0; 4929 tag = qc->tag; ··· 4934 4935 void __ata_qc_complete(struct ata_queued_cmd *qc) 4936 { 4937 + struct ata_port *ap; 4938 + struct ata_link *link; 4939 4940 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4941 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); 4942 + ap = qc->ap; 4943 + link = qc->dev->link; 4944 4945 if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) 4946 ata_sg_clean(qc);
-1
drivers/ata/sata_via.c
··· 93 { PCI_VDEVICE(VIA, 0x7372), vt6420 }, 94 { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ 95 { PCI_VDEVICE(VIA, 0x9000), vt8251 }, 96 - { PCI_VDEVICE(VIA, 0x9040), vt8251 }, 97 98 { } /* terminate list */ 99 };
··· 93 { PCI_VDEVICE(VIA, 0x7372), vt6420 }, 94 { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ 95 { PCI_VDEVICE(VIA, 0x9000), vt8251 }, 96 97 { } /* terminate list */ 98 };