1. 27 10月, 2015 1 次提交
    • D
      memremap: fix highmem support · 182475b7
      Dan Williams 提交于
      Currently memremap checks if the range is "System RAM" and returns the
      kernel linear address.  This is broken for highmem platforms where a
      range may be "System RAM", but is not part of the kernel linear mapping.
      Fallback to ioremap_cache() in these cases, to let the arch code attempt
      to handle it.
      
      Note that ARM ioremap will WARN when attempting to remap ram, and in
      that case the caller needs to be fixed.  For this reason, existing
      ioremap_cache() usages for ARM are already trained to avoid attempts to
      remap ram.
      
      The impact of this bug is low for now since the pmem driver is the only
      user of memremap(), but this is important to fix before more conversions
      to memremap arrive in 4.4.
      
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reported-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      182475b7
  2. 10 10月, 2015 4 次提交
  3. 28 8月, 2015 1 次提交
  4. 15 8月, 2015 2 次提交
    • C
      devres: add devm_memremap · 7d3dcf26
      Christoph Hellwig 提交于
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      7d3dcf26
    • D
      arch: introduce memremap() · 92281dee
      Dan Williams 提交于
      Existing users of ioremap_cache() are mapping memory that is known in
      advance to not have i/o side effects.  These users are forced to cast
      away the __iomem annotation, or otherwise neglect to fix the sparse
      errors thrown when dereferencing pointers to this memory.  Provide
      memremap() as a non __iomem annotated ioremap_*() in the case when
      ioremap is otherwise a pointer to cacheable memory. Empirically,
      ioremap_<cacheable-type>() call sites are seeking memory-like semantics
      (e.g.  speculative reads, and prefetching permitted).
      
      memremap() is a break from the ioremap implementation pattern of adding
      a new memremap_<type>() for each mapping type and having silent
      compatibility fall backs.  Instead, the implementation defines flags
      that are passed to the central memremap() and if a mapping type is not
      supported by an arch memremap returns NULL.
      
      We introduce a memremap prototype as a trivial wrapper of
      ioremap_cache() and ioremap_wt().  Later, once all ioremap_cache() and
      ioremap_wt() usage has been removed from drivers we teach archs to
      implement arch_memremap() with the ability to strictly enforce the
      mapping type.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      92281dee