Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pata_artop: Serializing support

Enable both ports on the 6210 and serialize them

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Alan Cox and committed by
Jeff Garzik
140d6fed 208f2a88

+27 -6
+27 -6
drivers/ata/pata_artop.c
··· 12 12 * performance Alessandro Zummo <alessandro.zummo@towertech.it> 13 13 * 14 14 * TODO 15 - * 850 serialization once the core supports it 16 15 * Investigate no_dsc on 850R 17 16 * Clock detect 18 17 */ ··· 28 29 #include <linux/ata.h> 29 30 30 31 #define DRV_NAME "pata_artop" 31 - #define DRV_VERSION "0.4.4" 32 + #define DRV_VERSION "0.4.5" 32 33 33 34 /* 34 35 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we ··· 282 283 pci_write_config_byte(pdev, 0x44 + ap->port_no, ultra); 283 284 } 284 285 286 + /** 287 + * artop_6210_qc_defer - implement serialization 288 + * @qc: command 289 + * 290 + * Issue commands per host on this chip. 291 + */ 292 + 293 + static int artop6210_qc_defer(struct ata_queued_cmd *qc) 294 + { 295 + struct ata_host *host = qc->ap->host; 296 + struct ata_port *alt = host->ports[1 ^ qc->ap->port_no]; 297 + int rc; 298 + 299 + /* First apply the usual rules */ 300 + rc = ata_std_qc_defer(qc); 301 + if (rc != 0) 302 + return rc; 303 + 304 + /* Now apply serialization rules. Only allow a command if the 305 + other channel state machine is idle */ 306 + if (alt && alt->qc_active) 307 + return ATA_DEFER_PORT; 308 + return 0; 309 + } 310 + 285 311 static struct scsi_host_template artop_sht = { 286 312 ATA_BMDMA_SHT(DRV_NAME), 287 313 }; ··· 317 293 .set_piomode = artop6210_set_piomode, 318 294 .set_dmamode = artop6210_set_dmamode, 319 295 .prereset = artop6210_pre_reset, 296 + .qc_defer = artop6210_qc_defer, 320 297 }; 321 298 322 299 static struct ata_port_operations artop6260_ops = { ··· 387 362 388 363 if (id->driver_data == 0) { /* 6210 variant */ 389 364 ppi[0] = &info_6210; 390 - ppi[1] = &ata_dummy_port_info; 391 365 /* BIOS may have left us in UDMA, clear it before libata probe */ 392 366 pci_write_config_byte(pdev, 0x54, 0); 393 - /* For the moment (also lacks dsc) */ 394 - printk(KERN_WARNING "ARTOP 6210 requires serialize functionality not yet supported by libata.\n"); 395 - printk(KERN_WARNING "Secondary ATA ports will not be activated.\n"); 396 367 } 397 368 else if (id->driver_data == 1) /* 6260 */ 398 369 ppi[0] = &info_626x;