From: Mark Lord <liml@rtr.ca>
To: Tejun Heo <htejun@gmail.com>, Alan Cox <alan@redhat.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: sata_mv: basic PIO-only ATAPI support?
Date: Fri, 23 Jan 2009 12:20:21 -0500 [thread overview]
Message-ID: <4979FC55.1000904@rtr.ca> (raw)
In-Reply-To: <4978028D.3020501@gmail.com>
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@pobox.com>
--- 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)
next prev parent reply other threads:[~2009-01-23 17:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 23:04 [PATCH 01/04] sata_mv: fix 8-port timeouts on 508x/6081 chips Mark Lord
2009-01-19 23:05 ` [PATCH 02/04] sata_mv: don't read hc_irq_cause Mark Lord
2009-01-19 23:06 ` [PATCH 03/04] sata_mv: remove bogus nsect restriction Mark Lord
2009-01-19 23:07 ` [PATCH 04/04] sata_mv: msi masking Mark Lord
2009-01-20 18:19 ` [PATCH 05/04] sata_mv: msi fix and cleanup Mark Lord
2009-01-20 18:49 ` [PATCH 06/06] sata_mv: remove experimental designation Mark Lord
2009-01-21 1:54 ` [PATCH 04/04] sata_mv: msi masking Grant Grundler
2009-01-21 15:15 ` Mark Lord
2009-01-21 15:31 ` [PATCH 04/05] sata_mv: msi masking fix (v2) Mark Lord
2009-01-21 15:34 ` [PATCH 05/05] sata_mv: no longer experimental (v2) Mark Lord
2009-01-26 11:43 ` Jeff Garzik
2009-01-21 17:03 ` [PATCH 04/05] sata_mv: msi masking fix (v2) Grant Grundler
2009-01-22 1:02 ` Tejun Heo
2009-01-22 5:17 ` Mark Lord
2009-01-22 5:19 ` Mark Lord
2009-01-22 5:22 ` Tejun Heo
2009-01-23 17:20 ` Mark Lord [this message]
2009-01-23 17:23 ` sata_mv: basic PIO-only ATAPI support? Mark Lord
2009-01-23 17:52 ` Alan Cox
2009-01-23 18:37 ` Mark Lord
2009-01-26 11:42 ` [PATCH 04/05] sata_mv: msi masking fix (v2) Jeff Garzik
2009-01-26 11:39 ` [PATCH 01/04] sata_mv: fix 8-port timeouts on 508x/6081 chips Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4979FC55.1000904@rtr.ca \
--to=liml@rtr.ca \
--cc=alan@redhat.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.