aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 623cec914c9b..12c88c588039 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -827,7 +827,8 @@ void ata_bmdma_error_handler(struct ata_port *ap)
827 */ 827 */
828void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc) 828void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc)
829{ 829{
830 ata_bmdma_stop(qc); 830 if (qc->ap->ioaddr.bmdma_addr)
831 ata_bmdma_stop(qc);
831} 832}
832 833
833#ifdef CONFIG_PCI 834#ifdef CONFIG_PCI
@@ -870,7 +871,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
870 pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; 871 pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS;
871 bmdma = pci_resource_start(pdev, 4); 872 bmdma = pci_resource_start(pdev, 4);
872 if (bmdma) { 873 if (bmdma) {
873 if (inb(bmdma + 2) & 0x80) 874 if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
875 (inb(bmdma + 2) & 0x80))
874 probe_ent->_host_flags |= ATA_HOST_SIMPLEX; 876 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
875 probe_ent->port[p].bmdma_addr = bmdma; 877 probe_ent->port[p].bmdma_addr = bmdma;
876 } 878 }
@@ -886,7 +888,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int
886 bmdma = pci_resource_start(pdev, 4); 888 bmdma = pci_resource_start(pdev, 4);
887 if (bmdma) { 889 if (bmdma) {
888 bmdma += 8; 890 bmdma += 8;
889 if(inb(bmdma + 2) & 0x80) 891 if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
892 (inb(bmdma + 2) & 0x80))
890 probe_ent->_host_flags |= ATA_HOST_SIMPLEX; 893 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
891 probe_ent->port[p].bmdma_addr = bmdma; 894 probe_ent->port[p].bmdma_addr = bmdma;
892 } 895 }
@@ -914,13 +917,14 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev,
914 probe_ent->irq_flags = IRQF_SHARED; 917 probe_ent->irq_flags = IRQF_SHARED;
915 918
916 if (port_mask & ATA_PORT_PRIMARY) { 919 if (port_mask & ATA_PORT_PRIMARY) {
917 probe_ent->irq = ATA_PRIMARY_IRQ; 920 probe_ent->irq = ATA_PRIMARY_IRQ(pdev);
918 probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD; 921 probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD;
919 probe_ent->port[0].altstatus_addr = 922 probe_ent->port[0].altstatus_addr =
920 probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; 923 probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL;
921 if (bmdma) { 924 if (bmdma) {
922 probe_ent->port[0].bmdma_addr = bmdma; 925 probe_ent->port[0].bmdma_addr = bmdma;
923 if (inb(bmdma + 2) & 0x80) 926 if ((!(port[0]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
927 (inb(bmdma + 2) & 0x80))
924 probe_ent->_host_flags |= ATA_HOST_SIMPLEX; 928 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
925 } 929 }
926 ata_std_ports(&probe_ent->port[0]); 930 ata_std_ports(&probe_ent->port[0]);
@@ -929,15 +933,16 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev,
929 933
930 if (port_mask & ATA_PORT_SECONDARY) { 934 if (port_mask & ATA_PORT_SECONDARY) {
931 if (probe_ent->irq) 935 if (probe_ent->irq)
932 probe_ent->irq2 = ATA_SECONDARY_IRQ; 936 probe_ent->irq2 = ATA_SECONDARY_IRQ(pdev);
933 else 937 else
934 probe_ent->irq = ATA_SECONDARY_IRQ; 938 probe_ent->irq = ATA_SECONDARY_IRQ(pdev);
935 probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD; 939 probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD;
936 probe_ent->port[1].altstatus_addr = 940 probe_ent->port[1].altstatus_addr =
937 probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; 941 probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL;
938 if (bmdma) { 942 if (bmdma) {
939 probe_ent->port[1].bmdma_addr = bmdma + 8; 943 probe_ent->port[1].bmdma_addr = bmdma + 8;
940 if (inb(bmdma + 10) & 0x80) 944 if ((!(port[1]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
945 (inb(bmdma + 10) & 0x80))
941 probe_ent->_host_flags |= ATA_HOST_SIMPLEX; 946 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
942 } 947 }
943 ata_std_ports(&probe_ent->port[1]); 948 ata_std_ports(&probe_ent->port[1]);