linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [PATCH 0/3] scatterlist: Add support to clone sg_table
@ 2016-06-17 22:45 Franklin S Cooper Jr
  2016-06-17 22:45 ` [RFC] [PATCH 1/3] lib/scatterlist: " Franklin S Cooper Jr
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Franklin S Cooper Jr @ 2016-06-17 22:45 UTC (permalink / raw)
  To: broonie, linux-kernel, linux-spi, david.s.gordon, akpm, nsekhar,
	vigneshr, peter.ujfalusi
  Cc: Franklin S Cooper Jr

This patchset creates two new functions within scatterlist that allows a
user to pass in a sg_table and receive a duplicate copy. The sgl in this
copied table are dynamically allocated but its values such as offset,
length and dma_address are the same as its variant within the sgl in the
original sg_table.

This is useful when tweaks to sgl may be needed to alter a future DMA
operation by tweaking the table nents count or the individual sgl
offset/length without changing the original values.

An example use case is also included in this patchset. In the omap2-mcspi
driver on certain OMAP SOCs if certain conditions are met the DMA should
transfer one or two less elements when reading from the SPI. The
remaining bytes are read in CPU mode. To accomplish this the spi's rx_sg
sgl should have the last entry length reduced for the DMA operation.
However, this change should only be done locally so instead of altering
the original sgl this new function allows a clone to be created.

Franklin S Cooper Jr (3):
  lib/scatterlist: Add support to clone sg_table
  spi: omap2-mcspi: Add comments for RX only DMA buffer workaround
  spi: omap2-mcspi: Use the SPI framework to handle DMA mapping

 drivers/spi/spi-omap2-mcspi.c | 122 +++++++++++++++++-------------------------
 include/linux/scatterlist.h   |   2 +
 lib/scatterlist.c             |  93 ++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+), 73 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2016-07-05 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 22:45 [RFC] [PATCH 0/3] scatterlist: Add support to clone sg_table Franklin S Cooper Jr
2016-06-17 22:45 ` [RFC] [PATCH 1/3] lib/scatterlist: " Franklin S Cooper Jr
2016-06-22 15:18   ` Mark Brown
2016-06-17 22:45 ` [RFC] [PATCH 2/3] spi: omap2-mcspi: Add comments for RX only DMA buffer workaround Franklin S Cooper Jr
2016-07-05 14:50   ` Applied "spi: omap2-mcspi: Add comments for RX only DMA buffer workaround" to the spi tree Mark Brown
2016-06-17 22:45 ` [RFC] [PATCH 3/3] spi: omap2-mcspi: Use the SPI framework to handle DMA mapping Franklin S Cooper Jr

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