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

Commit edafcf73 authored by Grant Grundler's avatar Grant Grundler Committed by Bartlomiej Zolnierkiewicz
Browse files

ide: remove wmb() from ide-dma-sff.c and scc_pata.c



This patch:
o replaces "mask" variable in ide_dma_end() with #define.
o removes use of wmb() in ide-dma-sff.c and scc_pata.c.
o is not tested - I don't have (or want) the HW.

Signed-off-by: default avatarGrant Grundler <grundler@google.com>
Cc: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent d1881207
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -277,8 +277,6 @@ void ide_dma_start(ide_drive_t *drive)
		dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
		dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
		outb(dma_cmd | ATA_DMA_START, hwif->dma_base + ATA_DMA_CMD);
		outb(dma_cmd | ATA_DMA_START, hwif->dma_base + ATA_DMA_CMD);
	}
	}

	wmb();
}
}
EXPORT_SYMBOL_GPL(ide_dma_start);
EXPORT_SYMBOL_GPL(ide_dma_start);


@@ -286,7 +284,7 @@ EXPORT_SYMBOL_GPL(ide_dma_start);
int ide_dma_end(ide_drive_t *drive)
int ide_dma_end(ide_drive_t *drive)
{
{
	ide_hwif_t *hwif = drive->hwif;
	ide_hwif_t *hwif = drive->hwif;
	u8 dma_stat = 0, dma_cmd = 0, mask;
	u8 dma_stat = 0, dma_cmd = 0;


	/* stop DMA */
	/* stop DMA */
	if (hwif->host_flags & IDE_HFLAG_MMIO) {
	if (hwif->host_flags & IDE_HFLAG_MMIO) {
@@ -304,11 +302,10 @@ int ide_dma_end(ide_drive_t *drive)
	/* clear INTR & ERROR bits */
	/* clear INTR & ERROR bits */
	ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
	ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);


	wmb();
#define CHECK_DMA_MASK (ATA_DMA_ACTIVE | ATA_DMA_ERR | ATA_DMA_INTR)


	/* verify good DMA status */
	/* verify good DMA status */
	mask = ATA_DMA_ACTIVE | ATA_DMA_ERR | ATA_DMA_INTR;
	if ((dma_stat & CHECK_DMA_MASK) != ATA_DMA_INTR)
	if ((dma_stat & mask) != ATA_DMA_INTR)
		return 0x10 | dma_stat;
		return 0x10 | dma_stat;
	return 0;
	return 0;
}
}
+0 −2
Original line number Original line Diff line number Diff line
@@ -337,7 +337,6 @@ static void scc_dma_start(ide_drive_t *drive)


	/* start DMA */
	/* start DMA */
	scc_ide_outb(dma_cmd | 1, hwif->dma_base);
	scc_ide_outb(dma_cmd | 1, hwif->dma_base);
	wmb();
}
}


static int __scc_dma_end(ide_drive_t *drive)
static int __scc_dma_end(ide_drive_t *drive)
@@ -354,7 +353,6 @@ static int __scc_dma_end(ide_drive_t *drive)
	/* clear the INTR & ERROR bits */
	/* clear the INTR & ERROR bits */
	scc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
	scc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
	/* verify good DMA status */
	/* verify good DMA status */
	wmb();
	return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0;
	return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0;
}
}