Skip to content

Commit

Permalink
ide-cd: fix DMA for non bio-backed requests
Browse files Browse the repository at this point in the history
This one fixes http://bugzilla.kernel.org/show_bug.cgi?id=12320.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Feb 2, 2009
1 parent 27421e2 commit 9e772d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
if (blk_fs_request(rq)) {
ide_end_request(drive, 1, rq->nr_sectors);
return ide_stopped;
} else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) {
ide_end_request(drive, 1, 1);
return ide_stopped;
}
goto end_request;
}
Expand Down
9 changes: 6 additions & 3 deletions drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,14 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq)
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;

if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) {
hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
} else {
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
hwif->sg_nents = 1;
} else if (!rq->bio) {
sg_init_one(sg, rq->data, rq->data_len);
hwif->sg_nents = 1;
} else {
hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
}
}

Expand Down

0 comments on commit 9e772d0

Please sign in to comment.