diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:37 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:37 -0400 |
commit | e6830a86c260d73c6f370aa7ed17ee6c71e5ee05 (patch) | |
tree | c2c7d472184da1549852b86eef551609cddcbcbf /drivers/ide/ide-atapi.c | |
parent | b109f526cabcd098131e770fd6232282bce147b4 (diff) |
ide: call ide_build_sglist() prior to ->dma_setup (v2)
* Re-map sg table if needed in ide_build_sglist().
* Move ide_build_sglist() call from ->dma_setup to its users.
* Un-export ide_build_sglist().
v2:
* Build fix for CONFIG_BLK_DEV_IDEDMA=n (noticed by Randy Dunlap).
There should be no functional changes caused by this patch.
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r-- | drivers/ide/ide-atapi.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index f72b5a675435..2b9ac2106674 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; |