Re: [PATCH 03/10] ide: destroy DMA mappings after ending DMA

From: Grant Grundler
Date: Sat Mar 14 2009 - 03:13:26 EST


On Fri, Feb 20, 2009 at 6:12 PM, Bartlomiej Zolnierkiewicz
<bzolnier@xxxxxxxxx> wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
> Subject: [PATCH] ide: destroy DMA mappings after ending DMA
>
> 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().
...
> --- a/drivers/ide/ide-dma-sff.c
> +++ b/drivers/ide/ide-dma-sff.c
> @@ -310,8 +310,6 @@ int ide_dma_end(ide_drive_t *drive)
> Â Â Â Â/* clear INTR & ERROR bits */
> Â Â Â Âide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
>
> - Â Â Â /* purge DMA mappings */
> - Â Â Â ide_destroy_dmatable(drive);
> Â Â Â Âwmb();

Bartlomiej,
I think the wmb() could removed as well. The outb/writeb functions are
required to be strongly ordered and I don't see anything else touching
DMA-able memory here.

BTW, care to remove "mask" usage from this function?
It's really not needed (can be replaced with #define).

I can create separate patches for both. Which git tree should I base
them against?

...
> --- a/drivers/ide/scc_pata.c
> +++ b/drivers/ide/scc_pata.c
> @@ -365,8 +365,6 @@ static int __scc_dma_end(ide_drive_t *dr
> Â Â Â Âdma_stat = scc_dma_sff_read_status(hwif);
> Â Â Â Â/* clear the INTR & ERROR bits */
> Â Â Â Âscc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
> - Â Â Â /* purge DMA mappings */
> - Â Â Â ide_destroy_dmatable(drive);
> Â Â Â Â/* verify good DMA status */
> Â Â Â Âwmb();

I think this wmb() can be removed too.

....
> --- a/drivers/ide/tx4939ide.c
> +++ b/drivers/ide/tx4939ide.c
> @@ -335,11 +335,9 @@ static int tx4939ide_dma_end(ide_drive_t
> Â Â Â Â/* read and clear the INTR & ERROR bits */
> Â Â Â Âdma_stat = tx4939ide_clear_dma_status(base);
>
> - Â Â Â /* purge DMA mappings */
> - Â Â Â ide_destroy_dmatable(drive);
> - Â Â Â /* verify good DMA status */
> Â Â Â Âwmb();

and this one as well.

hth,
grant
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/