sata_mv: basic PIO-only ATAPI support?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(resending, with different email address for Alan).

Tejun / Alan,

I'm now venturing into the labyrinth that is presented
when one tries to combine a nice FIS-based controller/driver
with old school BMDMA for ATAPI only.

To preserve my own sanity, I'm opting for basic PIO-only
support for ATAPI to begin with.  Then I'll add the DMA functions
to speed things up afterward.

This patch (below) seems to work 100% okay for me here,
apart from the sata_mv chipset errata warnings it generates
(another thing I hope to tidy up soon-ish).

Question: is this the "right" way to force PIO-only,
or is there a better mechanism that I'm missing.

It just seems.. too easy this way.  :)

Thanks.

* * *

Add basic ATAPI support to sata_mv using PIO + polling.
DMA support will be added later.

Signed-off-by: Mark Lord <mlord@xxxxxxxxx>

--- old/drivers/ata/sata_mv.c	2009-01-23 11:20:57.000000000 -0500
+++ linux/drivers/ata/sata_mv.c	2009-01-23 12:02:20.000000000 -0500
@@ -120,7 +120,7 @@
	MV_FLAG_IRQ_COALESCE	= (1 << 29),  /* IRQ coalescing capability */

	MV_COMMON_FLAGS		= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
-				  ATA_FLAG_MMIO | ATA_FLAG_NO_ATAPI |
+				  ATA_FLAG_MMIO |
				  ATA_FLAG_PIO_POLLING,

	MV_6XXX_FLAGS		= MV_FLAG_IRQ_COALESCE,
@@ -502,6 +502,7 @@
static void mv_eh_freeze(struct ata_port *ap);
static void mv_eh_thaw(struct ata_port *ap);
static void mv6_dev_config(struct ata_device *dev);
+static void mv_dev_config(struct ata_device *dev);

static void mv5_phy_errata(struct mv_host_priv *hpriv, void __iomem *mmio,
			   unsigned int port);
@@ -576,6 +577,7 @@
	.error_handler		= ata_std_error_handler, /* avoid SFF EH */
	.post_internal_cmd	= ATA_OP_NULL,

+	.dev_config             = mv_dev_config,
	.scr_read		= mv5_scr_read,
	.scr_write		= mv5_scr_write,

@@ -597,7 +599,7 @@

static struct ata_port_operations mv_iie_ops = {
	.inherits		= &mv6_ops,
-	.dev_config		= ATA_OP_NULL,
+	.dev_config             = mv_dev_config,
	.qc_prep		= mv_qc_prep_iie,
};

@@ -1082,6 +1084,21 @@
		return -EINVAL;
}

+static void mv_dev_config(struct ata_device *adev)
+{
+	/*
+	 * Support ATAPI devices via PIO-only for now.
+	 * DMA support is planned for later.
+	 */
+	if (adev->class == ATA_DEV_ATAPI) {
+		adev->xfer_shift = ATA_SHIFT_PIO;
+		adev->flags |= ATA_DFLAG_PIO;
+		ata_dev_printk(adev, KERN_INFO, DRV_NAME
+				": ATAPI DMA not yet implemented;"
+				" using (slow) PIO for now\n");
+	}
+}
+
static void mv6_dev_config(struct ata_device *adev)
{
	/*
@@ -1097,6 +1114,7 @@
				"NCQ disabled for command-based switching\n");
		}
	}
+	mv_dev_config(adev);
}

static int mv_qc_defer(struct ata_queued_cmd *qc)
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux