lkml.org 
[lkml]   [2016]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag
On Mon,  8 Feb 2016 17:30:50 +0000 Brian Starkey <brian.starkey@arm.com> wrote:

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

The patch generally looks OK to me. It generates rejects against
linux-next because of some janitorial changes in memremap.c.


> @@ -101,6 +107,11 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
> addr = ioremap_wt(offset, size);
> }
>
> + if (!addr && (flags & MEMREMAP_WC)) {
> + flags &= ~MEMREMAP_WC;
> + addr = ioremap_wc(offset, size);
> + }
> +
> return addr;
> }

The modifications of `flags' is unneeded (and the compiler will remove
it). And generally the modification of incoming args is a bit nasty
IMO - I find it's better to treat them as const - part of the calling
environment which can be relied upon to be unaltered as the code
evolves.

\
 
 \ /
  Last update: 2016-02-08 21:21    [W:0.124 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site