Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102068
b: refs/heads/master
c: e5318b5
h: refs/heads/master
v: v3
  • Loading branch information
FUJITA Tomonori authored and Bartlomiej Zolnierkiewicz committed Jul 16, 2008
1 parent e1956a3 commit 53ada02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b6abc17700a7843b165c677da0ac94522f83083
refs/heads/master: e5318b531b008c79d2a0c0df06a7b8628da38e2f
17 changes: 12 additions & 5 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,12 +1191,17 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
info->dma = 0;

/* sg request */
if (rq->bio) {
int mask = drive->queue->dma_alignment;
unsigned long addr =
(unsigned long)page_address(bio_page(rq->bio));
if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) {
struct request_queue *q = drive->queue;
unsigned int alignment;
unsigned long addr;
unsigned long stack_mask = ~(THREAD_SIZE - 1);

if (rq->bio)
addr = (unsigned long)bio_data(rq->bio);
else
addr = (unsigned long)rq->data;

info->dma = drive->using_dma;

/*
Expand All @@ -1205,7 +1210,8 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
* NOTE! The "len" and "addr" checks should possibly have
* separate masks.
*/
if ((rq->data_len & 15) || (addr & mask))
alignment = queue_dma_alignment(q) | q->dma_pad_mask;
if (addr & alignment || rq->data_len & alignment)
info->dma = 0;

if (!((addr & stack_mask) ^
Expand Down Expand Up @@ -1877,6 +1883,7 @@ static int ide_cdrom_setup(ide_drive_t *drive)

blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
blk_queue_dma_alignment(drive->queue, 31);
blk_queue_update_dma_pad(drive->queue, 15);
drive->queue->unplug_delay = (1 * HZ) / 1000;
if (!drive->queue->unplug_delay)
drive->queue->unplug_delay = 1;
Expand Down

0 comments on commit 53ada02

Please sign in to comment.