ata_piix: ignore ATA_DMA_ERR on vmware ich4

VMware ich4 emulation incorrectly sets DMA_ERR on TF error. Ignore
it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Tejun Heo and committed by Jeff Garzik 25f98131 031f2dcd

+51
+51
drivers/ata/ata_piix.c
··· 132 132 ich8_2port_sata, 133 133 ich8m_apple_sata_ahci, /* locks up on second port enable */ 134 134 tolapai_sata_ahci, 135 + piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ 135 136 136 137 /* constants for mapping table */ 137 138 P0 = 0, /* port 0 */ ··· 166 165 static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev); 167 166 static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev); 168 167 static int ich_pata_cable_detect(struct ata_port *ap); 168 + static u8 piix_vmw_bmdma_status(struct ata_port *ap); 169 169 #ifdef CONFIG_PM 170 170 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 171 171 static int piix_pci_device_resume(struct pci_dev *pdev); ··· 177 175 static const struct pci_device_id piix_pci_tbl[] = { 178 176 /* Intel PIIX3 for the 430HX etc */ 179 177 { 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma }, 178 + /* VMware ICH4 */ 179 + { 0x8086, 0x7111, 0x15ad, 0x1976, 0, 0, piix_pata_vmw }, 180 180 /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */ 181 181 /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */ 182 182 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, ··· 379 375 .thaw = ata_bmdma_thaw, 380 376 .error_handler = ata_bmdma_error_handler, 381 377 .post_internal_cmd = ata_bmdma_post_internal_cmd, 378 + 379 + .irq_handler = ata_interrupt, 380 + .irq_clear = ata_bmdma_irq_clear, 381 + .irq_on = ata_irq_on, 382 + 383 + .port_start = ata_port_start, 384 + }; 385 + 386 + static const struct ata_port_operations piix_vmw_ops = { 387 + .set_piomode = piix_set_piomode, 388 + .set_dmamode = piix_set_dmamode, 389 + .mode_filter = ata_pci_default_filter, 390 + 391 + .tf_load = ata_tf_load, 392 + .tf_read = ata_tf_read, 393 + .check_status = ata_check_status, 394 + .exec_command = ata_exec_command, 395 + .dev_select = ata_std_dev_select, 396 + 397 + .bmdma_setup = ata_bmdma_setup, 398 + .bmdma_start = ata_bmdma_start, 399 + .bmdma_stop = ata_bmdma_stop, 400 + .bmdma_status = piix_vmw_bmdma_status, 401 + .qc_prep = ata_qc_prep, 402 + .qc_issue = ata_qc_issue_prot, 403 + .data_xfer = ata_data_xfer, 404 + 405 + .freeze = ata_bmdma_freeze, 406 + .thaw = ata_bmdma_thaw, 407 + .error_handler = piix_pata_error_handler, 408 + .post_internal_cmd = ata_bmdma_post_internal_cmd, 409 + .cable_detect = ata_cable_40wire, 382 410 383 411 .irq_handler = ata_interrupt, 384 412 .irq_clear = ata_bmdma_irq_clear, ··· 657 621 .mwdma_mask = 0x07, /* mwdma0-2 */ 658 622 .udma_mask = ATA_UDMA6, 659 623 .port_ops = &piix_sata_ops, 624 + }, 625 + 626 + [piix_pata_vmw] = 627 + { 628 + .sht = &piix_sht, 629 + .flags = PIIX_PATA_FLAGS, 630 + .pio_mask = 0x1f, /* pio0-4 */ 631 + .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ 632 + .udma_mask = ATA_UDMA_MASK_40C, 633 + .port_ops = &piix_vmw_ops, 660 634 }, 661 635 662 636 }; ··· 1180 1134 return rc; 1181 1135 } 1182 1136 #endif 1137 + 1138 + static u8 piix_vmw_bmdma_status(struct ata_port *ap) 1139 + { 1140 + return ata_bmdma_status(ap) & ~ATA_DMA_ERR; 1141 + } 1183 1142 1184 1143 #define AHCI_PCI_BAR 5 1185 1144 #define AHCI_GLOBAL_CTL 0x04