aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2008-02-18 19:41:26 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-18 19:41:26 -0500
commit14e04c3f6e64bac468f0aa38c6d47aa95b60c074 (patch)
treecd36afdec1da344f14b74145a8aacc6f28b10cc0 /drivers/ide/ide-cd.c
parent0e7d8d480259319649f7a2c230622b98758d1c83 (diff)
ide-cd: fix missing residual count setting in DMA mode
This patch fixes the missing residual count setting in DMA mode, which was introduced during the conversion to blk-end-request. The residual count could be used by the request submitter. So if it isn't set correctly, some upper layers does not work. (e.g. wodim for CD burning.) The bug is in only DMA mode. In PIO mode, we are setting the residual count correctly, so no need to fix. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Reported-by: Andreas Schwab <schwab@suse.de> Tested-by: Andreas Schwab <schwab@suse.de> Tested-by: Laura Garcia <nevola@gmail.com> Tested-by: Borislav Petkov <petkovbb@googlemail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 354c91d06a6d..310e497b5838 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
1207end_request: 1207end_request:
1208 if (blk_pc_request(rq)) { 1208 if (blk_pc_request(rq)) {
1209 unsigned long flags; 1209 unsigned long flags;
1210 unsigned int dlen = rq->data_len;
1211
1212 if (dma)
1213 rq->data_len = 0;
1210 1214
1211 spin_lock_irqsave(&ide_lock, flags); 1215 spin_lock_irqsave(&ide_lock, flags);
1212 if (__blk_end_request(rq, 0, rq->data_len)) 1216 if (__blk_end_request(rq, 0, dlen))
1213 BUG(); 1217 BUG();
1214 HWGROUP(drive)->rq = NULL; 1218 HWGROUP(drive)->rq = NULL;
1215 spin_unlock_irqrestore(&ide_lock, flags); 1219 spin_unlock_irqrestore(&ide_lock, flags);