]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.drivers/libata-add-and-use-HORKAGE_ATAPI_MOD16_DMA
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / libata-add-and-use-HORKAGE_ATAPI_MOD16_DMA
1 From 6a87e42e955ff27e07a77f65f8f077dc7c4171e1 Mon Sep 17 00:00:00 2001
2 From: Tejun Heo <tj@kernel.org>
3 Date: Mon, 3 Nov 2008 19:01:09 +0900
4 Subject: [PATCH] libata: implement ATA_HORKAGE_ATAPI_MOD16_DMA and apply it
5
6 libata always uses PIO for ATAPI commands when the number of bytes to
7 transfer isn't multiple of 16 but quantum DAT72 chokes on odd bytes
8 PIO transfers. Implement a horkage to skip the mod16 check and apply
9 it to the quantum device.
10
11 This is reported by John Clark in the following thread.
12
13 http://thread.gmane.org/gmane.linux.ide/34748
14
15 Signed-off-by: Tejun Heo <tj@kernel.org>
16 Cc: John Clark <clarkjc@runbox.com>
17 Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
18 Signed-off-by: Tejun Heo <teheo@suse.de>
19 ---
20 drivers/ata/libata-core.c | 4 +++-
21 include/linux/libata.h | 2 ++
22 2 files changed, 5 insertions(+), 1 deletion(-)
23
24 --- a/drivers/ata/libata-core.c
25 +++ b/drivers/ata/libata-core.c
26 @@ -4036,6 +4036,7 @@ static const struct ata_blacklist_entry
27
28 /* Weird ATAPI devices */
29 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
30 + { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
31
32 /* Devices we expect to fail diagnostics */
33
34 @@ -4519,7 +4520,8 @@ int atapi_check_dma(struct ata_queued_cm
35 /* Don't allow DMA if it isn't multiple of 16 bytes. Quite a
36 * few ATAPI devices choke on such DMA requests.
37 */
38 - if (unlikely(qc->nbytes & 15))
39 + if (!(qc->dev->horkage & ATA_HORKAGE_ATAPI_MOD16_DMA) &&
40 + unlikely(qc->nbytes & 15))
41 return 1;
42
43 if (ap->ops->check_atapi_dma)
44 --- a/include/linux/libata.h
45 +++ b/include/linux/libata.h
46 @@ -372,6 +372,8 @@ enum {
47 ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */
48 ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */
49 ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */
50 + ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands
51 + not multiple of 16 bytes */
52 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firwmare update warning */
53
54 /* DMA mask for user DMA control: User visible values; DO NOT