Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
[PATCH] sata_mv: three bug fixes
[PATCH] libata: ata_dev_init_params() fixes
[PATCH] libata: Fix interesting use of "extern" and also some bracketing
[PATCH] libata: Simplex and other mode filtering logic
[PATCH] libata - ATA is both ATA and CFA
[PATCH] libata: Add ->set_mode hook for odd drivers
[PATCH] libata: BMDMA handling updates
[PATCH] libata: kill trailing whitespace
[PATCH] libata: add FIXME above ata_dev_xfermask()
[PATCH] libata: cosmetic changes in ata_bus_softreset()
[PATCH] libata: kill E.D.D.

+164 -129
+43 -4
Documentation/DocBook/libata.tmpl
··· 120 120 <programlisting> 121 121 void (*set_piomode) (struct ata_port *, struct ata_device *); 122 122 void (*set_dmamode) (struct ata_port *, struct ata_device *); 123 - void (*post_set_mode) (struct ata_port *ap); 123 + void (*post_set_mode) (struct ata_port *); 124 + unsigned int (*mode_filter) (struct ata_port *, struct ata_device *, unsigned int); 124 125 </programlisting> 125 126 126 127 <para> 127 128 Hooks called prior to the issue of SET FEATURES - XFER MODE 128 - command. dev->pio_mode is guaranteed to be valid when 129 - ->set_piomode() is called, and dev->dma_mode is guaranteed to be 130 - valid when ->set_dmamode() is called. ->post_set_mode() is 129 + command. The optional ->mode_filter() hook is called when libata 130 + has built a mask of the possible modes. This is passed to the 131 + ->mode_filter() function which should return a mask of valid modes 132 + after filtering those unsuitable due to hardware limits. It is not 133 + valid to use this interface to add modes. 134 + </para> 135 + <para> 136 + dev->pio_mode and dev->dma_mode are guaranteed to be valid when 137 + ->set_piomode() and when ->set_dmamode() is called. The timings for 138 + any other drive sharing the cable will also be valid at this point. 139 + That is the library records the decisions for the modes of each 140 + drive on a channel before it attempts to set any of them. 141 + </para> 142 + <para> 143 + ->post_set_mode() is 131 144 called unconditionally, after the SET FEATURES - XFER MODE 132 145 command completes successfully. 133 146 </para> ··· 240 227 support second drives on a port (such as SATA contollers) will 241 228 use ata_noop_dev_select(). 242 229 </para> 230 + 231 + </sect2> 232 + 233 + <sect2><title>Private tuning method</title> 234 + <programlisting> 235 + void (*set_mode) (struct ata_port *ap); 236 + </programlisting> 237 + 238 + <para> 239 + By default libata performs drive and controller tuning in 240 + accordance with the ATA timing rules and also applies blacklists 241 + and cable limits. Some controllers need special handling and have 242 + custom tuning rules, typically raid controllers that use ATA 243 + commands but do not actually do drive timing. 244 + </para> 245 + 246 + <warning> 247 + <para> 248 + This hook should not be used to replace the standard controller 249 + tuning logic when a controller has quirks. Replacing the default 250 + tuning logic in that case would bypass handling for drive and 251 + bridge quirks that may be important to data reliability. If a 252 + controller needs to filter the mode selection it should use the 253 + mode_filter hook instead. 254 + </para> 255 + </warning> 243 256 244 257 </sect2> 245 258
+22 -4
drivers/scsi/libata-bmdma.c
··· 703 703 struct ata_probe_ent *probe_ent = 704 704 ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]); 705 705 int p = 0; 706 + unsigned long bmdma; 706 707 707 708 if (!probe_ent) 708 709 return NULL; ··· 717 716 probe_ent->port[p].altstatus_addr = 718 717 probe_ent->port[p].ctl_addr = 719 718 pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; 720 - probe_ent->port[p].bmdma_addr = pci_resource_start(pdev, 4); 719 + bmdma = pci_resource_start(pdev, 4); 720 + if (bmdma) { 721 + if (inb(bmdma + 2) & 0x80) 722 + probe_ent->host_set_flags |= ATA_HOST_SIMPLEX; 723 + probe_ent->port[p].bmdma_addr = bmdma; 724 + } 721 725 ata_std_ports(&probe_ent->port[p]); 722 726 p++; 723 727 } ··· 732 726 probe_ent->port[p].altstatus_addr = 733 727 probe_ent->port[p].ctl_addr = 734 728 pci_resource_start(pdev, 3) | ATA_PCI_CTL_OFS; 735 - probe_ent->port[p].bmdma_addr = pci_resource_start(pdev, 4) + 8; 729 + bmdma = pci_resource_start(pdev, 4); 730 + if (bmdma) { 731 + bmdma += 8; 732 + if(inb(bmdma + 2) & 0x80) 733 + probe_ent->host_set_flags |= ATA_HOST_SIMPLEX; 734 + probe_ent->port[p].bmdma_addr = bmdma; 735 + } 736 736 ata_std_ports(&probe_ent->port[p]); 737 737 p++; 738 738 } ··· 752 740 struct ata_port_info *port, int port_num) 753 741 { 754 742 struct ata_probe_ent *probe_ent; 743 + unsigned long bmdma; 755 744 756 745 probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port); 757 746 if (!probe_ent) ··· 779 766 break; 780 767 } 781 768 782 - probe_ent->port[0].bmdma_addr = 783 - pci_resource_start(pdev, 4) + 8 * port_num; 769 + bmdma = pci_resource_start(pdev, 4); 770 + if (bmdma != 0) { 771 + bmdma += 8 * port_num; 772 + probe_ent->port[0].bmdma_addr = bmdma; 773 + if (inb(bmdma + 2) & 0x80) 774 + probe_ent->host_set_flags |= ATA_HOST_SIMPLEX; 775 + } 784 776 ata_std_ports(&probe_ent->port[0]); 785 777 786 778 return probe_ent;
+66 -102
drivers/scsi/libata-core.c
··· 62 62 #include "libata.h" 63 63 64 64 static unsigned int ata_dev_init_params(struct ata_port *ap, 65 - struct ata_device *dev); 65 + struct ata_device *dev, 66 + u16 heads, 67 + u16 sectors); 66 68 static void ata_set_mode(struct ata_port *ap); 67 69 static unsigned int ata_dev_set_xfermode(struct ata_port *ap, 68 70 struct ata_device *dev); ··· 1083 1081 * 1084 1082 * Read ID data from the specified device. ATA_CMD_ID_ATA is 1085 1083 * performed on ATA devices and ATA_CMD_ID_ATAPI on ATAPI 1086 - * devices. This function also takes care of EDD signature 1087 - * misreporting (to be removed once EDD support is gone) and 1088 - * issues ATA_CMD_INIT_DEV_PARAMS for pre-ATA4 drives. 1084 + * devices. This function also issues ATA_CMD_INIT_DEV_PARAMS 1085 + * for pre-ATA4 drives. 1089 1086 * 1090 1087 * LOCKING: 1091 1088 * Kernel thread context (may sleep) ··· 1096 1095 unsigned int *p_class, int post_reset, u16 **p_id) 1097 1096 { 1098 1097 unsigned int class = *p_class; 1099 - unsigned int using_edd; 1100 1098 struct ata_taskfile tf; 1101 1099 unsigned int err_mask = 0; 1102 1100 u16 *id; ··· 1103 1103 int rc; 1104 1104 1105 1105 DPRINTK("ENTER, host %u, dev %u\n", ap->id, dev->devno); 1106 - 1107 - if (ap->ops->probe_reset || 1108 - ap->flags & (ATA_FLAG_SRST | ATA_FLAG_SATA_RESET)) 1109 - using_edd = 0; 1110 - else 1111 - using_edd = 1; 1112 1106 1113 1107 ata_dev_select(ap, dev->devno, 1, 1); /* select device 0/1 */ 1114 1108 ··· 1133 1139 1134 1140 err_mask = ata_exec_internal(ap, dev, &tf, DMA_FROM_DEVICE, 1135 1141 id, sizeof(id[0]) * ATA_ID_WORDS); 1136 - 1137 1142 if (err_mask) { 1138 1143 rc = -EIO; 1139 1144 reason = "I/O error"; 1140 - 1141 - if (err_mask & ~AC_ERR_DEV) 1142 - goto err_out; 1143 - 1144 - /* 1145 - * arg! EDD works for all test cases, but seems to return 1146 - * the ATA signature for some ATAPI devices. Until the 1147 - * reason for this is found and fixed, we fix up the mess 1148 - * here. If IDENTIFY DEVICE returns command aborted 1149 - * (as ATAPI devices do), then we issue an 1150 - * IDENTIFY PACKET DEVICE. 1151 - * 1152 - * ATA software reset (SRST, the default) does not appear 1153 - * to have this problem. 1154 - */ 1155 - if ((using_edd) && (class == ATA_DEV_ATA)) { 1156 - u8 err = tf.feature; 1157 - if (err & ATA_ABORTED) { 1158 - class = ATA_DEV_ATAPI; 1159 - goto retry; 1160 - } 1161 - } 1162 1145 goto err_out; 1163 1146 } 1164 1147 1165 1148 swap_buf_le16(id, ATA_ID_WORDS); 1166 1149 1167 1150 /* sanity check */ 1168 - if ((class == ATA_DEV_ATA) != ata_id_is_ata(id)) { 1151 + if ((class == ATA_DEV_ATA) != (ata_id_is_ata(id) | ata_id_is_cfa(id))) { 1169 1152 rc = -EINVAL; 1170 1153 reason = "device reports illegal type"; 1171 1154 goto err_out; ··· 1158 1187 * Some drives were very specific about that exact sequence. 1159 1188 */ 1160 1189 if (ata_id_major_version(id) < 4 || !ata_id_has_lba(id)) { 1161 - err_mask = ata_dev_init_params(ap, dev); 1190 + err_mask = ata_dev_init_params(ap, dev, id[3], id[6]); 1162 1191 if (err_mask) { 1163 1192 rc = -EIO; 1164 1193 reason = "INIT_DEV_PARAMS failed"; ··· 1411 1440 if (!found) 1412 1441 goto err_out_disable; 1413 1442 1414 - ata_set_mode(ap); 1443 + if (ap->ops->set_mode) 1444 + ap->ops->set_mode(ap); 1445 + else 1446 + ata_set_mode(ap); 1447 + 1415 1448 if (ap->flags & ATA_FLAG_PORT_DISABLED) 1416 1449 goto err_out_disable; 1417 1450 ··· 1820 1845 */ 1821 1846 static void ata_set_mode(struct ata_port *ap) 1822 1847 { 1823 - int i, rc; 1848 + int i, rc, used_dma = 0; 1824 1849 1825 1850 /* step 1: calculate xfer_mask */ 1826 1851 for (i = 0; i < ATA_MAX_DEVICES; i++) { ··· 1838 1863 dma_mask = ata_pack_xfermask(0, dev->mwdma_mask, dev->udma_mask); 1839 1864 dev->pio_mode = ata_xfer_mask2mode(pio_mask); 1840 1865 dev->dma_mode = ata_xfer_mask2mode(dma_mask); 1866 + 1867 + if (dev->dma_mode) 1868 + used_dma = 1; 1841 1869 } 1842 1870 1843 1871 /* step 2: always set host PIO timings */ ··· 1862 1884 goto err_out; 1863 1885 } 1864 1886 1887 + /* 1888 + * Record simplex status. If we selected DMA then the other 1889 + * host channels are not permitted to do so. 1890 + */ 1891 + 1892 + if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX)) 1893 + ap->host_set->simplex_claimed = 1; 1894 + 1895 + /* 1896 + * Chip specific finalisation 1897 + */ 1865 1898 if (ap->ops->post_set_mode) 1866 1899 ap->ops->post_set_mode(ap); 1867 1900 ··· 1994 2005 ap->ops->dev_select(ap, 0); 1995 2006 } 1996 2007 1997 - /** 1998 - * ata_bus_edd - Issue EXECUTE DEVICE DIAGNOSTIC command. 1999 - * @ap: Port to reset and probe 2000 - * 2001 - * Use the EXECUTE DEVICE DIAGNOSTIC command to reset and 2002 - * probe the bus. Not often used these days. 2003 - * 2004 - * LOCKING: 2005 - * PCI/etc. bus probe sem. 2006 - * Obtains host_set lock. 2007 - * 2008 - */ 2009 - 2010 - static unsigned int ata_bus_edd(struct ata_port *ap) 2011 - { 2012 - struct ata_taskfile tf; 2013 - unsigned long flags; 2014 - 2015 - /* set up execute-device-diag (bus reset) taskfile */ 2016 - /* also, take interrupts to a known state (disabled) */ 2017 - DPRINTK("execute-device-diag\n"); 2018 - ata_tf_init(ap, &tf, 0); 2019 - tf.ctl |= ATA_NIEN; 2020 - tf.command = ATA_CMD_EDD; 2021 - tf.protocol = ATA_PROT_NODATA; 2022 - 2023 - /* do bus reset */ 2024 - spin_lock_irqsave(&ap->host_set->lock, flags); 2025 - ata_tf_to_host(ap, &tf); 2026 - spin_unlock_irqrestore(&ap->host_set->lock, flags); 2027 - 2028 - /* spec says at least 2ms. but who knows with those 2029 - * crazy ATAPI devices... 2030 - */ 2031 - msleep(150); 2032 - 2033 - return ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 2034 - } 2035 - 2036 2008 static unsigned int ata_bus_softreset(struct ata_port *ap, 2037 2009 unsigned int devmask) 2038 2010 { ··· 2028 2078 */ 2029 2079 msleep(150); 2030 2080 2031 - 2032 2081 /* Before we perform post reset processing we want to see if 2033 - the bus shows 0xFF because the odd clown forgets the D7 pulldown 2034 - resistor */ 2035 - 2082 + * the bus shows 0xFF because the odd clown forgets the D7 2083 + * pulldown resistor. 2084 + */ 2036 2085 if (ata_check_status(ap) == 0xFF) 2037 - return 1; /* Positive is failure for some reason */ 2086 + return AC_ERR_OTHER; 2038 2087 2039 2088 ata_bus_post_reset(ap, devmask); 2040 2089 ··· 2065 2116 struct ata_ioports *ioaddr = &ap->ioaddr; 2066 2117 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; 2067 2118 u8 err; 2068 - unsigned int dev0, dev1 = 0, rc = 0, devmask = 0; 2119 + unsigned int dev0, dev1 = 0, devmask = 0; 2069 2120 2070 2121 DPRINTK("ENTER, host %u, port %u\n", ap->id, ap->port_no); 2071 2122 ··· 2088 2139 2089 2140 /* issue bus reset */ 2090 2141 if (ap->flags & ATA_FLAG_SRST) 2091 - rc = ata_bus_softreset(ap, devmask); 2092 - else if ((ap->flags & ATA_FLAG_SATA_RESET) == 0) { 2093 - /* set up device control */ 2094 - if (ap->flags & ATA_FLAG_MMIO) 2095 - writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr); 2096 - else 2097 - outb(ap->ctl, ioaddr->ctl_addr); 2098 - rc = ata_bus_edd(ap); 2099 - } 2100 - 2101 - if (rc) 2102 - goto err_out; 2142 + if (ata_bus_softreset(ap, devmask)) 2143 + goto err_out; 2103 2144 2104 2145 /* 2105 2146 * determine by signature whether we have ATA or ATAPI devices ··· 2162 2223 * so makes reset sequence different from the original 2163 2224 * ->phy_reset implementation and Jeff nervous. :-P 2164 2225 */ 2165 - extern void ata_std_probeinit(struct ata_port *ap) 2226 + void ata_std_probeinit(struct ata_port *ap) 2166 2227 { 2167 - if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read) { 2228 + if ((ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read) { 2168 2229 sata_phy_resume(ap); 2169 2230 if (sata_dev_present(ap)) 2170 2231 ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); ··· 2653 2714 * known limits including host controller limits, device 2654 2715 * blacklist, etc... 2655 2716 * 2717 + * FIXME: The current implementation limits all transfer modes to 2718 + * the fastest of the lowested device on the port. This is not 2719 + * required on most controllers. 2720 + * 2656 2721 * LOCKING: 2657 2722 * None. 2658 2723 */ 2659 2724 static void ata_dev_xfermask(struct ata_port *ap, struct ata_device *dev) 2660 2725 { 2726 + struct ata_host_set *hs = ap->host_set; 2661 2727 unsigned long xfer_mask; 2662 2728 int i; 2663 2729 2664 2730 xfer_mask = ata_pack_xfermask(ap->pio_mask, ap->mwdma_mask, 2665 2731 ap->udma_mask); 2666 2732 2667 - /* use port-wide xfermask for now */ 2733 + /* FIXME: Use port-wide xfermask for now */ 2668 2734 for (i = 0; i < ATA_MAX_DEVICES; i++) { 2669 2735 struct ata_device *d = &ap->device[i]; 2670 2736 if (!ata_dev_present(d)) ··· 2679 2735 xfer_mask &= ata_id_xfermask(d->id); 2680 2736 if (ata_dma_blacklisted(d)) 2681 2737 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 2738 + /* Apply cable rule here. Don't apply it early because when 2739 + we handle hot plug the cable type can itself change */ 2740 + if (ap->cbl == ATA_CBL_PATA40) 2741 + xfer_mask &= ~(0xF8 << ATA_SHIFT_UDMA); 2682 2742 } 2683 2743 2684 2744 if (ata_dma_blacklisted(dev)) 2685 2745 printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, " 2686 2746 "disabling DMA\n", ap->id, dev->devno); 2747 + 2748 + if (hs->flags & ATA_HOST_SIMPLEX) { 2749 + if (hs->simplex_claimed) 2750 + xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 2751 + } 2752 + if (ap->ops->mode_filter) 2753 + xfer_mask = ap->ops->mode_filter(ap, dev, xfer_mask); 2687 2754 2688 2755 ata_unpack_xfermask(xfer_mask, &dev->pio_mask, &dev->mwdma_mask, 2689 2756 &dev->udma_mask); ··· 2750 2795 */ 2751 2796 2752 2797 static unsigned int ata_dev_init_params(struct ata_port *ap, 2753 - struct ata_device *dev) 2798 + struct ata_device *dev, 2799 + u16 heads, 2800 + u16 sectors) 2754 2801 { 2755 2802 struct ata_taskfile tf; 2756 2803 unsigned int err_mask; 2757 - u16 sectors = dev->id[6]; 2758 - u16 heads = dev->id[3]; 2759 2804 2760 2805 /* Number of sectors per track 1-255. Number of heads 1-16 */ 2761 2806 if (sectors < 1 || sectors > 255 || heads < 1 || heads > 16) 2762 - return 0; 2807 + return AC_ERR_INVALID; 2763 2808 2764 2809 /* set up init dev params taskfile */ 2765 2810 DPRINTK("init dev params \n"); ··· 4491 4536 int rc; 4492 4537 4493 4538 DPRINTK("ENTER\n"); 4539 + 4540 + if (!ent->port_ops->probe_reset && 4541 + !(ent->host_flags & (ATA_FLAG_SATA_RESET | ATA_FLAG_SRST))) { 4542 + printk(KERN_ERR "ata%u: no reset mechanism available\n", 4543 + port_no); 4544 + return NULL; 4545 + } 4546 + 4494 4547 host = scsi_host_alloc(ent->sht, sizeof(struct ata_port)); 4495 4548 if (!host) 4496 4549 return NULL; ··· 4559 4596 host_set->mmio_base = ent->mmio_base; 4560 4597 host_set->private_data = ent->private_data; 4561 4598 host_set->ops = ent->port_ops; 4599 + host_set->flags = ent->host_set_flags; 4562 4600 4563 4601 /* register each port bound to this device */ 4564 4602 for (i = 0; i < ent->n_ports; i++) {
+24 -18
drivers/scsi/sata_mv.c
··· 1010 1010 1011 1011 pp->sg_tbl[i].addr = cpu_to_le32(addr & 0xffffffff); 1012 1012 pp->sg_tbl[i].addr_hi = cpu_to_le32((addr >> 16) >> 16); 1013 - pp->sg_tbl[i].flags_size = cpu_to_le32(len); 1013 + pp->sg_tbl[i].flags_size = cpu_to_le32(len & 0xffff); 1014 1014 1015 1015 sg_len -= len; 1016 1016 addr += len; ··· 1350 1350 { 1351 1351 void __iomem *mmio = host_set->mmio_base; 1352 1352 void __iomem *hc_mmio = mv_hc_base(mmio, hc); 1353 - struct ata_port *ap; 1354 1353 struct ata_queued_cmd *qc; 1355 1354 u32 hc_irq_cause; 1356 1355 int shift, port, port0, hard_port, handled; ··· 1372 1373 1373 1374 for (port = port0; port < port0 + MV_PORTS_PER_HC; port++) { 1374 1375 u8 ata_status = 0; 1375 - ap = host_set->ports[port]; 1376 + struct ata_port *ap = host_set->ports[port]; 1377 + struct mv_port_priv *pp = ap->private_data; 1378 + 1376 1379 hard_port = port & MV_PORT_MASK; /* range 0-3 */ 1377 1380 handled = 0; /* ensure ata_status is set if handled++ */ 1378 1381 1379 - if ((CRPB_DMA_DONE << hard_port) & hc_irq_cause) { 1380 - /* new CRPB on the queue; just one at a time until NCQ 1381 - */ 1382 - ata_status = mv_get_crpb_status(ap); 1383 - handled++; 1384 - } else if ((DEV_IRQ << hard_port) & hc_irq_cause) { 1385 - /* received ATA IRQ; read the status reg to clear INTRQ 1386 - */ 1387 - ata_status = readb((void __iomem *) 1382 + /* Note that DEV_IRQ might happen spuriously during EDMA, 1383 + * and should be ignored in such cases. We could mask it, 1384 + * but it's pretty rare and may not be worth the overhead. 1385 + */ 1386 + if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) { 1387 + /* EDMA: check for response queue interrupt */ 1388 + if ((CRPB_DMA_DONE << hard_port) & hc_irq_cause) { 1389 + ata_status = mv_get_crpb_status(ap); 1390 + handled = 1; 1391 + } 1392 + } else { 1393 + /* PIO: check for device (drive) interrupt */ 1394 + if ((DEV_IRQ << hard_port) & hc_irq_cause) { 1395 + ata_status = readb((void __iomem *) 1388 1396 ap->ioaddr.status_addr); 1389 - handled++; 1397 + handled = 1; 1398 + } 1390 1399 } 1391 1400 1392 - if (ap && 1393 - (ap->flags & (ATA_FLAG_PORT_DISABLED | ATA_FLAG_NOINTR))) 1401 + if (ap->flags & (ATA_FLAG_PORT_DISABLED | ATA_FLAG_NOINTR)) 1394 1402 continue; 1395 1403 1396 1404 err_mask = ac_err_mask(ata_status); ··· 1409 1403 if ((PORT0_ERR << shift) & relevant) { 1410 1404 mv_err_intr(ap); 1411 1405 err_mask |= AC_ERR_OTHER; 1412 - handled++; 1406 + handled = 1; 1413 1407 } 1414 1408 1415 - if (handled && ap) { 1409 + if (handled) { 1416 1410 qc = ata_qc_from_tag(ap, ap->active_tag); 1417 - if (NULL != qc) { 1411 + if (qc && (qc->flags & ATA_QCFLAG_ACTIVE)) { 1418 1412 VPRINTK("port %u IRQ found for qc, " 1419 1413 "ata_status 0x%x\n", port,ata_status); 1420 1414 /* mark qc status appropriately */
+9 -1
include/linux/libata.h
··· 160 160 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, 161 161 ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ 162 162 163 + /* host set flags */ 164 + ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ 165 + 163 166 /* various lengths of time */ 164 - ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ 165 167 ATA_TMOUT_PIO = 30 * HZ, 166 168 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 167 169 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ ··· 281 279 unsigned long irq; 282 280 unsigned int irq_flags; 283 281 unsigned long host_flags; 282 + unsigned long host_set_flags; 284 283 void __iomem *mmio_base; 285 284 void *private_data; 286 285 }; ··· 294 291 unsigned int n_ports; 295 292 void *private_data; 296 293 const struct ata_port_operations *ops; 294 + unsigned long flags; 295 + int simplex_claimed; /* Keep seperate in case we 296 + ever need to do this locked */ 297 297 struct ata_port * ports[0]; 298 298 }; 299 299 ··· 426 420 427 421 void (*set_piomode) (struct ata_port *, struct ata_device *); 428 422 void (*set_dmamode) (struct ata_port *, struct ata_device *); 423 + unsigned long (*mode_filter) (const struct ata_port *, struct ata_device *, unsigned long); 429 424 430 425 void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); 431 426 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); ··· 437 430 void (*dev_select)(struct ata_port *ap, unsigned int device); 438 431 439 432 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 433 + void (*set_mode) (struct ata_port *ap); 440 434 int (*probe_reset) (struct ata_port *ap, unsigned int *classes); 441 435 442 436 void (*post_set_mode) (struct ata_port *ap);