History

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.

Tejun Heo committed 19 years ago

Commit b2a8bbe1 parent 0291f953 files · +11 −5Browse files

Unified · Split

3 files
  1. drivers/ata/libata-sff.c +8 −4
  2. drivers/ata/sata_uli.c +2 −1
  3. include/linux/libata.h +1 −0
drivers/ata/libata-sff.c+8−4
@@ -870,7 +870,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int · 869 unmodified lines
870870 pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS;
871871 bmdma = pci_resource_start(pdev, 4);
872872 if (bmdma) {
873− if (inb(bmdma + 2) & 0x80)
873+ if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
874+ (inb(bmdma + 2) & 0x80))
874875 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
875876 probe_ent->port[p].bmdma_addr = bmdma;
876877 }
@@ -886,7 +887,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int · 9 unmodified lines
886887 bmdma = pci_resource_start(pdev, 4);
887888 if (bmdma) {
888889 bmdma += 8;
889− if(inb(bmdma + 2) & 0x80)
890+ if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) &&
891+ (inb(bmdma + 2) & 0x80))
890892 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
891893 probe_ent->port[p].bmdma_addr = bmdma;
892894 }
@@ -920,7 +922,8 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, · 27 unmodified lines
920922 probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL;
921923 if (bmdma) {
922924 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))
924927 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
925928 }
926929 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, · 10 unmodified lines
937940 probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL;
938941 if (bmdma) {
939942 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))
941945 probe_ent->_host_flags |= ATA_HOST_SIMPLEX;
942946 }
943947 ata_std_ports(&probe_ent->port[1]);
drivers/ata/sata_uli.c+2−1
@@ -128,7 +128,8 @@ static const struct ata_port_operations uli_ops = { · 127 unmodified lines
128128
129129 static struct ata_port_info uli_port_info = {
130130 .sht = &uli_sht,
131− .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
131+ .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
132+ ATA_FLAG_IGN_SIMPLEX,
132133 .pio_mask = 0x1f, /* pio0-4 */
133134 .udma_mask = 0x7f, /* udma0-6 */
134135 .port_ops = &uli_ops,
include/linux/libata.h+1−0
@@ -177,6 +177,7 @@ enum { · 176 unmodified lines
177177 * Register FIS clearing BSY */
178178 ATA_FLAG_DEBUGMSG = (1 << 13),
179179 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
180+ ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
180181
181182 /* The following flag belongs to ap->pflags but is kept in
182183 * ap->flags because it's referenced in many LLDs and will be