1. 25 4月, 2017 1 次提交
    • L
      ARM: Implement pci_remap_cfgspace() interface · b9cdbe6e
      Lorenzo Pieralisi 提交于
      The PCI bus specification (rev 3.0, 3.2.5 "Transaction Ordering and
      Posting") defines rules for PCI configuration space transactions ordering
      and posting, that state that configuration writes have to be non-posted
      transactions.
      
      Current ioremap interface on ARM provides mapping functions that provide
      "bufferable" writes transactions (ie ioremap uses MT_DEVICE memory type)
      aka posted writes, so PCI host controller drivers have no arch interface to
      remap PCI configuration space with memory attributes that comply with the
      PCI specifications for configuration space.
      
      Implement an ARM specific pci_remap_cfgspace() interface that allows to map
      PCI config memory regions with MT_UNCACHED memory type (ie strongly ordered
      - non-posted writes), providing a remap function that complies with PCI
      specifications for config space transactions.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      b9cdbe6e
  2. 01 11月, 2016 1 次提交
  3. 21 6月, 2016 1 次提交
  4. 04 4月, 2016 2 次提交
    • A
      ARM: memremap: implement arch_memremap_wb() · 9ab9e4fc
      Ard Biesheuvel 提交于
      The generic memremap() falls back to using ioremap_cache() to create
      MEMREMAP_WB mappings if the requested region is not already covered
      by the linear mapping, unless the architecture provides an implementation
      of arch_memremap_wb().
      
      Since ioremap_cache() is not appropriate on ARM to map memory with the
      same attributes used for the linear mapping, implement arch_memremap_wb()
      which does exactly that. Also, relax the WARN() check to allow MT_MEMORY_RW
      mappings of pfn_valid() pages.
      
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      9ab9e4fc
    • A
      ARM: reintroduce ioremap_cached() for creating cached I/O mappings · 20c5ea4f
      Ard Biesheuvel 提交于
      The original ARM-only ioremap flavor 'ioremap_cached' has been renamed
      to 'ioremap_cache' to align with other architectures, and subsequently
      abused in generic code to map things like firmware tables in memory.
      For that reason, there is currently an effort underway to deprecate
      ioremap_cache, whose semantics are poorly defined, and which is typed
      with an __iomem annotation that is inappropriate for mappings of ordinary
      memory.
      
      However, original users of ioremap_cached() used it in a context where
      the I/O connotation is appropriate, and replacing those instances with
      memremap() does not make sense. So let's revive ioremap_cached(), so
      that we can change back those original users before we drop ioremap_cache
      entirely in favor of memremap.
      
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      20c5ea4f
  5. 04 7月, 2015 2 次提交
  6. 03 7月, 2015 2 次提交
  7. 07 6月, 2015 1 次提交
    • T
      arch/*/io.h: Add ioremap_wt() to all architectures · 556269c1
      Toshi Kani 提交于
      Add ioremap_wt() to all arch-specific asm/io.h headers which
      define ioremap_wc() locally. These headers do not include
      <asm-generic/iomap.h>. Some of them include <asm-generic/io.h>,
      but ioremap_wt() is defined for consistency since they define
      all ioremap_xxx locally.
      
      In all architectures without Write-Through support, ioremap_wt()
      is defined indentical to ioremap_nocache().
      
      frv and m68k already have ioremap_writethrough(). On those we
      add ioremap_wt() indetical to ioremap_writethrough() and defines
      ARCH_HAS_IOREMAP_WT in both architectures.
      
      The ioremap_wt() interface is exported to drivers.
      Signed-off-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Elliott@hp.com
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Luis R. Rodriguez <mcgrof@suse.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: arnd@arndb.de
      Cc: hch@lst.de
      Cc: hmh@hmh.eng.br
      Cc: jgross@suse.com
      Cc: konrad.wilk@oracle.com
      Cc: linux-mm <linux-mm@kvack.org>
      Cc: linux-nvdimm@lists.01.org
      Cc: stefan.bader@canonical.com
      Cc: yigal@plexistor.com
      Link: http://lkml.kernel.org/r/1433436928-31903-9-git-send-email-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
      556269c1
  8. 08 5月, 2015 2 次提交
    • R
      ARM: optimize memset_io()/memcpy_fromio()/memcpy_toio() · 7ddfe625
      Russell King 提交于
      If we are building for a LE platform, and we haven't overriden the
      MMIO ops, then we can optimize the mem*io operations using the
      standard string functions.
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7ddfe625
    • P
      ARM: 8341/1: io: Unpessimize relaxed io accessors · 5bb5d66d
      Peter Hurley 提交于
      commit 195bbcac ("ARM: 7500/1: io: avoid writeback addressing
      modes for __raw_ accessors") disables writeback addressing modes for
      raw i/o. However, the "+Q" output constraint forces the compiler to
      disable load hoist optimizations (because the output constraint informs the
      compiler of memory stores which the compiler assumes may alias other memory).
      
      Since the relaxed accessors only guarantee ordering wrt i/o accesses to the
      same device and not to main memory, there's never a possibility of an accessor
      invalidating a hoisted load (because only non-i/o loads would have been hoisted).
      
      The effect is especially noticable with complex address inputs in loops.
      For example, the following code:
      
          #include <linux/kernel.h>
          #include <linux/io.h>
      
          static const int *remap;
      
          void wr_loop(void __iomem *base, int c, int val)
          {
                  int i;
      
                  for (i = 0; i < c; i++)
                          writew_relaxed(val, base + remap[c >> 2]);
          }
      
      generates
      
                 current master             |             this patch
       0: e3510000    cmp     r1, #0        |  0: e3510000    cmp     r1, #0
       4: d12fff1e    bxle    lr            |  4: d12fff1e    bxle    lr
       8: e3003000    movw    r3, #0        |  8: e3c1c003    bic     ip, r1, #3
       c: e3403000    movt    r3, #0        |  c: e6ff2072    uxth    r2, r2
      10: e92d4010    push    {r4, lr}      | 10: e3a03000    mov     r3, #0
      14: e6ff2072    uxth    r2, r2        | 14: e59cc000    ldr     ip, [ip]
      18: e3c14003    bic     r4, r1, #3    | 18: e080000c    add     r0, r0, ip
      1c: e593e000    ldr     lr, [r3]      |
      20: e3a03000    mov     r3, #0        | 1c: e1c020b0    strh    r2, [r0]
                                            | 20: e2833001    add     r3, r3, #1
      24: e79ec004    ldr     ip, [lr, r4]  | 24: e1530001    cmp     r3, r1
      28: e080c00c    add     ip, r0, ip    | 28: 1afffffb    bne     1c
      2c: e1cc20b0    strh    r2, [ip]      | 2c: e12fff1e    bx      lr
      30: e2833001    add     r3, r3, #1    |
      34: e1530001    cmp     r3, r1        |
      38: 1afffff9    bne     24            |
                                            |
      3c: e8bd8010    pop     {r4, pc}      |
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      5bb5d66d
  9. 10 11月, 2014 1 次提交
  10. 01 10月, 2014 1 次提交
  11. 01 6月, 2014 1 次提交
    • T
      ARM: 8060/1: mm: allow sub-architectures to override PCI I/O memory type · 1c8c3cf0
      Thomas Petazzoni 提交于
      Due to a design incompatibility between the PCIe Marvell controller
      and the Cortex-A9, stressing PCIe devices with a lot of traffic
      quickly causes a deadlock.
      
      One part of the workaround for this is to have all PCIe regions mapped
      as strongly-ordered (MT_UNCACHED) instead of the default
      MT_DEVICE. While the arch_ioremap_caller() mechanism allows
      sub-architecture code to override ioremap(), used to map PCIe memory
      regions, there isn't such a mechanism to override the behavior of
      pci_ioremap_io().
      
      This commit adds the arch_pci_ioremap_mem_type variable, initialized
      to MT_DEVICE by default, and that sub-architecture code can
      override. We have chosen to expose a single variable rather than
      offering the possibility of overriding the entire pci_ioremap_io(),
      because implementing pci_ioremap_io() requires calling functions
      (get_mem_type()) that are private to the arch/arm/mm/ code.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      1c8c3cf0
  12. 28 1月, 2014 1 次提交
  13. 05 1月, 2014 1 次提交
  14. 29 12月, 2013 1 次提交
    • R
      ARM: 7896/1: rename ioremap_cached to ioremap_cache · 92341c83
      Rob Herring 提交于
      ioremap_cache is more aligned with other architectures. There are only
      2 users of this in the kernel: pxa2xx-flash and Xen.
      
      This fixes Xen build failures on arm64 caused by commit c04e8e2f (arm64:
      allow ioremap_cache() to use existing RAM mappings)
      
      drivers/tty/hvc/hvc_xen.c:233:2: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration]
      drivers/xen/grant-table.c:1174:3: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration]
      drivers/xen/xenbus/xenbus_probe.c:778:4: error: implicit declaration of function 'ioremap_cached' [-Werror=implicit-function-declaration]
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      92341c83
  15. 09 11月, 2013 1 次提交
  16. 25 10月, 2013 1 次提交
  17. 23 5月, 2013 1 次提交
  18. 29 10月, 2012 1 次提交
  19. 25 10月, 2012 1 次提交
  20. 25 8月, 2012 1 次提交
    • W
      ARM: 7500/1: io: avoid writeback addressing modes for __raw_ accessors · 195bbcac
      Will Deacon 提交于
      Data aborts taken to hyp mode do not provide a valid instruction
      syndrome field in the HSR if the faulting instruction is a memory
      access using a writeback addressing mode.
      
      For hypervisors emulating MMIO accesses to virtual peripherals, taking
      such an exception requires disassembling the faulting instruction in
      order to determine the behaviour of the access. Since this requires
      manually walking the two stages of translation, the world must be
      stopped to prevent races against page aging in the guest, where the
      first-stage translation is invalidated after the hypervisor has
      translated to an IPA and the physical page is reused for something else.
      
      This patch avoids taking this heavy performance penalty when running
      Linux as a guest by ensuring that our I/O accessors do not make use of
      writeback addressing modes.
      
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      195bbcac
  21. 25 7月, 2012 1 次提交
    • R
      ARM: Add fixed PCI i/o mapping · c2794437
      Rob Herring 提交于
      This adds a fixed virtual mapping for PCI i/o addresses. The mapping is
      located at the last 2MB of vmalloc region (0xfee00000-0xff000000). 2MB
      is used to align with PMD size, but IO_SPACE_LIMIT is 1MB. The space
      is reserved after .map_io and can be mapped at any time later with
      pci_ioremap_io. Platforms which need early i/o mapping (e.g. for vga
      console) can call pci_map_io_early in their .map_io function.
      
      This has changed completely from the 1st implementation which only
      supported creating the static mapping at .map_io.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      c2794437
  22. 25 5月, 2012 1 次提交
  23. 06 4月, 2012 1 次提交
    • R
      ARM: fix __io macro for PCMCIA · 1ac02d79
      Rob Herring 提交于
      With commit c334bc15 (ARM: make mach/io.h include optional), PCMCIA was
      broken. PCMCIA depends on __io() returning a valid i/o address, and most
      ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
      needs a better fix with a fixed i/o address mapping, but for now we just
      restore things to the previous behavior.
      
      This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
      but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
      so it doesn't need an io.h.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Andrew Victor <linux@maxim.org.za>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Tested-by: Paul Parsons <lost.distance@yahoo.com> (pxa270)
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      1ac02d79
  24. 29 3月, 2012 1 次提交
  25. 14 3月, 2012 1 次提交
  26. 07 3月, 2012 4 次提交
  27. 29 11月, 2011 1 次提交
  28. 23 10月, 2011 1 次提交
  29. 17 10月, 2011 1 次提交
  30. 02 10月, 2011 1 次提交
  31. 28 9月, 2011 1 次提交
    • P
      doc: fix broken references · 395cf969
      Paul Bolle 提交于
      There are numerous broken references to Documentation files (in other
      Documentation files, in comments, etc.). These broken references are
      caused by typo's in the references, and by renames or removals of the
      Documentation files. Some broken references are simply odd.
      
      Fix these broken references, sometimes by dropping the irrelevant text
      they were part of.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      395cf969
  32. 17 8月, 2011 1 次提交
  33. 31 1月, 2011 1 次提交