All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] scatterlist: sg_table from virtual pointer
@ 2016-03-31 12:29 ` Boris Brezillon
  0 siblings, 0 replies; 43+ messages in thread
From: Boris Brezillon @ 2016-03-31 12:29 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, linux-mtd, Andrew Morton, Dave Gordon
  Cc: Mark Brown, linux-spi, linux-arm-kernel, Vinod Koul,
	Dan Williams, dmaengine, Mauro Carvalho Chehab, Hans Verkuil,
	Laurent Pinchart, linux-media, Boris Brezillon,
	Richard Weinberger, Herbert Xu, David S. Miller, linux-crypto,
	Vignesh R, linux-mm, Joerg Roedel, iommu, linux-kernel

Hello,

This series has been extracted from another series [1] adding support
for DMA operations in a NAND driver.

The reason I decided to post those patches separately is because they
are touching core stuff, and I'd like to have feedback on these specific
aspects.

The idea is to provide a generic function creating an sg_table from
a virtual pointer and a length. This operation is complicated by
the different memory regions exposed in kernel space. For example,
you have the lowmem region, which guarantees that buffers are
physically contiguous, while the vmalloc region does not.

sg_alloc_table_from_buf() detects in which memory region your buffer
reside, and takes the appropriate precautions when creating the
sg_table. This function also takes an extract parameter, allowing
one to specify extra constraints, like the maximum DMA segment size,
the required and the preferred alignment.

Patch 1 and 2 are implementing sg_alloc_table_from_buf() (patch 1
is needed to properly detect buffers residing in the highmem/kmap
area).

Patch 3 is making use of sg_alloc_table_from_buf() in the spi_map_buf()
function (hopefully, other subsystems/drivers will be able to easily
switch to this function too).

Patch 4 is implementing what I really need: generic functions
to map/unmap a virtual buffer passed through mtd->_read/_write().

I'm not exactly a DMA or MM experts, so that would be great to have
feedbacks on this approach. That's why I added so many people in Cc
even if they're not directly impacted by those patches. Let me know if
you want me to drop/add people from/to the recipient list.

Thanks.

Best Regards,

Boris

[1]http://www.spinics.net/lists/arm-kernel/msg493552.html

Boris Brezillon (4):
  mm: add is_highmem_addr() helper
  scatterlist: add sg_alloc_table_from_buf() helper
  spi: use sg_alloc_table_from_buf()
  mtd: provide helper to prepare buffers for DMA operations

 drivers/mtd/mtdcore.c       |  66 ++++++++++++++++
 drivers/spi/spi.c           |  45 ++---------
 include/linux/highmem.h     |  13 ++++
 include/linux/mtd/mtd.h     |  25 ++++++
 include/linux/scatterlist.h |  24 ++++++
 lib/scatterlist.c           | 183 ++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 316 insertions(+), 40 deletions(-)

-- 
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2016-04-04 15:06 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-31 12:29 [PATCH 0/4] scatterlist: sg_table from virtual pointer Boris Brezillon
2016-03-31 12:29 ` Boris Brezillon
2016-03-31 12:29 ` Boris Brezillon
2016-03-31 12:29 ` [PATCH 1/4] mm: add is_highmem_addr() helper Boris Brezillon
2016-03-31 12:29   ` Boris Brezillon
2016-03-31 12:29   ` Boris Brezillon
2016-04-04  8:14   ` Vignesh R
2016-04-04  8:14     ` Vignesh R
2016-04-04  8:14     ` Vignesh R
2016-04-04  8:14     ` Vignesh R
     [not found]     ` <57022253.70400-l0cyMroinI0@public.gmane.org>
2016-04-04 15:05       ` Boris Brezillon
2016-04-04 15:05         ` Boris Brezillon
2016-04-04 15:05         ` Boris Brezillon
2016-04-04 15:05         ` Boris Brezillon
2016-04-04 15:05         ` Boris Brezillon
     [not found] ` <1459427384-21374-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-03-31 12:29   ` [PATCH 2/4] scatterlist: add sg_alloc_table_from_buf() helper Boris Brezillon
2016-03-31 12:29     ` Boris Brezillon
2016-03-31 12:29     ` Boris Brezillon
2016-03-31 12:29     ` Boris Brezillon
2016-03-31 14:14     ` Russell King - ARM Linux
2016-03-31 14:14       ` Russell King - ARM Linux
2016-03-31 14:14       ` Russell King - ARM Linux
     [not found]       ` <20160331141412.GK19428-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2016-03-31 14:45         ` Boris Brezillon
2016-03-31 14:45           ` Boris Brezillon
2016-03-31 14:45           ` Boris Brezillon
2016-03-31 14:45           ` Boris Brezillon
2016-03-31 15:09           ` Russell King - ARM Linux
2016-03-31 15:09             ` Russell King - ARM Linux
2016-03-31 15:09             ` Russell King - ARM Linux
2016-03-31 12:29 ` [PATCH 3/4] spi: use sg_alloc_table_from_buf() Boris Brezillon
2016-03-31 12:29   ` Boris Brezillon
2016-03-31 12:29   ` Boris Brezillon
     [not found]   ` <1459427384-21374-4-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-03-31 17:23     ` Mark Brown
2016-03-31 17:23       ` Mark Brown
2016-03-31 17:23       ` Mark Brown
2016-03-31 12:29 ` [PATCH 4/4] mtd: provide helper to prepare buffers for DMA operations Boris Brezillon
2016-03-31 12:29   ` Boris Brezillon
2016-03-31 12:29   ` Boris Brezillon
2016-04-01  3:13   ` kbuild test robot
2016-04-01  3:13     ` kbuild test robot
2016-04-01  3:13     ` kbuild test robot
2016-04-01  3:13     ` kbuild test robot
2016-04-01  3:13     ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.