From: Christoph Hellwig <hch@lst.de>
To: Richard Kuo <rkuo@codeaurora.org>
Cc: linux-hexagon@vger.kernel.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] hexagon: implement the sync_sg_for_device DMA operation
Date: Thu, 19 Jul 2018 05:56:34 -0700 [thread overview]
Message-ID: <20180719125635.824-3-hch@lst.de> (raw)
In-Reply-To: <20180719125635.824-1-hch@lst.de>
This methods needs to provide the equivalent of sync_single_for_device
for each S/G list element, but was missing.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/hexagon/kernel/dma.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c
index d2b717f352f4..9e46556a227d 100644
--- a/arch/hexagon/kernel/dma.c
+++ b/arch/hexagon/kernel/dma.c
@@ -188,6 +188,18 @@ static void hexagon_sync_single_for_device(struct device *dev,
dma_sync(dma_addr_to_virt(dma_handle), size, dir);
}
+static void hexagon_sync_sg_for_device(struct device *dev,
+ struct scatterlist *sgl, int nents, enum dma_data_direction dir)
+{
+ struct scatterlist *sg;
+ int i;
+
+ for_each_sg(sgl, sg, nents, i)
+ hexagon_sync_single_for_device(dev, sg_dma_address(sg),
+ sg->length, dir);
+}
+
+
static int hexagon_mapping_error(struct device *dev, dma_addr_t dma_addr)
{
return dma_addr == HEXAGON_MAPPING_ERROR;
@@ -199,6 +211,7 @@ const struct dma_map_ops hexagon_dma_ops = {
.map_sg = hexagon_map_sg,
.map_page = hexagon_map_page,
.sync_single_for_device = hexagon_sync_single_for_device,
+ .sync_sg_for_device = hexagon_sync_sg_for_device,
.mapping_error = hexagon_mapping_error,
};
--
2.18.0
next prev parent reply other threads:[~2018-07-19 12:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 12:56 use the generic dma-noncoherent code for hexagon Christoph Hellwig
2018-07-19 12:56 ` [PATCH 1/3] hexagon: remove the sync_single_for_cpu DMA operation Christoph Hellwig
[not found] ` <20180719125635.824-2-hch-jcswGhMUV9g@public.gmane.org>
2018-07-25 3:29 ` Richard Kuo
[not found] ` <20180725032948.GG12771-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-07-25 4:39 ` Christoph Hellwig
2018-07-31 15:22 ` Christoph Hellwig
[not found] ` <20180731152229.GA956-jcswGhMUV9g@public.gmane.org>
2018-08-07 7:01 ` Christoph Hellwig
[not found] ` <20180807070136.GA32634-jcswGhMUV9g@public.gmane.org>
2018-08-08 0:19 ` Richard Kuo
2018-08-08 6:19 ` Christoph Hellwig
2018-08-27 8:41 ` Christoph Hellwig
2018-07-19 12:56 ` Christoph Hellwig [this message]
2018-07-19 12:56 ` [PATCH 3/3] hexagon: use generic dma_noncoherent_ops Christoph Hellwig
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=20180719125635.824-3-hch@lst.de \
--to=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkuo@codeaurora.org \
/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 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).