aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_artop.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-03-24 06:21:49 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-03-24 22:45:05 -0400
commit140d6fed71a659f39f0b130b6ac8f8d28600bf60 (patch)
treeefdbc36ea5ec9e183886a6211870a46aebb1f82c /drivers/ata/pata_artop.c
parent208f2a886a2f6cf329c9fcbf8d29a0dd245cc763 (diff)
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>
Diffstat (limited to 'drivers/ata/pata_artop.c')
-rw-r--r--drivers/ata/pata_artop.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 07c7fae6da13..d332cfdb0f30 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -12,7 +12,6 @@
12 * performance Alessandro Zummo <alessandro.zummo@towertech.it> 12 * performance Alessandro Zummo <alessandro.zummo@towertech.it>
13 * 13 *
14 * TODO 14 * TODO
15 * 850 serialization once the core supports it
16 * Investigate no_dsc on 850R 15 * Investigate no_dsc on 850R
17 * Clock detect 16 * Clock detect
18 */ 17 */
@@ -29,7 +28,7 @@
29#include <linux/ata.h> 28#include <linux/ata.h>
30 29
31#define DRV_NAME "pata_artop" 30#define DRV_NAME "pata_artop"
32#define DRV_VERSION "0.4.4" 31#define DRV_VERSION "0.4.5"
33 32
34/* 33/*
35 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we 34 * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we
@@ -283,6 +282,31 @@ static void artop6260_set_dmamode (struct ata_port *ap, struct ata_device *adev)
283 pci_write_config_byte(pdev, 0x44 + ap->port_no, ultra); 282 pci_write_config_byte(pdev, 0x44 + ap->port_no, ultra);
284} 283}
285 284
285/**
286 * artop_6210_qc_defer - implement serialization
287 * @qc: command
288 *
289 * Issue commands per host on this chip.
290 */
291
292static int artop6210_qc_defer(struct ata_queued_cmd *qc)
293{
294 struct ata_host *host = qc->ap->host;
295 struct ata_port *alt = host->ports[1 ^ qc->ap->port_no];
296 int rc;
297
298 /* First apply the usual rules */
299 rc = ata_std_qc_defer(qc);
300 if (rc != 0)
301 return rc;
302
303 /* Now apply serialization rules. Only allow a command if the
304 other channel state machine is idle */
305 if (alt && alt->qc_active)
306 return ATA_DEFER_PORT;
307 return 0;
308}
309
286static struct scsi_host_template artop_sht = { 310static struct scsi_host_template artop_sht = {
287 ATA_BMDMA_SHT(DRV_NAME), 311 ATA_BMDMA_SHT(DRV_NAME),
288}; 312};
@@ -293,6 +317,7 @@ static struct ata_port_operations artop6210_ops = {
293 .set_piomode = artop6210_set_piomode, 317 .set_piomode = artop6210_set_piomode,
294 .set_dmamode = artop6210_set_dmamode, 318 .set_dmamode = artop6210_set_dmamode,
295 .prereset = artop6210_pre_reset, 319 .prereset = artop6210_pre_reset,
320 .qc_defer = artop6210_qc_defer,
296}; 321};
297 322
298static struct ata_port_operations artop6260_ops = { 323static struct ata_port_operations artop6260_ops = {
@@ -362,12 +387,8 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
362 387
363 if (id->driver_data == 0) { /* 6210 variant */ 388 if (id->driver_data == 0) { /* 6210 variant */
364 ppi[0] = &info_6210; 389 ppi[0] = &info_6210;
365 ppi[1] = &ata_dummy_port_info;
366 /* BIOS may have left us in UDMA, clear it before libata probe */ 390 /* BIOS may have left us in UDMA, clear it before libata probe */
367 pci_write_config_byte(pdev, 0x54, 0); 391 pci_write_config_byte(pdev, 0x54, 0);
368 /* For the moment (also lacks dsc) */
369 printk(KERN_WARNING "ARTOP 6210 requires serialize functionality not yet supported by libata.\n");
370 printk(KERN_WARNING "Secondary ATA ports will not be activated.\n");
371 } 392 }
372 else if (id->driver_data == 1) /* 6260 */ 393 else if (id->driver_data == 1) /* 6260 */
373 ppi[0] = &info_626x; 394 ppi[0] = &info_626x;