linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads
@ 2017-05-15 22:23 Boris Brezillon
  2017-05-15 22:23 ` [PATCH 2/2] mtd: nand: sunxi: Remove unneeded ->cmdfunc(NAND_CMD_READ0, 0, page) Boris Brezillon
  2017-05-29 18:53 ` [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads Boris Brezillon
  0 siblings, 2 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-05-15 22:23 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen

ecc->read_subpage is set to sunxi_nfc_hw_ecc_read_subpage_dma when
->dmac != NULL, but is then unconditionally overwritten in the common
init path.

Remove this extra assignment to allow usage of the DMA operation when
possible.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/mtd/nand/sunxi_nand.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index 118a26fff368..a4e43026c35d 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -1922,7 +1922,6 @@ static int sunxi_nand_hw_ecc_ctrl_init(struct mtd_info *mtd,
 	ecc->write_subpage = sunxi_nfc_hw_ecc_write_subpage;
 	ecc->read_oob_raw = nand_read_oob_std;
 	ecc->write_oob_raw = nand_write_oob_std;
-	ecc->read_subpage = sunxi_nfc_hw_ecc_read_subpage;
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] mtd: nand: sunxi: Remove unneeded ->cmdfunc(NAND_CMD_READ0, 0, page)
  2017-05-15 22:23 [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads Boris Brezillon
@ 2017-05-15 22:23 ` Boris Brezillon
  2017-05-29 18:53 ` [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-05-15 22:23 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Cyrille Pitchen

The core already sends the NAND_CMD_READ0 for us. Duplicating this call
in the driver is useless and introduces a perf penalty.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/mtd/nand/sunxi_nand.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index a4e43026c35d..84bcee5b0fa0 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -1301,7 +1301,6 @@ static int sunxi_nfc_hw_ecc_read_subpage(struct mtd_info *mtd,
 
 	sunxi_nfc_hw_ecc_enable(mtd);
 
-	chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
 	for (i = data_offs / ecc->size;
 	     i < DIV_ROUND_UP(data_offs + readlen, ecc->size); i++) {
 		int data_off = i * ecc->size;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads
  2017-05-15 22:23 [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads Boris Brezillon
  2017-05-15 22:23 ` [PATCH 2/2] mtd: nand: sunxi: Remove unneeded ->cmdfunc(NAND_CMD_READ0, 0, page) Boris Brezillon
@ 2017-05-29 18:53 ` Boris Brezillon
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-05-29 18:53 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, linux-mtd
  Cc: Marek Vasut, Brian Norris, David Woodhouse, Cyrille Pitchen

On Tue, 16 May 2017 00:23:45 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> ecc->read_subpage is set to sunxi_nfc_hw_ecc_read_subpage_dma when
> ->dmac != NULL, but is then unconditionally overwritten in the common  
> init path.
> 
> Remove this extra assignment to allow usage of the DMA operation when
> possible.
> 

Applied both to nand/next.

> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>  drivers/mtd/nand/sunxi_nand.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index 118a26fff368..a4e43026c35d 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
> @@ -1922,7 +1922,6 @@ static int sunxi_nand_hw_ecc_ctrl_init(struct mtd_info *mtd,
>  	ecc->write_subpage = sunxi_nfc_hw_ecc_write_subpage;
>  	ecc->read_oob_raw = nand_read_oob_std;
>  	ecc->write_oob_raw = nand_write_oob_std;
> -	ecc->read_subpage = sunxi_nfc_hw_ecc_read_subpage;
>  
>  	return 0;
>  }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-29 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-15 22:23 [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads Boris Brezillon
2017-05-15 22:23 ` [PATCH 2/2] mtd: nand: sunxi: Remove unneeded ->cmdfunc(NAND_CMD_READ0, 0, page) Boris Brezillon
2017-05-29 18:53 ` [PATCH 1/2] mtd: nand: sunxi: Actually use DMA for subpage reads Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).