diff options
author | Tejun Heo <htejun@gmail.com> | 2007-01-25 05:40:05 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-01-25 17:26:01 -0500 |
commit | b2a8bbe67d73631c71492fd60b757fc50a87f182 (patch) | |
tree | b6a04a5ce8eee52a18fc690a9a1e1f7c1f93ded2 /drivers/ata/libata-sff.c | |
parent | 0291f95fdb5fcd91cc077aafabea2c5b109fa8a8 (diff) |
libata: implement ATA_FLAG_IGN_SIMPLEX and use it in sata_uli
Some uli controllers have stuck SIMPLEX bit which can't be cleared
with ata_pci_clear_simplex(), but the controller is capable of doing
DMAs on both channels simultaneously. Implement ATA_FLAG_IGN_SIMPLEX
which makes libata ignore the simplex bit and use it in sata_uli.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r-- | drivers/ata/libata-sff.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 623cec914c9b..114fa81deb83 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -870,7 +870,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; | 870 | pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; |
871 | bmdma = pci_resource_start(pdev, 4); | 871 | bmdma = pci_resource_start(pdev, 4); |
872 | if (bmdma) { | 872 | if (bmdma) { |
873 | if (inb(bmdma + 2) & 0x80) | 873 | if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
874 | (inb(bmdma + 2) & 0x80)) | ||
874 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 875 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
875 | probe_ent->port[p].bmdma_addr = bmdma; | 876 | probe_ent->port[p].bmdma_addr = bmdma; |
876 | } | 877 | } |
@@ -886,7 +887,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int | |||
886 | bmdma = pci_resource_start(pdev, 4); | 887 | bmdma = pci_resource_start(pdev, 4); |
887 | if (bmdma) { | 888 | if (bmdma) { |
888 | bmdma += 8; | 889 | bmdma += 8; |
889 | if(inb(bmdma + 2) & 0x80) | 890 | if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
891 | (inb(bmdma + 2) & 0x80)) | ||
890 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 892 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
891 | probe_ent->port[p].bmdma_addr = bmdma; | 893 | probe_ent->port[p].bmdma_addr = bmdma; |
892 | } | 894 | } |
@@ -920,7 +922,8 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, | |||
920 | probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; | 922 | probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; |
921 | if (bmdma) { | 923 | if (bmdma) { |
922 | probe_ent->port[0].bmdma_addr = bmdma; | 924 | probe_ent->port[0].bmdma_addr = bmdma; |
923 | if (inb(bmdma + 2) & 0x80) | 925 | if ((!(port[0]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
926 | (inb(bmdma + 2) & 0x80)) | ||
924 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 927 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
925 | } | 928 | } |
926 | ata_std_ports(&probe_ent->port[0]); | 929 | ata_std_ports(&probe_ent->port[0]); |
@@ -937,7 +940,8 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, | |||
937 | probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; | 940 | probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; |
938 | if (bmdma) { | 941 | if (bmdma) { |
939 | probe_ent->port[1].bmdma_addr = bmdma + 8; | 942 | probe_ent->port[1].bmdma_addr = bmdma + 8; |
940 | if (inb(bmdma + 10) & 0x80) | 943 | if ((!(port[1]->flags & ATA_FLAG_IGN_SIMPLEX)) && |
944 | (inb(bmdma + 10) & 0x80)) | ||
941 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; | 945 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
942 | } | 946 | } |
943 | ata_std_ports(&probe_ent->port[1]); | 947 | ata_std_ports(&probe_ent->port[1]); |