Merge tag 'mtd/for-4.20' of git://git.infradead.org/linux-mtd
[muen/linux.git] / drivers / mtd / nand / raw / denali.c
index 07a87717a3cad49da0fdc989440bc47c025d0436..830ea247277b1cac529e4814834eb20c05212e7f 100644 (file)
@@ -584,6 +584,12 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf,
        }
 
        iowrite32(DMA_ENABLE__FLAG, denali->reg + DMA_ENABLE);
+       /*
+        * The ->setup_dma() hook kicks DMA by using the data/command
+        * interface, which belongs to a different AXI port from the
+        * register interface.  Read back the register to avoid a race.
+        */
+       ioread32(denali->reg + DMA_ENABLE);
 
        denali_reset_irq(denali);
        denali->setup_dma(denali, dma_addr, page, write);