public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Why move all map_sg/unmap_sg for slave channel to its client?
@ 2011-06-09  6:54 viresh kumar
  2011-06-09  9:38 ` Linus Walleij
  0 siblings, 1 reply; 5+ messages in thread
From: viresh kumar @ 2011-06-09  6:54 UTC (permalink / raw)
  To: Koul, Vinod, Dan Williams
  Cc: linux-kernel@vger.kernel.org, anemo, Shiraz HASHIM,
	Armando VISCONTI, Bhupesh SHARMA


Hi,

I thought map_sg/unmap_sg for slave channels will be handled according
to the flags passed in prep_slave_sg(). But then i found following patch:

commit 657a77fa7284d8ae28dfa48f1dc5d919bf5b2843
Author: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date:   Tue Sep 8 17:53:05 2009 -0700

    dmaengine: Move all map_sg/unmap_sg for slave channel to its client
    
    Dan Williams wrote:
    ... DMA-slave clients request specific channels and know the hardware
    details at a low level, so it should not be too high an expectation to
    push dma mapping responsibility to the client.
    
    Also this patch includes DMA_COMPL_{SRC,DEST}_UNMAP_SINGLE support for
    dw_dmac driver.
    
    Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
    Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
    Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/dma/at_hdmac.c       |   43 +++++++++++++++++++++--------------------
 drivers/dma/dw_dmac.c        |   31 ++++++++++++++++++-----------
 drivers/mmc/host/atmel-mci.c |    9 +++++++-
 3 files changed, 49 insertions(+), 34 deletions(-)


I don't have much knowledge about that discussion, but i think this should be left
configurable. If the client wants to control map/unmap then it can simply pass
DMA_COMPL_SKIP_DEST_UNMAP | DMA_COMPL_SKIP_SRC_UNMAP in flags. I didn't wanted to
skip this in my driver and so i don't pass them.

Why to replicate similar code in client drivers if they need to unmap? What do you say?

-- 
viresh

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

end of thread, other threads:[~2011-06-10 13:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09  6:54 Why move all map_sg/unmap_sg for slave channel to its client? viresh kumar
2011-06-09  9:38 ` Linus Walleij
2011-06-09 18:28   ` Dan Williams
2011-06-10  3:41     ` viresh kumar
2011-06-10 13:19       ` Atsushi Nemoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox