aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-15 00:26:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-15 00:26:08 -0500
commit5d5d80001df3fbd06bd2b8893b6e3847e38a12d6 (patch)
tree1adceb5d74b574bb99b67dd0a7456e60f2fbd39f
parentc60ecec67ab3f6b5791ef49d502b7a61909aa13e (diff)
parentd8cf5389bd9d1f0ac9fea51796c274ba64b83d80 (diff)
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: libata: relocate sdev->manage_start_stop configuration sata_sil24: freeze on non-dev errors reported via CERR sata_sil24: fix stupid typo ata_piix: ignore ATA_DMA_ERR on vmware ich4
-rw-r--r--drivers/ata/ata_piix.c51
-rw-r--r--drivers/ata/libata-scsi.c6
-rw-r--r--drivers/ata/sata_sil24.c5
3 files changed, 58 insertions, 4 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)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 264ae60e3fd8..14daf4848f09 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -841,6 +841,9 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
841 blk_queue_max_hw_segments(q, q->max_hw_segments - 1); 841 blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
842 } 842 }
843 843
844 if (dev->class == ATA_DEV_ATA)
845 sdev->manage_start_stop = 1;
846
844 if (dev->flags & ATA_DFLAG_AN) 847 if (dev->flags & ATA_DFLAG_AN)
845 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); 848 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
846 849
@@ -872,9 +875,6 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
872 875
873 ata_scsi_sdev_config(sdev); 876 ata_scsi_sdev_config(sdev);
874 877
875 if (dev->class == ATA_DEV_ATA)
876 sdev->manage_start_stop = 1;
877
878 if (dev) 878 if (dev)
879 ata_scsi_dev_config(sdev, dev); 879 ata_scsi_dev_config(sdev, dev);
880 880
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index b4c674d83769..864c1c1b8511 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -301,7 +301,7 @@ static struct sil24_cerr_info {
301 [PORT_CERR_PKT_PROT] = { AC_ERR_HSM, ATA_EH_SOFTRESET, 301 [PORT_CERR_PKT_PROT] = { AC_ERR_HSM, ATA_EH_SOFTRESET,
302 "invalid data directon for ATAPI CDB" }, 302 "invalid data directon for ATAPI CDB" },
303 [PORT_CERR_SGT_BOUNDARY] = { AC_ERR_SYSTEM, ATA_EH_SOFTRESET, 303 [PORT_CERR_SGT_BOUNDARY] = { AC_ERR_SYSTEM, ATA_EH_SOFTRESET,
304 "SGT no on qword boundary" }, 304 "SGT not on qword boundary" },
305 [PORT_CERR_SGT_TGTABRT] = { AC_ERR_HOST_BUS, ATA_EH_SOFTRESET, 305 [PORT_CERR_SGT_TGTABRT] = { AC_ERR_HOST_BUS, ATA_EH_SOFTRESET,
306 "PCI target abort while fetching SGT" }, 306 "PCI target abort while fetching SGT" },
307 [PORT_CERR_SGT_MSTABRT] = { AC_ERR_HOST_BUS, ATA_EH_SOFTRESET, 307 [PORT_CERR_SGT_MSTABRT] = { AC_ERR_HOST_BUS, ATA_EH_SOFTRESET,
@@ -1094,10 +1094,13 @@ static void sil24_error_intr(struct ata_port *ap)
1094 if (ci && ci->desc) { 1094 if (ci && ci->desc) {
1095 err_mask |= ci->err_mask; 1095 err_mask |= ci->err_mask;
1096 action |= ci->action; 1096 action |= ci->action;
1097 if (action & ATA_EH_RESET_MASK)
1098 freeze = 1;
1097 ata_ehi_push_desc(ehi, "%s", ci->desc); 1099 ata_ehi_push_desc(ehi, "%s", ci->desc);
1098 } else { 1100 } else {
1099 err_mask |= AC_ERR_OTHER; 1101 err_mask |= AC_ERR_OTHER;
1100 action |= ATA_EH_SOFTRESET; 1102 action |= ATA_EH_SOFTRESET;
1103 freeze = 1;
1101 ata_ehi_push_desc(ehi, "unknown command error %d", 1104 ata_ehi_push_desc(ehi, "unknown command error %d",
1102 cerr); 1105 cerr);
1103 } 1106 }