diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2009-02-02 14:12:21 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-02-02 14:12:21 -0500 |
commit | 9e772d0135a5b5f8355320be429efa339700d52d (patch) | |
tree | 4c707a5a8b08d81fc62c29fd224b9901d79645a4 /drivers/ide | |
parent | 27421e211a39784694b597dbf35848b88363c248 (diff) |
ide-cd: fix DMA for non bio-backed requests
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>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 3 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index cae69372cf45..0bfeb0c79d6e 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -787,6 +787,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
787 | if (blk_fs_request(rq)) { | 787 | if (blk_fs_request(rq)) { |
788 | ide_end_request(drive, 1, rq->nr_sectors); | 788 | ide_end_request(drive, 1, rq->nr_sectors); |
789 | return ide_stopped; | 789 | return ide_stopped; |
790 | } else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) { | ||
791 | ide_end_request(drive, 1, 1); | ||
792 | return ide_stopped; | ||
790 | } | 793 | } |
791 | goto end_request; | 794 | goto end_request; |
792 | } | 795 | } |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index cc163319dfbd..9ee51adf567f 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -418,11 +418,14 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq) | |||
418 | ide_hwif_t *hwif = drive->hwif; | 418 | ide_hwif_t *hwif = drive->hwif; |
419 | struct scatterlist *sg = hwif->sg_table; | 419 | struct scatterlist *sg = hwif->sg_table; |
420 | 420 | ||
421 | if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) { | 421 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { |
422 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); | ||
423 | } else { | ||
424 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); | 422 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); |
425 | hwif->sg_nents = 1; | 423 | hwif->sg_nents = 1; |
424 | } else if (!rq->bio) { | ||
425 | sg_init_one(sg, rq->data, rq->data_len); | ||
426 | hwif->sg_nents = 1; | ||
427 | } else { | ||
428 | hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); | ||
426 | } | 429 | } |
427 | } | 430 | } |
428 | 431 | ||