Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82142
b: refs/heads/master
c: 062f9f0
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 1, 2008
1 parent 9f7c3c8 commit 7ddc5db
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c05ff68b9a9b40a9be949497e0aa980185565cf
refs/heads/master: 062f9f024dcdb927cfd35c9ee8a68f59cbb1136f
21 changes: 2 additions & 19 deletions trunk/drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,6 @@ static void icside_maskproc(ide_drive_t *drive, int mask)
* interfaces use the same IRQ, which should guarantee this.
*/

static void icside_build_sglist(ide_drive_t *drive, struct request *rq)
{
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;

ide_map_sg(drive, rq);

if (rq_data_dir(rq) == READ)
hwif->sg_dma_direction = DMA_FROM_DEVICE;
else
hwif->sg_dma_direction = DMA_TO_DEVICE;

hwif->sg_nents = dma_map_sg(hwif->dev, sg, hwif->sg_nents,
hwif->sg_dma_direction);
}

/*
* Configure the IOMD to give the appropriate timings for the transfer
* mode being requested. We take the advice of the ATA standards, and
Expand Down Expand Up @@ -298,8 +282,7 @@ static int icside_dma_end(ide_drive_t *drive)
disable_dma(ec->dma);

/* Teardown mappings after DMA has completed. */
dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents,
hwif->sg_dma_direction);
ide_destroy_dmatable(drive);

return get_dma_residue(ec->dma) != 0;
}
Expand Down Expand Up @@ -331,7 +314,7 @@ static int icside_dma_setup(ide_drive_t *drive)
*/
BUG_ON(dma_channel_active(ec->dma));

icside_build_sglist(drive, rq);
hwif->sg_nents = ide_build_sglist(drive, rq);

/*
* Ensure that we have the right interrupt routed.
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ static int ide_dma_good_drive(ide_drive_t *drive)
return ide_in_drive_list(drive->id, drive_whitelist);
}

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
/**
* ide_build_sglist - map IDE scatter gather for DMA I/O
* @drive: the drive to build the DMA table for
Expand Down Expand Up @@ -200,6 +199,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)

EXPORT_SYMBOL_GPL(ide_build_sglist);

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
/**
* ide_build_dmatable - build IDE DMA table
*
Expand Down Expand Up @@ -294,6 +294,7 @@ int ide_build_dmatable (ide_drive_t *drive, struct request *rq)
}

EXPORT_SYMBOL_GPL(ide_build_dmatable);
#endif

/**
* ide_destroy_dmatable - clean up DMA mapping
Expand All @@ -316,6 +317,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)

EXPORT_SYMBOL_GPL(ide_destroy_dmatable);

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
/**
* config_drive_for_dma - attempt to activate IDE DMA
* @drive: the drive to place in DMA mode
Expand Down
28 changes: 3 additions & 25 deletions trunk/drivers/ide/mips/au1xxx-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,23 +209,6 @@ static void auide_set_dma_mode(ide_drive_t *drive, const u8 speed)
*/

#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA

static int auide_build_sglist(ide_drive_t *drive, struct request *rq)
{
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;

ide_map_sg(drive, rq);

if (rq_data_dir(rq) == READ)
hwif->sg_dma_direction = DMA_FROM_DEVICE;
else
hwif->sg_dma_direction = DMA_TO_DEVICE;

return dma_map_sg(hwif->dev, sg, hwif->sg_nents,
hwif->sg_dma_direction);
}

static int auide_build_dmatable(ide_drive_t *drive)
{
int i, iswrite, count = 0;
Expand All @@ -240,8 +223,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
/* Save for interrupt context */
ahwif->drive = drive;

/* Build sglist */
hwif->sg_nents = i = auide_build_sglist(drive, rq);
hwif->sg_nents = i = ide_build_sglist(drive, rq);

if (!i)
return 0;
Expand Down Expand Up @@ -299,10 +281,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
return 1;

use_pio_instead:
dma_unmap_sg(hwif->dev,
hwif->sg_table,
hwif->sg_nents,
hwif->sg_dma_direction);
ide_destroy_dmatable(drive);

return 0; /* revert to PIO for this request */
}
Expand All @@ -312,8 +291,7 @@ static int auide_dma_end(ide_drive_t *drive)
ide_hwif_t *hwif = HWIF(drive);

if (hwif->sg_nents) {
dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents,
hwif->sg_dma_direction);
ide_destroy_dmatable(drive);
hwif->sg_nents = 0;
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1155,10 +1155,11 @@ void ide_dma_on(ide_drive_t *);
int ide_set_dma(ide_drive_t *);
ide_startstop_t ide_dma_intr(ide_drive_t *);

int ide_build_sglist(ide_drive_t *, struct request *);
void ide_destroy_dmatable(ide_drive_t *);

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
extern int ide_build_sglist(ide_drive_t *, struct request *);
extern int ide_build_dmatable(ide_drive_t *, struct request *);
extern void ide_destroy_dmatable(ide_drive_t *);
extern int ide_release_dma(ide_hwif_t *);
extern void ide_setup_dma(ide_hwif_t *, unsigned long);

Expand Down

0 comments on commit 7ddc5db

Please sign in to comment.