aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 21:21:58 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 21:21:58 +0200
commit4cc196897de9e6c02cf86debc5b9f7cf1b69a214 (patch)
tree70aebe4c447f6ce48ff10909779382000fd8b6da /drivers
parent594c16d8dd54cd7b1c5ef1ec3ac0f6bf34301dad (diff)
ide-scsi: move idescsi_map_sg() call out from idescsi_issue_pc()
Move idescsi_map_sg() call out from idescsi_issue_pc() to idescsi_do_request() as a preparation to adding generic ide_issue_pc() helper. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ide-scsi.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index d41348f2245..1d261298d61 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -514,16 +514,16 @@ static ide_startstop_t idescsi_issue_pc(ide_drive_t *drive,
/* Request to transfer the entire buffer at once */
bcount = min(pc->req_xfer, 63 * 1024);
- if (drive->using_dma && !idescsi_map_sg(drive, pc)) {
+ if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma) {
hwif->sg_mapped = 1;
dma = !hwif->dma_ops->dma_setup(drive);
hwif->sg_mapped = 0;
}
- ide_pktcmd_tf_load(drive, 0, bcount, dma);
+ if (!dma)
+ pc->flags &= ~PC_FLAG_DMA_OK;
- if (dma)
- pc->flags |= PC_FLAG_DMA_OK;
+ ide_pktcmd_tf_load(drive, 0, bcount, dma);
if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) {
ide_execute_command(drive, WIN_PACKETCMD, &idescsi_transfer_pc,
@@ -547,8 +547,12 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r
rq->sector, rq->nr_sectors, rq->current_nr_sectors);
if (blk_sense_request(rq) || blk_special_request(rq)) {
- return idescsi_issue_pc(drive,
- (struct ide_atapi_pc *) rq->special);
+ struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special;
+
+ if (drive->using_dma && !idescsi_map_sg(drive, pc))
+ pc->flags |= PC_FLAG_DMA_OK;
+
+ return idescsi_issue_pc(drive, pc);
}
blk_dump_rq_flags(rq, "ide-scsi: unsup command");
idescsi_end_request (drive, 0, 0);