Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4453011f authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: destroy DMA mappings after ending DMA (v2)



Move ide_destroy_dmatable() call out from ->dma_end method to
{ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
and sgiioc4_resetproc().

This causes minor/safe behavior changes w.r.t.:
* cmd64x.c::cmd64{8,x}_dma_end()
* cs5536.c::cs5536_dma_end()
* icside.c::icside_dma_end()
* it821x.c::it821x_dma_end()
* scc_pata.c::__scc_dma_end()
* sl82c105.c::sl82c105_dma_end()
* tx4939ide.c::tx4939ide_dma_end()

v2:
* Fix build for CONFIG_BLK_DEV_IDEDMA=n (reported by Randy Dunlap).

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1cee52de
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -280,8 +280,6 @@ static int auide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)

static int auide_dma_end(ide_drive_t *drive)
{
	ide_destroy_dmatable(drive);

	return 0;
}

+0 −2
Original line number Diff line number Diff line
@@ -327,8 +327,6 @@ static int cmd646_1_dma_end(ide_drive_t *drive)
	outb(dma_cmd & ~1, hwif->dma_base + ATA_DMA_CMD);
	/* clear the INTR & ERROR bits */
	outb(dma_stat | 6, hwif->dma_base + ATA_DMA_STATUS);
	/* and free any DMA resources */
	ide_destroy_dmatable(drive);
	/* verify good DMA status */
	return (dma_stat & 7) != 4;
}
+0 −3
Original line number Diff line number Diff line
@@ -291,9 +291,6 @@ static int icside_dma_end(ide_drive_t *drive)

	disable_dma(ec->dma);

	/* Teardown mappings after DMA has completed. */
	ide_destroy_dmatable(drive);

	return get_dma_residue(ec->dma) != 0;
}

+5 −2
Original line number Diff line number Diff line
@@ -342,8 +342,11 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
	stat = tp_ops->read_status(hwif);

	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
		if (hwif->dma_ops->dma_end(drive) ||
		    (drive->media == ide_tape && (stat & ATA_ERR))) {
		int rc = hwif->dma_ops->dma_end(drive);

		ide_destroy_dmatable(drive);

		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
			if (drive->media == ide_floppy)
				printk(KERN_ERR "%s: DMA %s error\n",
					drive->name, rq_data_dir(pc->rq)
+1 −0
Original line number Diff line number Diff line
@@ -639,6 +639,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
	if (dma) {
		drive->dma = 0;
		dma_error = hwif->dma_ops->dma_end(drive);
		ide_destroy_dmatable(drive);
		if (dma_error) {
			printk(KERN_ERR PFX "%s: DMA %s error\n", drive->name,
					write ? "write" : "read");
Loading