linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: jeff@garzik.org, linux-ide@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, John Clark <clarkjc@runbox.com>
Subject: [PATCH 8/8] libata: implement ATA_HORKAGE_ATAPI_MOD16_DMA and apply it
Date: Mon,  3 Nov 2008 19:01:09 +0900	[thread overview]
Message-ID: <1225706469-27870-9-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1225706469-27870-1-git-send-email-tj@kernel.org>

libata always uses PIO for ATAPI commands when the number of bytes to
transfer isn't multiple of 16 but quantum DAT72 chokes on odd bytes
PIO transfers.  Implement a horkage to skip the mod16 check and apply
it to the quantum device.

This is reported by John Clark in the following thread.

  http://thread.gmane.org/gmane.linux.ide/34748

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: John Clark <clarkjc@runbox.com>
---
 drivers/ata/libata-core.c |    4 +++-
 include/linux/libata.h    |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 82af701..91b478f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4024,6 +4024,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
 
 	/* Weird ATAPI devices */
 	{ "TORiSAN DVD-ROM DRD-N216", NULL,	ATA_HORKAGE_MAX_SEC_128 },
+	{ "QUANTUM DAT    DAT72-000", NULL,	ATA_HORKAGE_ATAPI_MOD16_DMA },
 
 	/* Devices we expect to fail diagnostics */
 
@@ -4444,7 +4445,8 @@ int atapi_check_dma(struct ata_queued_cmd *qc)
 	/* Don't allow DMA if it isn't multiple of 16 bytes.  Quite a
 	 * few ATAPI devices choke on such DMA requests.
 	 */
-	if (unlikely(qc->nbytes & 15))
+	if (!(qc->dev->horkage & ATA_HORKAGE_ATAPI_MOD16_DMA) &&
+	    unlikely(qc->nbytes & 15))
 		return 1;
 
 	if (ap->ops->check_atapi_dma)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index cc0ceaf..a2eb8f2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -375,6 +375,8 @@ enum {
 	ATA_HORKAGE_IVB		= (1 << 8),	/* cbl det validity bit bugs */
 	ATA_HORKAGE_STUCK_ERR	= (1 << 9),	/* stuck ERR on next PACKET */
 	ATA_HORKAGE_BRIDGE_OK	= (1 << 10),	/* no bridge limits */
+	ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands
+						    not multiple of 16 bytes */
 
 	 /* DMA mask for user DMA control: User visible values; DO NOT
 	    renumber */
-- 
1.5.4.5


  parent reply	other threads:[~2008-11-03 10:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03 10:01 [PATCHSET #upstream-fixes] patches which fell off the crack during maintainership handover Tejun Heo
2008-11-03 10:01 ` [PATCH 1/8] Hibernation: Introduce system_entering_hibernation Tejun Heo
2008-11-04  6:14   ` Jeff Garzik
2008-11-03 10:01 ` [PATCH 2/8] DMI: Introduce dmi_first_match to make the interface more flexible Tejun Heo
2008-11-03 10:01 ` [PATCH 3/8] SATA: Blacklisting of systems that spin off disks during ACPI power off (rev. 2) Tejun Heo
2008-11-03 10:01 ` [PATCH 4/8] SATA AHCI: Blacklist system that spins off disks during ACPI power off Tejun Heo
2008-11-03 10:01 ` [PATCH 5/8] SATA Sil: " Tejun Heo
2008-11-03 10:01 ` [PATCH 6/8] SATA PIIX: " Tejun Heo
2008-11-03 10:01 ` [PATCH 7/8] libata: Fix a potential race condition in ata_scsi_park_show() Tejun Heo
2008-11-04  6:10   ` Jeff Garzik
2008-11-03 10:01 ` Tejun Heo [this message]
2008-11-04  6:11   ` [PATCH 8/8] libata: implement ATA_HORKAGE_ATAPI_MOD16_DMA and apply it 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=1225706469-27870-9-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=clarkjc@runbox.com \
    --cc=jeff@garzik.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).