All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* + arc-convert-to-dma_map_ops-fix-2.patch added to -mm tree
@ 2015-12-23 20:13 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2015-12-23 20:13 UTC (permalink / raw
  To: vgupta, CARLOS.PALMINHA, hch, sfr, mm-commits


The patch titled
     Subject: ARC: dma mapping fixes #2
has been added to the -mm tree.  Its filename is
     arc-convert-to-dma_map_ops-fix-2.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/arc-convert-to-dma_map_ops-fix-2.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/arc-convert-to-dma_map_ops-fix-2.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Vineet Gupta <vgupta@synopsys.com>
Subject: ARC: dma mapping fixes #2

Carlos Palminha reported linux-next boot broken for ARC.

(1) dma_map_single() would recursively call itself

| #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL)
| dma_map_single_attrs
|   ops->map_page
|     arc_dma_map_page
|        dma_map_single

(2) arc_dma_free() to iounmap if memory is coherent

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Reported-by: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/arc/mm/dma.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff -puN arch/arc/mm/dma.c~arc-convert-to-dma_map_ops-fix-2 arch/arc/mm/dma.c
--- a/arch/arc/mm/dma.c~arc-convert-to-dma_map_ops-fix-2
+++ a/arch/arc/mm/dma.c
@@ -72,8 +72,8 @@ static void *arc_dma_alloc(struct device
 static void arc_dma_free(struct device *dev, size_t size, void *vaddr,
 		dma_addr_t dma_handle, struct dma_attrs *attrs)
 {
-	if (!(is_isa_arcv2() && ioc_exists) ||
-	    dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs))
+	if (!dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs) &&
+	    !(is_isa_arcv2() && ioc_exists))
 		iounmap((void __force __iomem *)vaddr);
 
 	free_pages_exact((void *)dma_handle, size);
@@ -107,7 +107,8 @@ static dma_addr_t arc_dma_map_page(struc
 		struct dma_attrs *attrs)
 {
 	unsigned long paddr = page_to_phys(page) + offset;
-	return dma_map_single(dev, (void *)paddr, size, dir);
+	_dma_cache_sync(paddr, size, dir);
+	return (dma_addr_t)paddr;
 }
 
 static int arc_dma_map_sg(struct device *dev, struct scatterlist *sg,
_

Patches currently in -mm which might be from vgupta@synopsys.com are

arc-convert-to-dma_map_ops-fix-2.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-23 20:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-23 20:13 + arc-convert-to-dma_map_ops-fix-2.patch added to -mm tree akpm

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.