ide-cd: fix DMA alignment regression
authorBorislav Petkov <[email protected]>
Sun, 2 Nov 2008 20:40:07 +0000 (21:40 +0100)
committerBartlomiej Zolnierkiewicz <[email protected]>
Sun, 2 Nov 2008 20:40:07 +0000 (21:40 +0100)
e5318b531b008c79d2a0c0df06a7b8628da38e2f ("ide: use the dma safe check for
REQ_TYPE_ATA_PC") introduced a regression which caused some ATAPI drives to
turn off DMA for REQ_TYPE_BLOCK_PC commands while burning and thus degrading
performance and ultimately causing an excessive amount of underruns.

The issue is documented also in:
http://bugzilla.kernel.org/show_bug.cgi?id=11742.

Signed-off-by: Borislav Petkov <[email protected]>
Cc: FUJITA Tomonori <[email protected]>
Tested-by: Valerio Passini <[email protected]>
[bart: fixup patch description per comments from Sergei Shtylyov]
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
drivers/ide/ide-cd.c

index 48b5eda3ab41688e3bf65a0a9e72831fb59a92a4..42ab6d8715f26c6018201e32cace684d15d7435b 100644 (file)
@@ -1250,7 +1250,8 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
                 * separate masks.
                 */
                alignment = queue_dma_alignment(q) | q->dma_pad_mask;
-               if ((unsigned long)buf & alignment || rq->data_len & alignment
+               if ((unsigned long)buf & alignment
+                   || rq->data_len & q->dma_pad_mask
                    || object_is_on_stack(buf))
                        drive->dma = 0;
        }