devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] mtd: nand: sunxi: add support for DMA operations
@ 2016-03-08 11:15 Boris Brezillon
       [not found] ` <1457435715-24740-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Boris Brezillon @ 2016-03-08 11:15 UTC (permalink / raw)
  To: Andrew Morton, Dave Gordon, David Woodhouse, Brian Norris,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Maxime Ripard,
	Chen-Yu Tsai, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Vinod Koul,
	Dan Williams, dmaengine-u79uwXL29TY76Z2rM5mHXA,
	Mauro Carvalho Chehab, Hans Verkuil, Laurent Pinchart,
	linux-media-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Boris Brezillon

Hello,

This patch series aims at adding support for DMA assisted operations to
the sunxi_nand driver.

The first 3 patches are just reworks in the existing driver preparing
things for DMA ->read/write_page() operations. Those ones are mainly
re-arranging existing functions, and moving some code into dedicated
functions so we can reuse them when adding the read/write_page()
implementation.

Patch 4 is an attempt to generalize some logic that are duplicated in a
lot of places. It provides a generic solution to create an SG table
from a buffer (passed by virtual address) and its length.
This generic implementation tries to take all possible constraints into
account, like:
- vmallocated buffers
- alignement requirement/preference
- maximum DMA transfer length

I may have missed other things (is there a need for a minimum DMA
transfer constraint?), so don't hesitate to point problems or missing
elements in this implementation.
Note that other subsystems doing the same kind of thing (like SPI of V4L)
could use this implementation. This is why I've put the SPI and V4L
maintainers in Cc.

Patch 5 is providing functions to map/unmap buffers for DMA operations
at the MTD level. This will hopefully limit the number of open-coded
implementations we're currently seeing in a lot of NAND drivers.
Of course, it's making use of sg_alloc_table_from_buf(), introduced in
patch 4.

Patch 6 and 7 are patching the sunxi NAND driver and its DT binding doc
to add DMA support.

I'm particularly interested in getting feedbacks on patch 4 and 5.
Is there a reason nobody ever tried to create such generic functions
(at the scatterlist and MTD levels), and if there are, could you detail
them?

Thanks,

Boris

Side note: patches touching the sunxi NAND driver are depending on
a series posted yesterday [1].

[1]https://lkml.org/lkml/2016/3/7/444

Boris Brezillon (7):
  mtd: nand: sunxi: move some ECC related operations to their own
    functions
  mtd: nand: sunxi: make OOB retrieval optional
  mtd: nand: sunxi: make cur_off parameter optional in extra oob helpers
  scatterlist: add sg_alloc_table_from_buf() helper
  mtd: provide helper to prepare buffers for DMA operations
  mtd: nand: sunxi: add support for DMA assisted operations
  mtd: nand: sunxi: update DT bindings

 .../devicetree/bindings/mtd/sunxi-nand.txt         |   4 +
 drivers/mtd/mtdcore.c                              |  66 +++
 drivers/mtd/nand/sunxi_nand.c                      | 483 ++++++++++++++++++---
 include/linux/mtd/mtd.h                            |  25 ++
 include/linux/scatterlist.h                        |  24 +
 lib/scatterlist.c                                  | 142 ++++++
 6 files changed, 679 insertions(+), 65 deletions(-)

-- 
2.1.4

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

end of thread, other threads:[~2016-03-21 15:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 11:15 [PATCH 0/7] mtd: nand: sunxi: add support for DMA operations Boris Brezillon
     [not found] ` <1457435715-24740-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-03-08 11:15   ` [PATCH 1/7] mtd: nand: sunxi: move some ECC related operations to their own functions Boris Brezillon
2016-03-08 11:15   ` [PATCH 2/7] mtd: nand: sunxi: make OOB retrieval optional Boris Brezillon
2016-03-08 11:15   ` [PATCH 3/7] mtd: nand: sunxi: make cur_off parameter optional in extra oob helpers Boris Brezillon
2016-03-08 11:15   ` [PATCH 4/7] scatterlist: add sg_alloc_table_from_buf() helper Boris Brezillon
     [not found]     ` <1457435715-24740-5-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-03-08 16:51       ` Laurent Pinchart
2016-03-08 16:57         ` Boris Brezillon
2016-03-21 15:46       ` Boris Brezillon
2016-03-08 11:15   ` [PATCH 5/7] mtd: provide helper to prepare buffers for DMA operations Boris Brezillon
     [not found]     ` <1457435715-24740-6-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-03-08 14:18       ` Vinod Koul
2016-03-08 14:46         ` Boris Brezillon
2016-03-08 11:15   ` [PATCH 6/7] mtd: nand: sunxi: add support for DMA assisted operations Boris Brezillon
     [not found]     ` <1457435715-24740-7-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-03-17 14:06       ` Boris Brezillon
2016-03-08 11:15   ` [PATCH 7/7] mtd: nand: sunxi: update DT bindings Boris Brezillon
2016-03-17 15:28     ` Rob Herring

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).