stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "dma-debug: Fix dma_debug_entry offset calculation" has been added to the 3.14-stable tree
@ 2016-02-24  3:23 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-02-24  3:23 UTC (permalink / raw)
  To: danielmentz, dan.j.williams, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    dma-debug: Fix dma_debug_entry offset calculation

to the 3.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dma-debug-fix-dma_debug_entry-offset-calculation.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 0354aec19ce3d355c6213b0434064efc25c9b22c Mon Sep 17 00:00:00 2001
From: Daniel Mentz <danielmentz@google.com>
Date: Tue, 15 Dec 2015 17:38:48 -0800
Subject: dma-debug: Fix dma_debug_entry offset calculation

From: Daniel Mentz <danielmentz@google.com>

commit 0354aec19ce3d355c6213b0434064efc25c9b22c upstream.

dma-debug uses struct dma_debug_entry to keep track of dma coherent
memory allocation requests. The virtual address is converted into a pfn
and an offset. Previously, the offset was calculated using an incorrect
bit mask.  As a result, we saw incorrect error messages from dma-debug
like the following:

"DMA-API: exceeded 7 overlapping mappings of cacheline 0x03e00000"

Cacheline 0x03e00000 does not exist on our platform.

Fixes: 0abdd7a81b7e ("dma-debug: introduce debug_dma_assert_idle()")
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 lib/dma-debug.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -1440,7 +1440,7 @@ void debug_dma_alloc_coherent(struct dev
 	entry->type      = dma_debug_coherent;
 	entry->dev       = dev;
 	entry->pfn	 = page_to_pfn(virt_to_page(virt));
-	entry->offset	 = (size_t) virt & PAGE_MASK;
+	entry->offset	 = (size_t) virt & ~PAGE_MASK;
 	entry->size      = size;
 	entry->dev_addr  = dma_addr;
 	entry->direction = DMA_BIDIRECTIONAL;
@@ -1456,7 +1456,7 @@ void debug_dma_free_coherent(struct devi
 		.type           = dma_debug_coherent,
 		.dev            = dev,
 		.pfn		= page_to_pfn(virt_to_page(virt)),
-		.offset		= (size_t) virt & PAGE_MASK,
+		.offset		= (size_t) virt & ~PAGE_MASK,
 		.dev_addr       = addr,
 		.size           = size,
 		.direction      = DMA_BIDIRECTIONAL,


Patches currently in stable-queue which might be from danielmentz@google.com are

queue-3.14/dma-debug-fix-dma_debug_entry-offset-calculation.patch

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

only message in thread, other threads:[~2016-02-24  3:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24  3:23 Patch "dma-debug: Fix dma_debug_entry offset calculation" has been added to the 3.14-stable tree gregkh

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