Merge refs/heads/upstream from master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

+43 -7
+43 -7
drivers/scsi/sata_promise.c
··· 84 84 static void pdc_eng_timeout(struct ata_port *ap); 85 85 static int pdc_port_start(struct ata_port *ap); 86 86 static void pdc_port_stop(struct ata_port *ap); 87 - static void pdc_phy_reset(struct ata_port *ap); 87 + static void pdc_pata_phy_reset(struct ata_port *ap); 88 + static void pdc_sata_phy_reset(struct ata_port *ap); 88 89 static void pdc_qc_prep(struct ata_queued_cmd *qc); 89 90 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); 90 91 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); ··· 112 111 .ordered_flush = 1, 113 112 }; 114 113 115 - static struct ata_port_operations pdc_ata_ops = { 114 + static struct ata_port_operations pdc_sata_ops = { 116 115 .port_disable = ata_port_disable, 117 116 .tf_load = pdc_tf_load_mmio, 118 117 .tf_read = ata_tf_read, 119 118 .check_status = ata_check_status, 120 119 .exec_command = pdc_exec_command_mmio, 121 120 .dev_select = ata_std_dev_select, 122 - .phy_reset = pdc_phy_reset, 121 + 122 + .phy_reset = pdc_sata_phy_reset, 123 + 123 124 .qc_prep = pdc_qc_prep, 124 125 .qc_issue = pdc_qc_issue_prot, 125 126 .eng_timeout = pdc_eng_timeout, 126 127 .irq_handler = pdc_interrupt, 127 128 .irq_clear = pdc_irq_clear, 129 + 128 130 .scr_read = pdc_sata_scr_read, 129 131 .scr_write = pdc_sata_scr_write, 132 + .port_start = pdc_port_start, 133 + .port_stop = pdc_port_stop, 134 + .host_stop = ata_host_stop, 135 + }; 136 + 137 + static struct ata_port_operations pdc_pata_ops = { 138 + .port_disable = ata_port_disable, 139 + .tf_load = pdc_tf_load_mmio, 140 + .tf_read = ata_tf_read, 141 + .check_status = ata_check_status, 142 + .exec_command = pdc_exec_command_mmio, 143 + .dev_select = ata_std_dev_select, 144 + 145 + .phy_reset = pdc_pata_phy_reset, 146 + 147 + .qc_prep = pdc_qc_prep, 148 + .qc_issue = pdc_qc_issue_prot, 149 + .eng_timeout = pdc_eng_timeout, 150 + .irq_handler = pdc_interrupt, 151 + .irq_clear = pdc_irq_clear, 152 + 130 153 .port_start = pdc_port_start, 131 154 .port_stop = pdc_port_stop, 132 155 .host_stop = ata_host_stop, ··· 165 140 .pio_mask = 0x1f, /* pio0-4 */ 166 141 .mwdma_mask = 0x07, /* mwdma0-2 */ 167 142 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 168 - .port_ops = &pdc_ata_ops, 143 + .port_ops = &pdc_sata_ops, 169 144 }, 170 145 171 146 /* board_20319 */ ··· 176 151 .pio_mask = 0x1f, /* pio0-4 */ 177 152 .mwdma_mask = 0x07, /* mwdma0-2 */ 178 153 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 179 - .port_ops = &pdc_ata_ops, 154 + .port_ops = &pdc_sata_ops, 180 155 }, 181 156 182 157 /* board_20619 */ ··· 187 162 .pio_mask = 0x1f, /* pio0-4 */ 188 163 .mwdma_mask = 0x07, /* mwdma0-2 */ 189 164 .udma_mask = 0x7f, /* udma0-6 ; FIXME */ 190 - .port_ops = &pdc_ata_ops, 165 + .port_ops = &pdc_pata_ops, 191 166 }, 192 167 }; 193 168 ··· 302 277 readl(mmio); /* flush */ 303 278 } 304 279 305 - static void pdc_phy_reset(struct ata_port *ap) 280 + static void pdc_sata_phy_reset(struct ata_port *ap) 306 281 { 307 282 pdc_reset_port(ap); 308 283 sata_phy_reset(ap); 284 + } 285 + 286 + static void pdc_pata_phy_reset(struct ata_port *ap) 287 + { 288 + /* FIXME: add cable detect. Don't assume 40-pin cable */ 289 + ap->cbl = ATA_CBL_PATA40; 290 + ap->udma_mask &= ATA_UDMA_MASK_40C; 291 + 292 + pdc_reset_port(ap); 293 + ata_port_probe(ap); 294 + ata_bus_reset(ap); 309 295 } 310 296 311 297 static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)