aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-07 05:38:53 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-14 21:11:01 -0500
commit25f98131a292f4c81e4619bdf48f00a991386f73 (patch)
tree1d44c22d18fcfd33fdd73c48647af118063a5649 /drivers
parent031f2dcd7075e218e74dd7f942ad015cf82dffab (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ata_piix.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index bb62a588f489..b406b39b878e 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -132,6 +132,7 @@ enum {
132 ich8_2port_sata, 132 ich8_2port_sata,
133 ich8m_apple_sata_ahci, /* locks up on second port enable */ 133 ich8m_apple_sata_ahci, /* locks up on second port enable */
134 tolapai_sata_ahci, 134 tolapai_sata_ahci,
135 piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */
135 136
136 /* constants for mapping table */ 137 /* constants for mapping table */
137 P0 = 0, /* port 0 */ 138 P0 = 0, /* port 0 */
@@ -165,6 +166,7 @@ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev);
165static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev); 166static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
166static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev); 167static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev);
167static int ich_pata_cable_detect(struct ata_port *ap); 168static int ich_pata_cable_detect(struct ata_port *ap);
169static u8 piix_vmw_bmdma_status(struct ata_port *ap);
168#ifdef CONFIG_PM 170#ifdef CONFIG_PM
169static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 171static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
170static int piix_pci_device_resume(struct pci_dev *pdev); 172static int piix_pci_device_resume(struct pci_dev *pdev);
@@ -175,6 +177,8 @@ static unsigned int in_module_init = 1;
175static const struct pci_device_id piix_pci_tbl[] = { 177static const struct pci_device_id piix_pci_tbl[] = {
176 /* Intel PIIX3 for the 430HX etc */ 178 /* Intel PIIX3 for the 430HX etc */
177 { 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma }, 179 { 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma },
180 /* VMware ICH4 */
181 { 0x8086, 0x7111, 0x15ad, 0x1976, 0, 0, piix_pata_vmw },
178 /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */ 182 /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */
179 /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */ 183 /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */
180 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, 184 { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
@@ -383,6 +387,38 @@ static const struct ata_port_operations piix_sata_ops = {
383 .port_start = ata_port_start, 387 .port_start = ata_port_start,
384}; 388};
385 389
390static const struct ata_port_operations piix_vmw_ops = {
391 .set_piomode = piix_set_piomode,
392 .set_dmamode = piix_set_dmamode,
393 .mode_filter = ata_pci_default_filter,
394
395 .tf_load = ata_tf_load,
396 .tf_read = ata_tf_read,
397 .check_status = ata_check_status,
398 .exec_command = ata_exec_command,
399 .dev_select = ata_std_dev_select,
400
401 .bmdma_setup = ata_bmdma_setup,
402 .bmdma_start = ata_bmdma_start,
403 .bmdma_stop = ata_bmdma_stop,
404 .bmdma_status = piix_vmw_bmdma_status,
405 .qc_prep = ata_qc_prep,
406 .qc_issue = ata_qc_issue_prot,
407 .data_xfer = ata_data_xfer,
408
409 .freeze = ata_bmdma_freeze,
410 .thaw = ata_bmdma_thaw,
411 .error_handler = piix_pata_error_handler,
412 .post_internal_cmd = ata_bmdma_post_internal_cmd,
413 .cable_detect = ata_cable_40wire,
414
415 .irq_handler = ata_interrupt,
416 .irq_clear = ata_bmdma_irq_clear,
417 .irq_on = ata_irq_on,
418
419 .port_start = ata_port_start,
420};
421
386static const struct piix_map_db ich5_map_db = { 422static const struct piix_map_db ich5_map_db = {
387 .mask = 0x7, 423 .mask = 0x7,
388 .port_enable = 0x3, 424 .port_enable = 0x3,
@@ -623,6 +659,16 @@ static struct ata_port_info piix_port_info[] = {
623 .port_ops = &piix_sata_ops, 659 .port_ops = &piix_sata_ops,
624 }, 660 },
625 661
662 [piix_pata_vmw] =
663 {
664 .sht = &piix_sht,
665 .flags = PIIX_PATA_FLAGS,
666 .pio_mask = 0x1f, /* pio0-4 */
667 .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
668 .udma_mask = ATA_UDMA_MASK_40C,
669 .port_ops = &piix_vmw_ops,
670 },
671
626}; 672};
627 673
628static struct pci_bits piix_enable_bits[] = { 674static struct pci_bits piix_enable_bits[] = {
@@ -1135,6 +1181,11 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
1135} 1181}
1136#endif 1182#endif
1137 1183
1184static u8 piix_vmw_bmdma_status(struct ata_port *ap)
1185{
1186 return ata_bmdma_status(ap) & ~ATA_DMA_ERR;
1187}
1188
1138#define AHCI_PCI_BAR 5 1189#define AHCI_PCI_BAR 5
1139#define AHCI_GLOBAL_CTL 0x04 1190#define AHCI_GLOBAL_CTL 0x04
1140#define AHCI_ENABLE (1 << 31) 1191#define AHCI_ENABLE (1 << 31)