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>

authored by Tejun Heo and committed by Jeff Garzik 6a87e42e a464189d

+5 -1
+3 -1
drivers/ata/libata-core.c
··· 4024 4025 /* Weird ATAPI devices */ 4026 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, 4027 4028 /* Devices we expect to fail diagnostics */ 4029 ··· 4445 /* Don't allow DMA if it isn't multiple of 16 bytes. Quite a 4446 * few ATAPI devices choke on such DMA requests. 4447 */ 4448 - if (unlikely(qc->nbytes & 15)) 4449 return 1; 4450 4451 if (ap->ops->check_atapi_dma)
··· 4024 4025 /* Weird ATAPI devices */ 4026 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, 4027 + { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, 4028 4029 /* Devices we expect to fail diagnostics */ 4030 ··· 4444 /* Don't allow DMA if it isn't multiple of 16 bytes. Quite a 4445 * few ATAPI devices choke on such DMA requests. 4446 */ 4447 + if (!(qc->dev->horkage & ATA_HORKAGE_ATAPI_MOD16_DMA) && 4448 + unlikely(qc->nbytes & 15)) 4449 return 1; 4450 4451 if (ap->ops->check_atapi_dma)
+2
include/linux/libata.h
··· 373 ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ 374 ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ 375 ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */ 376 377 /* DMA mask for user DMA control: User visible values; DO NOT 378 renumber */
··· 373 ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ 374 ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ 375 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 */ 378 379 /* DMA mask for user DMA control: User visible values; DO NOT 380 renumber */