Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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:
ata_generic: implement ATA_GEN_* flags and force enable DMA on MBP 7,1
ahci,ata_generic: let ata_generic handle new MBP w/ MCP89
libahci: Fix bug in storing EM messages

+38 -8
+10
drivers/ata/ahci.c
··· 1053 1053 if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable) 1054 1054 return -ENODEV; 1055 1055 1056 + /* 1057 + * For some reason, MCP89 on MacBook 7,1 doesn't work with 1058 + * ahci, use ata_generic instead. 1059 + */ 1060 + if (pdev->vendor == PCI_VENDOR_ID_NVIDIA && 1061 + pdev->device == PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA && 1062 + pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE && 1063 + pdev->subsystem_device == 0xcb89) 1064 + return -ENODEV; 1065 + 1056 1066 /* Promise's PDC42819 is a SAS/SATA controller that has an AHCI mode. 1057 1067 * At the moment, we can only use the AHCI mode. Let the users know 1058 1068 * that for SAS drives they're out of luck.
+24 -6
drivers/ata/ata_generic.c
··· 32 32 * A generic parallel ATA driver using libata 33 33 */ 34 34 35 + enum { 36 + ATA_GEN_CLASS_MATCH = (1 << 0), 37 + ATA_GEN_FORCE_DMA = (1 << 1), 38 + }; 39 + 35 40 /** 36 41 * generic_set_mode - mode setting 37 42 * @link: link to set up ··· 51 46 static int generic_set_mode(struct ata_link *link, struct ata_device **unused) 52 47 { 53 48 struct ata_port *ap = link->ap; 49 + const struct pci_device_id *id = ap->host->private_data; 54 50 int dma_enabled = 0; 55 51 struct ata_device *dev; 56 52 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 57 53 58 - /* Bits 5 and 6 indicate if DMA is active on master/slave */ 59 - if (ap->ioaddr.bmdma_addr) 54 + if (id->driver_data & ATA_GEN_FORCE_DMA) { 55 + dma_enabled = 0xff; 56 + } else if (ap->ioaddr.bmdma_addr) { 57 + /* Bits 5 and 6 indicate if DMA is active on master/slave */ 60 58 dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); 59 + } 61 60 62 61 if (pdev->vendor == PCI_VENDOR_ID_CENATEK) 63 62 dma_enabled = 0xFF; ··· 135 126 const struct ata_port_info *ppi[] = { &info, NULL }; 136 127 137 128 /* Don't use the generic entry unless instructed to do so */ 138 - if (id->driver_data == 1 && all_generic_ide == 0) 129 + if ((id->driver_data & ATA_GEN_CLASS_MATCH) && all_generic_ide == 0) 139 130 return -ENODEV; 140 131 141 132 /* Devices that need care */ ··· 164 155 return rc; 165 156 pcim_pin_device(dev); 166 157 } 167 - return ata_pci_bmdma_init_one(dev, ppi, &generic_sht, NULL, 0); 158 + return ata_pci_bmdma_init_one(dev, ppi, &generic_sht, (void *)id, 0); 168 159 } 169 160 170 161 static struct pci_device_id ata_generic[] = { ··· 176 167 { PCI_DEVICE(PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE), }, 177 168 { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561), }, 178 169 { PCI_DEVICE(PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558), }, 179 - { PCI_DEVICE(PCI_VENDOR_ID_CENATEK,PCI_DEVICE_ID_CENATEK_IDE), }, 170 + { PCI_DEVICE(PCI_VENDOR_ID_CENATEK,PCI_DEVICE_ID_CENATEK_IDE), 171 + .driver_data = ATA_GEN_FORCE_DMA }, 172 + /* 173 + * For some reason, MCP89 on MacBook 7,1 doesn't work with 174 + * ahci, use ata_generic instead. 175 + */ 176 + { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA, 177 + PCI_VENDOR_ID_APPLE, 0xcb89, 178 + .driver_data = ATA_GEN_FORCE_DMA }, 180 179 #if !defined(CONFIG_PATA_TOSHIBA) && !defined(CONFIG_PATA_TOSHIBA_MODULE) 181 180 { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), }, 182 181 { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), }, ··· 192 175 { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_5), }, 193 176 #endif 194 177 /* Must come last. If you add entries adjust this table appropriately */ 195 - { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 1}, 178 + { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL), 179 + .driver_data = ATA_GEN_CLASS_MATCH }, 196 180 { 0, }, 197 181 }; 198 182
+3 -2
drivers/ata/libahci.c
··· 324 324 struct ahci_host_priv *hpriv = ap->host->private_data; 325 325 void __iomem *mmio = hpriv->mmio; 326 326 void __iomem *em_mmio = mmio + hpriv->em_loc; 327 + const unsigned char *msg_buf = buf; 327 328 u32 em_ctl, msg; 328 329 unsigned long flags; 329 330 int i; ··· 344 343 } 345 344 346 345 for (i = 0; i < size; i += 4) { 347 - msg = buf[i] | buf[i + 1] << 8 | 348 - buf[i + 2] << 16 | buf[i + 3] << 24; 346 + msg = msg_buf[i] | msg_buf[i + 1] << 8 | 347 + msg_buf[i + 2] << 16 | msg_buf[i + 3] << 24; 349 348 writel(msg, em_mmio + i); 350 349 } 351 350
+1
include/linux/pci_ids.h
··· 1261 1261 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 1262 1262 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_SMBUS 0x07D8 1263 1263 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP79_SMBUS 0x0AA2 1264 + #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA 0x0D85 1264 1265 1265 1266 #define PCI_VENDOR_ID_IMS 0x10e0 1266 1267 #define PCI_DEVICE_ID_IMS_TT128 0x9128