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

Commit 9d51567e authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Artem Bityutskiy
Browse files

mtd: atmel_nand: modify test case for using DMA operations



We have better performances not using DMA for oob operations.
Modify size test so that it is using DMA for size greater than oobsize.

Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent cb457a4d
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -280,7 +280,8 @@ static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len)
	struct nand_chip *chip = mtd->priv;
	struct nand_chip *chip = mtd->priv;
	struct atmel_nand_host *host = chip->priv;
	struct atmel_nand_host *host = chip->priv;


	if (use_dma && len >= mtd->oobsize)
	if (use_dma && len > mtd->oobsize)
		/* only use DMA for bigger than oob size: better performances */
		if (atmel_nand_dma_op(mtd, buf, len, 1) == 0)
		if (atmel_nand_dma_op(mtd, buf, len, 1) == 0)
			return;
			return;


@@ -295,7 +296,8 @@ static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
	struct nand_chip *chip = mtd->priv;
	struct nand_chip *chip = mtd->priv;
	struct atmel_nand_host *host = chip->priv;
	struct atmel_nand_host *host = chip->priv;


	if (use_dma && len >= mtd->oobsize)
	if (use_dma && len > mtd->oobsize)
		/* only use DMA for bigger than oob size: better performances */
		if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0)
		if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0)
			return;
			return;