aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pmac.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:37 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:37 -0400
commite6830a86c260d73c6f370aa7ed17ee6c71e5ee05 (patch)
treec2c7d472184da1549852b86eef551609cddcbcbf /drivers/ide/pmac.c
parentb109f526cabcd098131e770fd6232282bce147b4 (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/pmac.c')
-rw-r--r--drivers/ide/pmac.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index 74625e821a43..904fb54668e8 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1429,10 +1429,10 @@ pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq)
1429 pmac_ide_hwif_t *pmif = 1429 pmac_ide_hwif_t *pmif =
1430 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); 1430 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
1431 struct dbdma_cmd *table; 1431 struct dbdma_cmd *table;
1432 int i, count = 0;
1433 volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; 1432 volatile struct dbdma_regs __iomem *dma = pmif->dma_regs;
1434 struct scatterlist *sg; 1433 struct scatterlist *sg;
1435 int wr = (rq_data_dir(rq) == WRITE); 1434 int wr = (rq_data_dir(rq) == WRITE);
1435 int i = hwif->sg_nents, count = 0;
1436 1436
1437 /* DMA table is already aligned */ 1437 /* DMA table is already aligned */
1438 table = (struct dbdma_cmd *) pmif->dma_table_cpu; 1438 table = (struct dbdma_cmd *) pmif->dma_table_cpu;
@@ -1442,11 +1442,6 @@ pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq)
1442 while (readl(&dma->status) & RUN) 1442 while (readl(&dma->status) & RUN)
1443 udelay(1); 1443 udelay(1);
1444 1444
1445 hwif->sg_nents = i = ide_build_sglist(drive, rq);
1446
1447 if (!i)
1448 return 0;
1449
1450 /* Build DBDMA commands list */ 1445 /* Build DBDMA commands list */
1451 sg = hwif->sg_table; 1446 sg = hwif->sg_table;
1452 while (i && sg_dma_len(sg)) { 1447 while (i && sg_dma_len(sg)) {