Skip to content

Commit 6a87e42

Browse files
htejunJeff Garzik
authored andcommitted
libata: implement ATA_HORKAGE_ATAPI_MOD16_DMA and apply it
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> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
1 parent a464189 commit 6a87e42

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/ata/libata-core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4024,6 +4024,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
40244024

40254025
/* Weird ATAPI devices */
40264026
{ "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
4027+
{ "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
40274028

40284029
/* Devices we expect to fail diagnostics */
40294030

@@ -4444,7 +4445,8 @@ int atapi_check_dma(struct ata_queued_cmd *qc)
44444445
/* Don't allow DMA if it isn't multiple of 16 bytes. Quite a
44454446
* few ATAPI devices choke on such DMA requests.
44464447
*/
4447-
if (unlikely(qc->nbytes & 15))
4448+
if (!(qc->dev->horkage & ATA_HORKAGE_ATAPI_MOD16_DMA) &&
4449+
unlikely(qc->nbytes & 15))
44484450
return 1;
44494451

44504452
if (ap->ops->check_atapi_dma)

include/linux/libata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ enum {
373373
ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */
374374
ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */
375375
ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */
376+
ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands
377+
not multiple of 16 bytes */
376378

377379
/* DMA mask for user DMA control: User visible values; DO NOT
378380
renumber */

0 commit comments

Comments
 (0)