All of lore.kernel.org
 help / color / mirror / Atom feed
From: viresh kumar <viresh.kumar@st.com>
To: "Koul, Vinod" <vinod.koul@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	<anemo@mba.ocn.ne.jp>, Shiraz HASHIM <shiraz.hashim@st.com>,
	Armando VISCONTI <armando.visconti@st.com>,
	Bhupesh SHARMA <bhupesh.sharma@st.com>
Subject: Why move all map_sg/unmap_sg for slave channel to its client?
Date: Thu, 9 Jun 2011 12:24:33 +0530	[thread overview]
Message-ID: <4DF06E29.4010807@st.com> (raw)


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

             reply	other threads:[~2011-06-09  6:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  6:54 viresh kumar [this message]
2011-06-09  9:38 ` Why move all map_sg/unmap_sg for slave channel to its client? Linus Walleij
2011-06-09 18:28   ` Dan Williams
2011-06-10  3:41     ` viresh kumar
2011-06-10 13:19       ` Atsushi Nemoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DF06E29.4010807@st.com \
    --to=viresh.kumar@st.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=armando.visconti@st.com \
    --cc=bhupesh.sharma@st.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shiraz.hashim@st.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.