aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index f72b5a67543..2b9ac210667 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -631,18 +631,23 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive)
631 struct ide_atapi_pc *pc; 631 struct ide_atapi_pc *pc;
632 ide_hwif_t *hwif = drive->hwif; 632 ide_hwif_t *hwif = drive->hwif;
633 ide_expiry_t *expiry = NULL; 633 ide_expiry_t *expiry = NULL;
634 struct request *rq = hwif->rq;
634 unsigned int timeout; 635 unsigned int timeout;
635 u32 tf_flags; 636 u32 tf_flags;
636 u16 bcount; 637 u16 bcount;
637 638
638 if (dev_is_idecd(drive)) { 639 if (dev_is_idecd(drive)) {
639 tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL; 640 tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
640 bcount = ide_cd_get_xferlen(hwif->rq); 641 bcount = ide_cd_get_xferlen(rq);
641 expiry = ide_cd_expiry; 642 expiry = ide_cd_expiry;
642 timeout = ATAPI_WAIT_PC; 643 timeout = ATAPI_WAIT_PC;
643 644
644 if (drive->dma) 645 if (drive->dma) {
645 drive->dma = !hwif->dma_ops->dma_setup(drive); 646 if (ide_build_sglist(drive, rq))
647 drive->dma = !hwif->dma_ops->dma_setup(drive);
648 else
649 drive->dma = 0;
650 }
646 } else { 651 } else {
647 pc = drive->pc; 652 pc = drive->pc;
648 653
@@ -661,8 +666,12 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive)
661 } 666 }
662 667
663 if ((pc->flags & PC_FLAG_DMA_OK) && 668 if ((pc->flags & PC_FLAG_DMA_OK) &&
664 (drive->dev_flags & IDE_DFLAG_USING_DMA)) 669 (drive->dev_flags & IDE_DFLAG_USING_DMA)) {
665 drive->dma = !hwif->dma_ops->dma_setup(drive); 670 if (ide_build_sglist(drive, rq))
671 drive->dma = !hwif->dma_ops->dma_setup(drive);
672 else
673 drive->dma = 0;
674 }
666 675
667 if (!drive->dma) 676 if (!drive->dma)
668 pc->flags &= ~PC_FLAG_DMA_OK; 677 pc->flags &= ~PC_FLAG_DMA_OK;