All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: John Clark <clarkjc@runbox.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	linux-ide@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Interoperability problem with Quantum CD72SH SATA tape drive and libata
Date: Sun, 05 Oct 2008 05:45:01 +0900	[thread overview]
Message-ID: <48E7D5CD.2000003@kernel.org> (raw)
In-Reply-To: <48E40415.7050607@runbox.com>

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

John Clark wrote:
>> We can create a HORKAGE for it.  Can you please post the result of
>> "hdparm -I" of the device?
>>
>>   
> Tejun,
> 
> Here it is:
> 
> /dev/nst0:
> 
> ATAPI Sequential-access device, with removable media
>    Model Number:       QUANTUM DAT    DAT72-000

Can you please test the attached patch?

Alan, John Clark is reporting that the above tape drive chokes on odd
byte PIO transfer, so the default condition check (qc->nbytes & 15) in
atapi_check_dma() breaks the SATA tape drive, so there's always one
which breaks the other way around.  :-(

For the time being, I think the horkage should do.  I was wondering
whether you still think we should lift the default mod16 check in
atapi_check_dma().

Thanks.

-- 
tejun

[-- Attachment #2: horkage_atapi_mod16_dma.patch --]
[-- Type: text/x-patch, Size: 1384 bytes --]

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1ee9499..e97afce 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4023,6 +4023,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 */
 
@@ -4436,7 +4437,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 8bb81d0..9d903b3 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -371,6 +371,8 @@ enum {
 	ATA_HORKAGE_IPM		= (1 << 7),	/* Link PM problems */
 	ATA_HORKAGE_IVB		= (1 << 8),	/* cbl det validity bit bugs */
 	ATA_HORKAGE_STUCK_ERR	= (1 << 9),	/* stuck ERR on next PACKET */
+	ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 10), /* use ATAPI DMA for commands
+						    not multiple of 16 bytes */
 
 	 /* DMA mask for user DMA control: User visible values; DO NOT
 	    renumber */

  reply	other threads:[~2008-10-04 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-27 20:25 Interoperability problem with Quantum CD72SH SATA tape drive and libata John Clark
2008-10-01  3:21 ` Tejun Heo
2008-10-01 23:13   ` John Clark
2008-10-04 20:45     ` Tejun Heo [this message]
2008-10-06 19:36       ` John Clark
2008-10-07  1:29         ` Tejun Heo

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=48E7D5CD.2000003@kernel.org \
    --to=tj@kernel.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=clarkjc@runbox.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.