* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: Fix Maple PATA IRQ assignment. ahci: use 0x80 as wait stat value instead of 0xff sata_via: style clean up, no indirect method call in LLD ahci: fix endianness in spurious interrupt message libata-sff: Don't call bmdma_stop on non DMA capable controllers libata: implement ATA_FLAG_IGN_SIMPLEX and use it in sata_uli ahci: improve and limit spurious interrupt messages, take#3 sata_via: don't diddle with ATA_NIEN in ->freeze libata: set_mode, Fix the FIXME libata hpt3xn: Hopefully sort out the DPLL logic versus the vendor code libata cmd64x: whack into a shape that looks like the documentation
Unified · Split
| @@ -484,6 +484,7 @@ config PPC_MAPLE · 483 unmodified lines | ||
| 484 | 484 | select PPC_970_NAP |
| 485 | 485 | select PPC_NATIVE |
| 486 | 486 | select PPC_RTAS |
| 487 | + select ATA_NONSTANDARD if ATA | |
| 487 | 488 | default n |
| 488 | 489 | help |
| 489 | 490 | This option enables support for the Maple 970FX Evaluation Board. |
| @@ -19,6 +19,10 @@ config ATA · 18 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | if ATA |
| 21 | 21 | |
| 22 | +config ATA_NONSTANDARD | |
| 23 | + bool | |
| 24 | + default n | |
| 25 | + | |
| 22 | 26 | config SATA_AHCI |
| 23 | 27 | tristate "AHCI SATA support" |
| 24 | 28 | depends on PCI |
| @@ -75,6 +75,7 @@ enum { · 74 unmodified lines | ||
| 75 | 75 | AHCI_CMD_CLR_BUSY = (1 << 10), |
| 76 | 76 | |
| 77 | 77 | RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */ |
| 78 | + RX_FIS_SDB = 0x58, /* offset of SDB FIS data */ | |
| 78 | 79 | RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */ |
| 79 | 80 | |
| 80 | 81 | board_ahci = 0, |
| @@ -202,6 +203,10 @@ struct ahci_port_priv { · 121 unmodified lines | ||
| 202 | 203 | dma_addr_t cmd_tbl_dma; |
| 203 | 204 | void *rx_fis; |
| 204 | 205 | dma_addr_t rx_fis_dma; |
| 206 | + /* for NCQ spurious interrupt analysis */ | |
| 207 | + int ncq_saw_spurious_sdb_cnt; | |
| 208 | + unsigned int ncq_saw_d2h:1; | |
| 209 | + unsigned int ncq_saw_dmas:1; | |
| 205 | 210 | }; |
| 206 | 211 | |
| 207 | 212 | static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg); |
| @@ -898,7 +903,7 @@ static int ahci_hardreset(struct ata_port *ap, unsigned int *class) · 690 unmodified lines | ||
| 898 | 903 | |
| 899 | 904 | /* clear D2H reception area to properly wait for D2H FIS */ |
| 900 | 905 | ata_tf_init(ap->device, &tf); |
| 901 | − tf.command = 0xff; | |
| 906 | + tf.command = 0x80; | |
| 902 | 907 | ata_tf_to_fis(&tf, d2h_fis, 0); |
| 903 | 908 | |
| 904 | 909 | rc = sata_std_hardreset(ap, class); |
| @@ -1109,8 +1114,9 @@ static void ahci_host_intr(struct ata_port *ap) · 204 unmodified lines | ||
| 1109 | 1114 | void __iomem *mmio = ap->host->mmio_base; |
| 1110 | 1115 | void __iomem *port_mmio = ahci_port_base(mmio, ap->port_no); |
| 1111 | 1116 | struct ata_eh_info *ehi = &ap->eh_info; |
| 1117 | + struct ahci_port_priv *pp = ap->private_data; | |
| 1112 | 1118 | u32 status, qc_active; |
| 1113 | − int rc; | |
| 1119 | + int rc, known_irq = 0; | |
| 1114 | 1120 | |
| 1115 | 1121 | status = readl(port_mmio + PORT_IRQ_STAT); |
| 1116 | 1122 | writel(status, port_mmio + PORT_IRQ_STAT); |
| @@ -1137,17 +1143,53 @@ static void ahci_host_intr(struct ata_port *ap) · 20 unmodified lines | ||
| 1137 | 1143 | |
| 1138 | 1144 | /* hmmm... a spurious interupt */ |
| 1139 | 1145 | |
| 1140 | − /* some devices send D2H reg with I bit set during NCQ command phase */ | |
| 1141 | − if (ap->sactive && (status & PORT_IRQ_D2H_REG_FIS)) | |
| 1146 | + /* if !NCQ, ignore. No modern ATA device has broken HSM | |
| 1147 | + * implementation for non-NCQ commands. | |
| 1148 | + */ | |
| 1149 | + if (!ap->sactive) | |
| 1142 | 1150 | return; |
| 1143 | 1151 | |
| 1144 | − /* ignore interim PIO setup fis interrupts */ | |
| 1145 | − if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS)) | |
| 1146 | − return; | |
| 1152 | + if (status & PORT_IRQ_D2H_REG_FIS) { | |
| 1153 | + if (!pp->ncq_saw_d2h) | |
| 1154 | + ata_port_printk(ap, KERN_INFO, | |
| 1155 | + "D2H reg with I during NCQ, " | |
| 1156 | + "this message won't be printed again\n"); | |
| 1157 | + pp->ncq_saw_d2h = 1; | |
| 1158 | + known_irq = 1; | |
| 1159 | + } | |
| 1160 | + | |
| 1161 | + if (status & PORT_IRQ_DMAS_FIS) { | |
| 1162 | + if (!pp->ncq_saw_dmas) | |
| 1163 | + ata_port_printk(ap, KERN_INFO, | |
| 1164 | + "DMAS FIS during NCQ, " | |
| 1165 | + "this message won't be printed again\n"); | |
| 1166 | + pp->ncq_saw_dmas = 1; | |
| 1167 | + known_irq = 1; | |
| 1168 | + } | |
| 1169 | + | |
| 1170 | + if (status & PORT_IRQ_SDB_FIS && | |
| 1171 | + pp->ncq_saw_spurious_sdb_cnt < 10) { | |
| 1172 | + /* SDB FIS containing spurious completions might be | |
| 1173 | + * dangerous, we need to know more about them. Print | |
| 1174 | + * more of it. | |
| 1175 | + */ | |
| 1176 | + const u32 *f = pp->rx_fis + RX_FIS_SDB; | |
| 1177 | + | |
| 1178 | + ata_port_printk(ap, KERN_INFO, "Spurious SDB FIS during NCQ " | |
| 1179 | + "issue=0x%x SAct=0x%x FIS=%08x:%08x%s\n", | |
| 1180 | + readl(port_mmio + PORT_CMD_ISSUE), | |
| 1181 | + readl(port_mmio + PORT_SCR_ACT), | |
| 1182 | + le32_to_cpu(f[0]), le32_to_cpu(f[1]), | |
| 1183 | + pp->ncq_saw_spurious_sdb_cnt < 10 ? | |
| 1184 | + "" : ", shutting up"); | |
| 1185 | + | |
| 1186 | + pp->ncq_saw_spurious_sdb_cnt++; | |
| 1187 | + known_irq = 1; | |
| 1188 | + } | |
| 1147 | 1189 | |
| 1148 | − if (ata_ratelimit()) | |
| 1190 | + if (!known_irq) | |
| 1149 | 1191 | ata_port_printk(ap, KERN_INFO, "spurious interrupt " |
| 1150 | − "(irq_stat 0x%x active_tag %d sactive 0x%x)\n", | |
| 1192 | + "(irq_stat 0x%x active_tag 0x%x sactive 0x%x)\n", | |
| 1151 | 1193 | status, ap->active_tag, ap->sactive); |
| 1152 | 1194 | } |
| 1153 | 1195 | |
| @@ -64,6 +64,7 @@ static void generic_error_handler(struct ata_port *ap) · 63 unmodified lines | ||
| 64 | 64 | /** |
| 65 | 65 | * generic_set_mode - mode setting |
| 66 | 66 | * @ap: interface to set up |
| 67 | + * @unused: returned device on error | |
| 67 | 68 | * |
| 68 | 69 | * Use a non standard set_mode function. We don't want to be tuned. |
| 69 | 70 | * The BIOS configured everything. Our job is not to fiddle. We |
| @@ -71,7 +72,7 @@ static void generic_error_handler(struct ata_port *ap) · 1 unmodified line | ||
| 71 | 72 | * and respect them. |
| 72 | 73 | */ |
| 73 | 74 | |
| 74 | −static void generic_set_mode(struct ata_port *ap) | |
| 75 | +static int generic_set_mode(struct ata_port *ap, struct ata_device **unused) | |
| 75 | 76 | { |
| 76 | 77 | int dma_enabled = 0; |
| 77 | 78 | int i; |
| @@ -82,7 +83,7 @@ static void generic_set_mode(struct ata_port *ap) · 4 unmodified lines | ||
| 82 | 83 | |
| 83 | 84 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
| 84 | 85 | struct ata_device *dev = &ap->device[i]; |
| 85 | − if (ata_dev_enabled(dev)) { | |
| 86 | + if (ata_dev_ready(dev)) { | |
| 86 | 87 | /* We don't really care */ |
| 87 | 88 | dev->pio_mode = XFER_PIO_0; |
| 88 | 89 | dev->dma_mode = XFER_MW_DMA_0; |
| @@ -99,6 +100,7 @@ static void generic_set_mode(struct ata_port *ap) · 10 unmodified lines | ||
| 99 | 100 | } |
| 100 | 101 | } |
| 101 | 102 | } |
| 103 | + return 0; | |
| 102 | 104 | } |
| 103 | 105 | |
| 104 | 106 | static struct scsi_host_template generic_sht = { |
| @@ -2431,18 +2431,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev) · 2430 unmodified lines | ||
| 2431 | 2431 | int i, rc = 0, used_dma = 0, found = 0; |
| 2432 | 2432 | |
| 2433 | 2433 | /* has private set_mode? */ |
| 2434 | − if (ap->ops->set_mode) { | |
| 2435 | − /* FIXME: make ->set_mode handle no device case and | |
| 2436 | − * return error code and failing device on failure. | |
| 2437 | − */ | |
| 2438 | − for (i = 0; i < ATA_MAX_DEVICES; i++) { | |
| 2439 | − if (ata_dev_ready(&ap->device[i])) { | |
| 2440 | − ap->ops->set_mode(ap); | |
| 2441 | − break; | |
| 2442 | − } | |
| 2443 | − } | |
| 2444 | − return 0; | |
| 2445 | − } | |
| 2434 | + if (ap->ops->set_mode) | |
| 2435 | + return ap->ops->set_mode(ap, r_failed_dev); | |
| 2446 | 2436 | |
| 2447 | 2437 | /* step 1: calculate xfer_mask */ |
| 2448 | 2438 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
| @@ -827,7 +827,8 @@ void ata_bmdma_error_handler(struct ata_port *ap) · 826 unmodified lines | ||
| 827 | 827 | */ |
| 828 | 828 | void 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 | 834 | #ifdef CONFIG_PCI |
| @@ -870,7 +871,8 @@ ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int · 36 unmodified lines | ||
| 870 | 871 | pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; |
| 871 | 872 | bmdma = pci_resource_start(pdev, 4); |
| 872 | 873 | if (bmdma) { |
| 873 | − if (inb(bmdma + 2) & 0x80) | |
| 874 | + if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) && | |
| 875 | + (inb(bmdma + 2) & 0x80)) | |
| 874 | 876 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
| 875 | 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 · 9 unmodified lines | ||
| 886 | 888 | bmdma = pci_resource_start(pdev, 4); |
| 887 | 889 | if (bmdma) { |
| 888 | 890 | bmdma += 8; |
| 889 | − if(inb(bmdma + 2) & 0x80) | |
| 891 | + if ((!(port[p]->flags & ATA_FLAG_IGN_SIMPLEX)) && | |
| 892 | + (inb(bmdma + 2) & 0x80)) | |
| 890 | 893 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
| 891 | 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, · 21 unmodified lines | ||
| 914 | 917 | probe_ent->irq_flags = IRQF_SHARED; |
| 915 | 918 | |
| 916 | 919 | if (port_mask & ATA_PORT_PRIMARY) { |
| 917 | − probe_ent->irq = ATA_PRIMARY_IRQ; | |
| 920 | + probe_ent->irq = ATA_PRIMARY_IRQ(pdev); | |
| 918 | 921 | probe_ent->port[0].cmd_addr = ATA_PRIMARY_CMD; |
| 919 | 922 | probe_ent->port[0].altstatus_addr = |
| 920 | 923 | probe_ent->port[0].ctl_addr = ATA_PRIMARY_CTL; |
| 921 | 924 | if (bmdma) { |
| 922 | 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 | 928 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
| 925 | 929 | } |
| 926 | 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, · 2 unmodified lines | ||
| 929 | 933 | |
| 930 | 934 | if (port_mask & ATA_PORT_SECONDARY) { |
| 931 | 935 | if (probe_ent->irq) |
| 932 | − probe_ent->irq2 = ATA_SECONDARY_IRQ; | |
| 936 | + probe_ent->irq2 = ATA_SECONDARY_IRQ(pdev); | |
| 933 | 937 | else |
| 934 | − probe_ent->irq = ATA_SECONDARY_IRQ; | |
| 938 | + probe_ent->irq = ATA_SECONDARY_IRQ(pdev); | |
| 935 | 939 | probe_ent->port[1].cmd_addr = ATA_SECONDARY_CMD; |
| 936 | 940 | probe_ent->port[1].altstatus_addr = |
| 937 | 941 | probe_ent->port[1].ctl_addr = ATA_SECONDARY_CTL; |
| 938 | 942 | if (bmdma) { |
| 939 | 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 | 946 | probe_ent->_host_flags |= ATA_HOST_SIMPLEX; |
| 942 | 947 | } |
| 943 | 948 | ata_std_ports(&probe_ent->port[1]); |
| @@ -197,7 +197,7 @@ static void cmd64x_set_piomode(struct ata_port *ap, struct ata_device *adev) · 196 unmodified lines | ||
| 197 | 197 | static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) |
| 198 | 198 | { |
| 199 | 199 | static const u8 udma_data[] = { |
| 200 | − 0x31, 0x21, 0x11, 0x25, 0x15, 0x05 | |
| 200 | + 0x30, 0x20, 0x10, 0x20, 0x10, 0x00 | |
| 201 | 201 | }; |
| 202 | 202 | static const u8 mwdma_data[] = { |
| 203 | 203 | 0x30, 0x20, 0x10 |
| @@ -213,12 +213,21 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) · 9 unmodified lines | ||
| 213 | 213 | pci_read_config_byte(pdev, pciD, ®D); |
| 214 | 214 | pci_read_config_byte(pdev, pciU, ®U); |
| 215 | 215 | |
| 216 | − regD &= ~(0x20 << shift); | |
| 217 | − regU &= ~(0x35 << shift); | |
| 216 | + /* DMA bits off */ | |
| 217 | + regD &= ~(0x20 << adev->devno); | |
| 218 | + /* DMA control bits */ | |
| 219 | + regU &= ~(0x30 << shift); | |
| 220 | + /* DMA timing bits */ | |
| 221 | + regU &= ~(0x05 << adev->devno); | |
| 218 | 222 | |
| 219 | − if (adev->dma_mode >= XFER_UDMA_0) | |
| 223 | + if (adev->dma_mode >= XFER_UDMA_0) { | |
| 224 | + /* Merge thge timing value */ | |
| 220 | 225 | regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; |
| 221 | − else | |
| 226 | + /* Merge the control bits */ | |
| 227 | + regU |= 1 << adev->devno; /* UDMA on */ | |
| 228 | + if (adev->dma_mode > 2) /* 15nS timing */ | |
| 229 | + regU |= 4 << adev->devno; | |
| 230 | + } else | |
| 222 | 231 | regD |= mwdma_data[adev->dma_mode - XFER_MW_DMA_0] << shift; |
| 223 | 232 | |
| 224 | 233 | regD |= 0x20 << adev->devno; |
| @@ -239,8 +248,8 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc) · 14 unmodified lines | ||
| 239 | 248 | struct ata_port *ap = qc->ap; |
| 240 | 249 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
| 241 | 250 | u8 dma_intr; |
| 242 | − int dma_reg = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; | |
| 243 | − int dma_mask = ap->port_no ? ARTTIM2 : CFR; | |
| 251 | + int dma_mask = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; | |
| 252 | + int dma_reg = ap->port_no ? ARTTIM2 : CFR; | |
| 244 | 253 | |
| 245 | 254 | ata_bmdma_stop(qc); |
| 246 | 255 | |
| @@ -25,7 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <linux/libata.h> |
| 26 | 26 | |
| 27 | 27 | #define DRV_NAME "pata_hpt3x2n" |
| 28 | −#define DRV_VERSION "0.3" | |
| 28 | +#define DRV_VERSION "0.3.2" | |
| 29 | 29 | |
| 30 | 30 | enum { |
| 31 | 31 | HPT_PCI_FAST = (1 << 31), |
| @@ -297,11 +297,11 @@ static int hpt3x2n_pair_idle(struct ata_port *ap) · 265 unmodified lines | ||
| 297 | 297 | return 0; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | −static int hpt3x2n_use_dpll(struct ata_port *ap, int reading) | |
| 300 | +static int hpt3x2n_use_dpll(struct ata_port *ap, int writing) | |
| 301 | 301 | { |
| 302 | 302 | long flags = (long)ap->host->private_data; |
| 303 | 303 | /* See if we should use the DPLL */ |
| 304 | − if (reading == 0) | |
| 304 | + if (writing) | |
| 305 | 305 | return USE_DPLL; /* Needed for write */ |
| 306 | 306 | if (flags & PCI66) |
| 307 | 307 | return USE_DPLL; /* Needed at 66Mhz */ |
| @@ -476,6 +476,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) · 475 unmodified lines | ||
| 476 | 476 | /** |
| 477 | 477 | * it821x_smart_set_mode - mode setting |
| 478 | 478 | * @ap: interface to set up |
| 479 | + * @unused: device that failed (error only) | |
| 479 | 480 | * |
| 480 | 481 | * Use a non standard set_mode function. We don't want to be tuned. |
| 481 | 482 | * The BIOS configured everything. Our job is not to fiddle. We |
| @@ -483,7 +484,7 @@ static unsigned int it821x_passthru_qc_issue_prot(struct ata_queued_cmd *qc) · 1 unmodified line | ||
| 483 | 484 | * and respect them. |
| 484 | 485 | */ |
| 485 | 486 | |
| 486 | −static void it821x_smart_set_mode(struct ata_port *ap) | |
| 487 | +static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused) | |
| 487 | 488 | { |
| 488 | 489 | int dma_enabled = 0; |
| 489 | 490 | int i; |
| @@ -512,6 +513,7 @@ static void it821x_smart_set_mode(struct ata_port *ap) · 22 unmodified lines | ||
| 512 | 513 | } |
| 513 | 514 | } |
| 514 | 515 | } |
| 516 | + return 0; | |
| 515 | 517 | } |
| 516 | 518 | |
| 517 | 519 | /** |
| @@ -23,9 +23,9 @@ · 22 unmodified lines | ||
| 23 | 23 | #include <scsi/scsi_host.h> |
| 24 | 24 | |
| 25 | 25 | #define DRV_NAME "pata_ixp4xx_cf" |
| 26 | −#define DRV_VERSION "0.1.1" | |
| 26 | +#define DRV_VERSION "0.1.1ac1" | |
| 27 | 27 | |
| 28 | −static void ixp4xx_set_mode(struct ata_port *ap) | |
| 28 | +static int ixp4xx_set_mode(struct ata_port *ap, struct ata_device *adev) | |
| 29 | 29 | { |
| 30 | 30 | int i; |
| 31 | 31 | |
| @@ -38,6 +38,7 @@ static void ixp4xx_set_mode(struct ata_port *ap) · 6 unmodified lines | ||
| 38 | 38 | dev->flags |= ATA_DFLAG_PIO; |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | + return 0; | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | static void ixp4xx_phy_reset(struct ata_port *ap) |
| @@ -96,6 +96,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */ · 95 unmodified lines | ||
| 96 | 96 | /** |
| 97 | 97 | * legacy_set_mode - mode setting |
| 98 | 98 | * @ap: IDE interface |
| 99 | + * @unused: Device that failed when error is returned | |
| 99 | 100 | * |
| 100 | 101 | * Use a non standard set_mode function. We don't want to be tuned. |
| 101 | 102 | * |
| @@ -105,7 +106,7 @@ static int pio_mask = 0x1F; /* PIO range for autospeed devices */ · 3 unmodified lines | ||
| 105 | 106 | * expand on this as per hdparm in the base kernel. |
| 106 | 107 | */ |
| 107 | 108 | |
| 108 | −static void legacy_set_mode(struct ata_port *ap) | |
| 109 | +static int legacy_set_mode(struct ata_port *ap, struct ata_device **unused) | |
| 109 | 110 | { |
| 110 | 111 | int i; |
| 111 | 112 | |
| @@ -118,6 +119,7 @@ static void legacy_set_mode(struct ata_port *ap) · 6 unmodified lines | ||
| 118 | 119 | dev->flags |= ATA_DFLAG_PIO; |
| 119 | 120 | } |
| 120 | 121 | } |
| 122 | + return 0; | |
| 121 | 123 | } |
| 122 | 124 | |
| 123 | 125 | static struct scsi_host_template legacy_sht = { |
| @@ -52,19 +52,20 @@ static void rz1000_error_handler(struct ata_port *ap) · 51 unmodified lines | ||
| 52 | 52 | /** |
| 53 | 53 | * rz1000_set_mode - mode setting function |
| 54 | 54 | * @ap: ATA interface |
| 55 | + * @unused: returned device on set_mode failure | |
| 55 | 56 | * |
| 56 | 57 | * Use a non standard set_mode function. We don't want to be tuned. We |
| 57 | 58 | * would prefer to be BIOS generic but for the fact our hardware is |
| 58 | 59 | * whacked out. |
| 59 | 60 | */ |
| 60 | 61 | |
| 61 | −static void rz1000_set_mode(struct ata_port *ap) | |
| 62 | +static int rz1000_set_mode(struct ata_port *ap, struct ata_device **unused) | |
| 62 | 63 | { |
| 63 | 64 | int i; |
| 64 | 65 | |
| 65 | 66 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
| 66 | 67 | struct ata_device *dev = &ap->device[i]; |
| 67 | − if (ata_dev_enabled(dev)) { | |
| 68 | + if (ata_dev_ready(dev)) { | |
| 68 | 69 | /* We don't really care */ |
| 69 | 70 | dev->pio_mode = XFER_PIO_0; |
| 70 | 71 | dev->xfer_mode = XFER_PIO_0; |
| @@ -72,6 +73,7 @@ static void rz1000_set_mode(struct ata_port *ap) · 1 unmodified line | ||
| 72 | 73 | dev->flags |= ATA_DFLAG_PIO; |
| 73 | 74 | } |
| 74 | 75 | } |
| 76 | + return 0; | |
| 75 | 77 | } |
| 76 | 78 | |
| 77 | 79 | |
| @@ -128,7 +128,8 @@ static const struct ata_port_operations uli_ops = { · 127 unmodified lines | ||
| 128 | 128 | |
| 129 | 129 | static struct ata_port_info uli_port_info = { |
| 130 | 130 | .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, | |
| 132 | 133 | .pio_mask = 0x1f, /* pio0-4 */ |
| 133 | 134 | .udma_mask = 0x7f, /* udma0-6 */ |
| 134 | 135 | .port_ops = &uli_ops, |
| @@ -74,6 +74,7 @@ enum { · 73 unmodified lines | ||
| 74 | 74 | static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
| 75 | 75 | static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); |
| 76 | 76 | static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
| 77 | +static void svia_noop_freeze(struct ata_port *ap); | |
| 77 | 78 | static void vt6420_error_handler(struct ata_port *ap); |
| 78 | 79 | |
| 79 | 80 | static const struct pci_device_id svia_pci_tbl[] = { |
| @@ -128,7 +129,7 @@ static const struct ata_port_operations vt6420_sata_ops = { · 48 unmodified lines | ||
| 128 | 129 | .qc_issue = ata_qc_issue_prot, |
| 129 | 130 | .data_xfer = ata_pio_data_xfer, |
| 130 | 131 | |
| 131 | − .freeze = ata_bmdma_freeze, | |
| 132 | + .freeze = svia_noop_freeze, | |
| 132 | 133 | .thaw = ata_bmdma_thaw, |
| 133 | 134 | .error_handler = vt6420_error_handler, |
| 134 | 135 | .post_internal_cmd = ata_bmdma_post_internal_cmd, |
| @@ -204,6 +205,15 @@ static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) · 69 unmodified lines | ||
| 204 | 205 | outl(val, ap->ioaddr.scr_addr + (4 * sc_reg)); |
| 205 | 206 | } |
| 206 | 207 | |
| 208 | +static void svia_noop_freeze(struct ata_port *ap) | |
| 209 | +{ | |
| 210 | + /* Some VIA controllers choke if ATA_NIEN is manipulated in | |
| 211 | + * certain way. Leave it alone and just clear pending IRQ. | |
| 212 | + */ | |
| 213 | + ata_chk_status(ap); | |
| 214 | + ata_bmdma_irq_clear(ap); | |
| 215 | +} | |
| 216 | + | |
| 207 | 217 | /** |
| 208 | 218 | * vt6420_prereset - prereset for vt6420 |
| 209 | 219 | * @ap: target ATA port |
| @@ -3,10 +3,10 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | #define ATA_PRIMARY_CMD 0x1F0 |
| 5 | 5 | #define ATA_PRIMARY_CTL 0x3F6 |
| 6 | −#define ATA_PRIMARY_IRQ 14 | |
| 6 | +#define ATA_PRIMARY_IRQ(dev) 14 | |
| 7 | 7 | |
| 8 | 8 | #define ATA_SECONDARY_CMD 0x170 |
| 9 | 9 | #define ATA_SECONDARY_CTL 0x376 |
| 10 | −#define ATA_SECONDARY_IRQ 15 | |
| 10 | +#define ATA_SECONDARY_IRQ(dev) 15 | |
| 11 | 11 | |
| 12 | 12 | #endif |
| @@ -0,0 +1,12 @@ | ||
| 1 | +#ifndef __ASM_POWERPC_LIBATA_PORTMAP_H | |
| 2 | +#define __ASM_POWERPC_LIBATA_PORTMAP_H | |
| 3 | + | |
| 4 | +#define ATA_PRIMARY_CMD 0x1F0 | |
| 5 | +#define ATA_PRIMARY_CTL 0x3F6 | |
| 6 | +#define ATA_PRIMARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 0) | |
| 7 | + | |
| 8 | +#define ATA_SECONDARY_CMD 0x170 | |
| 9 | +#define ATA_SECONDARY_CTL 0x376 | |
| 10 | +#define ATA_SECONDARY_IRQ(dev) pci_get_legacy_ide_irq(dev, 1) | |
| 11 | + | |
| 12 | +#endif | |
| @@ -177,6 +177,7 @@ enum { · 176 unmodified lines | ||
| 177 | 177 | * Register FIS clearing BSY */ |
| 178 | 178 | ATA_FLAG_DEBUGMSG = (1 << 13), |
| 179 | 179 | ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ |
| 180 | + ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ | |
| 180 | 181 | |
| 181 | 182 | /* The following flag belongs to ap->pflags but is kept in |
| 182 | 183 | * ap->flags because it's referenced in many LLDs and will be |
| @@ -612,11 +613,11 @@ struct ata_port_operations { · 429 unmodified lines | ||
| 612 | 613 | void (*dev_select)(struct ata_port *ap, unsigned int device); |
| 613 | 614 | |
| 614 | 615 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ |
| 615 | − void (*set_mode) (struct ata_port *ap); | |
| 616 | + int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev); | |
| 616 | 617 | |
| 617 | 618 | void (*post_set_mode) (struct ata_port *ap); |
| 618 | 619 | |
| 619 | − int (*check_atapi_dma) (struct ata_queued_cmd *qc); | |
| 620 | + int (*check_atapi_dma) (struct ata_queued_cmd *qc); | |
| 620 | 621 | |
| 621 | 622 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
| 622 | 623 | void (*bmdma_start) (struct ata_queued_cmd *qc); |