aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-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 d41348f2245e..1d261298d61a 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,
514 /* Request to transfer the entire buffer at once */ 514 /* Request to transfer the entire buffer at once */
515 bcount = min(pc->req_xfer, 63 * 1024); 515 bcount = min(pc->req_xfer, 63 * 1024);
516 516
517 if (drive->using_dma && !idescsi_map_sg(drive, pc)) { 517 if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma) {
518 hwif->sg_mapped = 1; 518 hwif->sg_mapped = 1;
519 dma = !hwif->dma_ops->dma_setup(drive); 519 dma = !hwif->dma_ops->dma_setup(drive);
520 hwif->sg_mapped = 0; 520 hwif->sg_mapped = 0;
521 } 521 }
522 522
523 ide_pktcmd_tf_load(drive, 0, bcount, dma); 523 if (!dma)
524 pc->flags &= ~PC_FLAG_DMA_OK;
524 525
525 if (dma) 526 ide_pktcmd_tf_load(drive, 0, bcount, dma);
526 pc->flags |= PC_FLAG_DMA_OK;
527 527
528 if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) { 528 if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) {
529 ide_execute_command(drive, WIN_PACKETCMD, &idescsi_transfer_pc, 529 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
547 rq->sector, rq->nr_sectors, rq->current_nr_sectors); 547 rq->sector, rq->nr_sectors, rq->current_nr_sectors);
548 548
549 if (blk_sense_request(rq) || blk_special_request(rq)) { 549 if (blk_sense_request(rq) || blk_special_request(rq)) {
550 return idescsi_issue_pc(drive, 550 struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special;
551 (struct ide_atapi_pc *) rq->special); 551
552 if (drive->using_dma && !idescsi_map_sg(drive, pc))
553 pc->flags |= PC_FLAG_DMA_OK;
554
555 return idescsi_issue_pc(drive, pc);
552 } 556 }
553 blk_dump_rq_flags(rq, "ide-scsi: unsup command"); 557 blk_dump_rq_flags(rq, "ide-scsi: unsup command");
554 idescsi_end_request (drive, 0, 0); 558 idescsi_end_request (drive, 0, 0);