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: sis can't do PMP
ata_piix: add TECRA M4 to broken suspend list
LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver
sata_mv: warn on PIO with multiple DRQs
sata_mv: enable async_notify for 60x1 Rev.C0 and higher
libata: don't check whether to use DMA or not for no data commands
ahci: jmb361 has only one port

+67 -16
+9 -1
drivers/ata/Kconfig
··· 651 Support for the Winbond W83759A controller on Vesa Local Bus 652 systems. 653 654 config PATA_PLATFORM 655 tristate "Generic platform device PATA support" 656 - depends on EMBEDDED || ARCH_RPC || PPC 657 help 658 This option enables support for generic directly connected ATA 659 devices commonly found on embedded systems.
··· 651 Support for the Winbond W83759A controller on Vesa Local Bus 652 systems. 653 654 + config HAVE_PATA_PLATFORM 655 + bool 656 + help 657 + This is an internal configuration node for any machine that 658 + uses pata-platform driver to enable the relevant driver in the 659 + configuration structure without having to submit endless patches 660 + to update the PATA_PLATFORM entry. 661 + 662 config PATA_PLATFORM 663 tristate "Generic platform device PATA support" 664 + depends on EMBEDDED || ARCH_RPC || PPC || HAVE_PATA_PLATFORM 665 help 666 This option enables support for generic directly connected ATA 667 devices commonly found on embedded systems.
+20 -3
drivers/ata/ahci.c
··· 90 board_ahci_mv = 4, 91 board_ahci_sb700 = 5, 92 board_ahci_mcp65 = 6, 93 94 /* global controller registers */ 95 HOST_CAP = 0x00, /* host capabilities */ ··· 402 .udma_mask = ATA_UDMA6, 403 .port_ops = &ahci_ops, 404 }, 405 }; 406 407 static const struct pci_device_id ahci_pci_tbl[] = { ··· 534 { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ 535 536 /* SiS */ 537 - { PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */ 538 - { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 966 */ 539 - { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */ 540 541 /* Marvell */ 542 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ ··· 660 dev_printk(KERN_INFO, &pdev->dev, 661 "controller can't do PMP, turning off CAP_PMP\n"); 662 cap &= ~HOST_CAP_PMP; 663 } 664 665 /*
··· 90 board_ahci_mv = 4, 91 board_ahci_sb700 = 5, 92 board_ahci_mcp65 = 6, 93 + board_ahci_nopmp = 7, 94 95 /* global controller registers */ 96 HOST_CAP = 0x00, /* host capabilities */ ··· 401 .udma_mask = ATA_UDMA6, 402 .port_ops = &ahci_ops, 403 }, 404 + /* board_ahci_nopmp */ 405 + { 406 + AHCI_HFLAGS (AHCI_HFLAG_NO_PMP), 407 + .flags = AHCI_FLAG_COMMON, 408 + .pio_mask = 0x1f, /* pio0-4 */ 409 + .udma_mask = ATA_UDMA6, 410 + .port_ops = &ahci_ops, 411 + }, 412 }; 413 414 static const struct pci_device_id ahci_pci_tbl[] = { ··· 525 { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ 526 527 /* SiS */ 528 + { PCI_VDEVICE(SI, 0x1184), board_ahci_nopmp }, /* SiS 966 */ 529 + { PCI_VDEVICE(SI, 0x1185), board_ahci_nopmp }, /* SiS 968 */ 530 + { PCI_VDEVICE(SI, 0x0186), board_ahci_nopmp }, /* SiS 968 */ 531 532 /* Marvell */ 533 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ ··· 651 dev_printk(KERN_INFO, &pdev->dev, 652 "controller can't do PMP, turning off CAP_PMP\n"); 653 cap &= ~HOST_CAP_PMP; 654 + } 655 + 656 + if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361 && 657 + port_map != 1) { 658 + dev_printk(KERN_INFO, &pdev->dev, 659 + "JMB361 has only one port, port_map 0x%x -> 0x%x\n", 660 + port_map, 1); 661 + port_map = 1; 662 } 663 664 /*
+7
drivers/ata/ata_piix.c
··· 1043 }, 1044 }, 1045 { 1046 .ident = "TECRA M5", 1047 .matches = { 1048 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
··· 1043 }, 1044 }, 1045 { 1046 + .ident = "TECRA M4", 1047 + .matches = { 1048 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 1049 + DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M4"), 1050 + }, 1051 + }, 1052 + { 1053 .ident = "TECRA M5", 1054 .matches = { 1055 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+2 -2
drivers/ata/libata-core.c
··· 4297 } 4298 4299 /** 4300 - * ata_check_atapi_dma - Check whether ATAPI DMA can be supported 4301 * @qc: Metadata associated with taskfile to check 4302 * 4303 * Allow low-level driver to filter ATA PACKET commands, returning ··· 4310 * RETURNS: 0 when ATAPI DMA can be used 4311 * nonzero otherwise 4312 */ 4313 - int ata_check_atapi_dma(struct ata_queued_cmd *qc) 4314 { 4315 struct ata_port *ap = qc->ap; 4316
··· 4297 } 4298 4299 /** 4300 + * atapi_check_dma - Check whether ATAPI DMA can be supported 4301 * @qc: Metadata associated with taskfile to check 4302 * 4303 * Allow low-level driver to filter ATA PACKET commands, returning ··· 4310 * RETURNS: 0 when ATAPI DMA can be used 4311 * nonzero otherwise 4312 */ 4313 + int atapi_check_dma(struct ata_queued_cmd *qc) 4314 { 4315 struct ata_port *ap = qc->ap; 4316
+7 -9
drivers/ata/libata-scsi.c
··· 2343 { 2344 struct scsi_cmnd *scmd = qc->scsicmd; 2345 struct ata_device *dev = qc->dev; 2346 - int using_pio = (dev->flags & ATA_DFLAG_PIO); 2347 int nodata = (scmd->sc_data_direction == DMA_NONE); 2348 unsigned int nbytes; 2349 2350 memset(qc->cdb, 0, dev->cdb_len); ··· 2362 ata_qc_set_pc_nbytes(qc); 2363 2364 /* check whether ATAPI DMA is safe */ 2365 - if (!using_pio && ata_check_atapi_dma(qc)) 2366 using_pio = 1; 2367 2368 /* Some controller variants snoop this value for Packet ··· 2402 qc->tf.lbam = (nbytes & 0xFF); 2403 qc->tf.lbah = (nbytes >> 8); 2404 2405 - if (using_pio || nodata) { 2406 - /* no data, or PIO data xfer */ 2407 - if (nodata) 2408 - qc->tf.protocol = ATAPI_PROT_NODATA; 2409 - else 2410 - qc->tf.protocol = ATAPI_PROT_PIO; 2411 - } else { 2412 /* DMA data xfer */ 2413 qc->tf.protocol = ATAPI_PROT_DMA; 2414 qc->tf.feature |= ATAPI_PKT_DMA;
··· 2343 { 2344 struct scsi_cmnd *scmd = qc->scsicmd; 2345 struct ata_device *dev = qc->dev; 2346 int nodata = (scmd->sc_data_direction == DMA_NONE); 2347 + int using_pio = !nodata && (dev->flags & ATA_DFLAG_PIO); 2348 unsigned int nbytes; 2349 2350 memset(qc->cdb, 0, dev->cdb_len); ··· 2362 ata_qc_set_pc_nbytes(qc); 2363 2364 /* check whether ATAPI DMA is safe */ 2365 + if (!nodata && !using_pio && atapi_check_dma(qc)) 2366 using_pio = 1; 2367 2368 /* Some controller variants snoop this value for Packet ··· 2402 qc->tf.lbam = (nbytes & 0xFF); 2403 qc->tf.lbah = (nbytes >> 8); 2404 2405 + if (nodata) 2406 + qc->tf.protocol = ATAPI_PROT_NODATA; 2407 + else if (using_pio) 2408 + qc->tf.protocol = ATAPI_PROT_PIO; 2409 + else { 2410 /* DMA data xfer */ 2411 qc->tf.protocol = ATAPI_PROT_DMA; 2412 qc->tf.feature |= ATAPI_PKT_DMA;
+1 -1
drivers/ata/libata.h
··· 106 extern void ata_qc_free(struct ata_queued_cmd *qc); 107 extern void ata_qc_issue(struct ata_queued_cmd *qc); 108 extern void __ata_qc_complete(struct ata_queued_cmd *qc); 109 - extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); 110 extern void swap_buf_le16(u16 *buf, unsigned int buf_words); 111 extern void ata_dev_init(struct ata_device *dev); 112 extern void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp);
··· 106 extern void ata_qc_free(struct ata_queued_cmd *qc); 107 extern void ata_qc_issue(struct ata_queued_cmd *qc); 108 extern void __ata_qc_complete(struct ata_queued_cmd *qc); 109 + extern int atapi_check_dma(struct ata_queued_cmd *qc); 110 extern void swap_buf_le16(u16 *buf, unsigned int buf_words); 111 extern void ata_dev_init(struct ata_device *dev); 112 extern void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp);
+21
drivers/ata/sata_mv.c
··· 1322 goto out_port_free_dma_mem; 1323 memset(pp->crpb, 0, MV_CRPB_Q_SZ); 1324 1325 /* 1326 * For GEN_I, there's no NCQ, so we only allocate a single sg_tbl. 1327 * For later hardware, we need one unique sg_tbl per NCQ tag. ··· 1595 1596 if ((qc->tf.protocol != ATA_PROT_DMA) && 1597 (qc->tf.protocol != ATA_PROT_NCQ)) { 1598 /* 1599 * We're about to send a non-EDMA capable command to the 1600 * port. Turn off EDMA so there won't be problems accessing
··· 1322 goto out_port_free_dma_mem; 1323 memset(pp->crpb, 0, MV_CRPB_Q_SZ); 1324 1325 + /* 6041/6081 Rev. "C0" (and newer) are okay with async notify */ 1326 + if (hpriv->hp_flags & MV_HP_ERRATA_60X1C0) 1327 + ap->flags |= ATA_FLAG_AN; 1328 /* 1329 * For GEN_I, there's no NCQ, so we only allocate a single sg_tbl. 1330 * For later hardware, we need one unique sg_tbl per NCQ tag. ··· 1592 1593 if ((qc->tf.protocol != ATA_PROT_DMA) && 1594 (qc->tf.protocol != ATA_PROT_NCQ)) { 1595 + static int limit_warnings = 10; 1596 + /* 1597 + * Errata SATA#16, SATA#24: warn if multiple DRQs expected. 1598 + * 1599 + * Someday, we might implement special polling workarounds 1600 + * for these, but it all seems rather unnecessary since we 1601 + * normally use only DMA for commands which transfer more 1602 + * than a single block of data. 1603 + * 1604 + * Much of the time, this could just work regardless. 1605 + * So for now, just log the incident, and allow the attempt. 1606 + */ 1607 + if (limit_warnings && (qc->nbytes / qc->sect_size) > 1) { 1608 + --limit_warnings; 1609 + ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME 1610 + ": attempting PIO w/multiple DRQ: " 1611 + "this may fail due to h/w errata\n"); 1612 + } 1613 /* 1614 * We're about to send a non-EDMA capable command to the 1615 * port. Turn off EDMA so there won't be problems accessing