+ memremap-add-memremap_wc-flag.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: memremap: add MEMREMAP_WC flag
has been added to the -mm tree.  Its filename is
     memremap-add-memremap_wc-flag.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/memremap-add-memremap_wc-flag.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/memremap-add-memremap_wc-flag.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: Brian Starkey <brian.starkey@xxxxxxx>
Subject: memremap: add MEMREMAP_WC flag

Add a flag to memremap() for writecombine mappings.  Mappings satisfied by
this flag will not be cached, however writes may be delayed or combined
into more efficient bursts.  This is most suitable for buffers written
sequentially by the CPU for use by other DMA devices.

Signed-off-by: Brian Starkey <brian.starkey@xxxxxxx>
Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/io.h |    1 +
 kernel/memremap.c  |   13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff -puN include/linux/io.h~memremap-add-memremap_wc-flag include/linux/io.h
--- a/include/linux/io.h~memremap-add-memremap_wc-flag
+++ a/include/linux/io.h
@@ -135,6 +135,7 @@ enum {
 	/* See memremap() kernel-doc for usage description... */
 	MEMREMAP_WB = 1 << 0,
 	MEMREMAP_WT = 1 << 1,
+	MEMREMAP_WC = 1 << 2,
 };
 
 void *memremap(resource_size_t offset, size_t size, unsigned long flags);
diff -puN kernel/memremap.c~memremap-add-memremap_wc-flag kernel/memremap.c
--- a/kernel/memremap.c~memremap-add-memremap_wc-flag
+++ a/kernel/memremap.c
@@ -41,11 +41,13 @@ static void *try_ram_remap(resource_size
  * memremap() - remap an iomem_resource as cacheable memory
  * @offset: iomem resource start address
  * @size: size of remap
- * @flags: either MEMREMAP_WB or MEMREMAP_WT
+ * @flags: any of MEMREMAP_WB, MEMREMAP_WT and MEMREMAP_WC
  *
  * memremap() is "ioremap" for cases where it is known that the resource
  * being mapped does not have i/o side effects and the __iomem
- * annotation is not applicable.
+ * annotation is not applicable. In the case of multiple flags, the different
+ * mapping types will be attempted in the order listed below until one of
+ * them succeeds.
  *
  * MEMREMAP_WB - matches the default mapping for System RAM on
  * the architecture.  This is usually a read-allocate write-back cache.
@@ -57,6 +59,10 @@ static void *try_ram_remap(resource_size
  * cache or are written through to memory and never exist in a
  * cache-dirty state with respect to program visibility.  Attempts to
  * map System RAM with this mapping type will fail.
+ *
+ * MEMREMAP_WC - establish a writecombine mapping, whereby writes may
+ * be coalesced together (e.g. in the CPU's write buffers), but is otherwise
+ * uncached. Attempts to map System RAM with this mapping type will fail.
  */
 void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 {
@@ -102,6 +108,9 @@ void *memremap(resource_size_t offset, s
 	if (!addr && (flags & MEMREMAP_WT))
 		addr = ioremap_wt(offset, size);
 
+	if (!addr && (flags & MEMREMAP_WC))
+		addr = ioremap_wc(offset, size);
+
 	return addr;
 }
 EXPORT_SYMBOL(memremap);
_

Patches currently in -mm which might be from brian.starkey@xxxxxxx are

memremap-dont-modify-flags.patch
memremap-add-memremap_wc-flag.patch
drivers-dma-coherent-use-memremap_wc-for-dma_memory_map.patch
drivers-dma-coherent-use-memset_io-for-dma_memory_io-mappings.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux