1. 11 11月, 2015 11 次提交
    • A
      MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime() · a7f4df4e
      Alex Smith 提交于
      Add user-mode implementations of gettimeofday() and clock_gettime() to
      the VDSO. This is currently usable with 2 clocksources: the CP0 count
      register, which is accessible to user-mode via RDHWR on R2 and later
      cores, or the MIPS Global Interrupt Controller (GIC) timer, which
      provides a "user-mode visible" section containing a mirror of its
      counter registers. This section must be mapped into user memory, which
      is done below the VDSO data page.
      
      When a supported clocksource is not in use, the VDSO functions will
      return -ENOSYS, which causes libc to fall back on the standard syscall
      path.
      
      When support for neither of these clocksources is compiled into the
      kernel at all, the VDSO still provides clock_gettime(), as the coarse
      realtime/monotonic clocks can still be implemented. However,
      gettimeofday() is not provided in this case as nothing can be done
      without a suitable clocksource. This causes the symbol lookup to fail
      in libc and it will then always use the standard syscall path.
      
      This patch includes a workaround for a bug in QEMU which results in
      RDHWR on the CP0 count register always returning a constant (incorrect)
      value. A fix for this has been submitted, and the workaround can be
      removed after the fix has been in stable releases for a reasonable
      amount of time.
      
      A simple performance test which calls gettimeofday() 1000 times in a
      loop and calculates the average execution time gives the following
      results on a Malta + I6400 (running at 20MHz):
      
       - Syscall:    ~31000 ns
       - VDSO (GIC): ~15000 ns
       - VDSO (CP0): ~9500 ns
      
      [markos.chandras@imgtec.com:
      - Minor code re-arrangements in order for mappings to be made
      in the order they appear to the process' address space.
      - Move do_{monotonic, realtime} outside of the MIPS_CLOCK_VSYSCALL ifdef
      - Use gic_get_usm_range so we can do the GIC mapping in the
      arch/mips/kernel/vdso instead of the GIC irqchip driver]
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11338/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a7f4df4e
    • A
      MIPS: Initial implementation of a VDSO · ebb5e78c
      Alex Smith 提交于
      Add an initial implementation of a proper (i.e. an ELF shared library)
      VDSO. With this commit it does not export any symbols, it only replaces
      the current signal return trampoline page. A later commit will add user
      implementations of gettimeofday()/clock_gettime().
      
      To support both new toolchains and old ones which don't generate ABI
      flags section, we define its content manually and then use a tool
      (genvdso) to patch up the section to have the correct name and type.
      genvdso also extracts symbol offsets ({,rt_}sigreturn) needed by the
      kernel, and generates a C file containing a "struct mips_vdso_image"
      containing both the VDSO data and these offsets. This C file is
      compiled into the kernel.
      
      On 64-bit kernels we require a different VDSO for each supported ABI,
      so we may build up to 3 different VDSOs. The VDSO to use is selected by
      the mips_abi structure.
      
      A kernel/user shared data page is created and mapped below the VDSO
      image. This is currently empty, but will be used by the user time
      function implementations which are added later.
      
      [markos.chandras@imgtec.com:
      - Add more comments
      - Move abi detection in genvdso.h since it's the get_symbol function
      that needs it.
      - Add an R6 specific way to calculate the base address of VDSO in order
      to avoid the branch instruction which affects performance.
      - Do not patch .gnu.attributes since it's not needed for dynamic linking.
      - Simplify Makefile a little bit.
      - checkpatch fixes
      - Restrict VDSO support for binutils < 2.25 for pre-R6
      - Include atomic64.h for O32 variant on MIPS64]
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: Matthew Fortune <matthew.fortune@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/11337/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ebb5e78c
    • P
      MIPS: Malta: Setup RAM regions via DT · e81a8c7d
      Paul Burton 提交于
      Move memory configuration to be performed via device tree for the Malta
      board. This moves more Malta specific code to malta-dtshim.c, leaving
      the rest of the mti-malta code a little more board-agnostic. This will
      be useful to share more code between boards, with the device tree
      providing the board specifics as intended.
      
      Since we can't rely upon Malta boards running a bootloader capable of
      handling devictrees & filling in the required information, a piece of
      shim code (malta_dt_shim) is added to consume the (e)memsize variables
      provided as part of the bootloader environment (or on the kernel command
      line) then generate the DT memory node using the provided values.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: devicetree@vger.kernel.org
      Cc: Kumar Gala <galak@codeaurora.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11222/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e81a8c7d
    • P
      MIPS: Malta: Remove fw_memblock_t abstraction · ea050714
      Paul Burton 提交于
      The fw_getmdesc function & fw_memblock_t abstraction is only used by
      Malta, and so far as I can tell serves no purpose beyond making the code
      less clear than it could be. Remove the useless level of abstraction.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11221/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ea050714
    • P
      MIPS: Allow RIXI for 32-bit kernels on MIPS64 · 033549c6
      Paul Burton 提交于
      Commit a68d09a1 ("MIPS: Don't use RI/XI with 32-bit kernels on
      64-bit CPUs") prevented use of RIXI on MIPS64 systems, stating that the
      "TLB handlers cannot handle this case". What they actually couldn't
      handle was cases where there were less fill bits in the Entry{Lo,Hi}
      registers than bits used by software in PTEs. The handlers can now deal
      with this case, so enable RIXI for MIPS32 kernels on MIPS64 systems.
      
      Note that beyond the obvious benefits provided by having RIXI on such
      systems, this is required for systems implementing MIPSr6 where RIXI
      cannot be disabled.
      
      This reverts commit a68d09a1 ("MIPS: Don't use RI/XI with 32-bit
      kernels on 64-bit CPUs").
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Joshua Kinard <kumba@gentoo.org>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11219/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      033549c6
    • P
      MIPS: Tidy EntryLo bit definitions, add PFN · c6956728
      Paul Burton 提交于
      Tidy up the definition of the EntryLo RI & XI bits using BITS_PER_LONG
      rather than #ifdef'ing on CONFIG_64BIT, and add a definition for the
      offset to the PFN field for use by a later patch.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11217/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c6956728
    • P
      MIPS: CM: make use of mips_cm_{lock,unlock}_other · 4ede3161
      Paul Burton 提交于
      Document that CPC core-other accesses must take place within the bounds
      of the CM lock, and begin using the CM lock functions where we access
      the GCRs of other cores. This is required because with CM3 the CPC began
      using GCR_CL_OTHER instead of CPC_CL_OTHER.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Niklas Cassel <niklas.cassel@axis.com>
      Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11208/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4ede3161
    • P
      MIPS: CM: Introduce core-other locking functions · 23d5de8e
      Paul Burton 提交于
      Introduce mips_cm_lock_other & mips_cm_unlock_other, mirroring the
      existing CPC equivalents, in order to lock access from the current core
      to another via the core-other GCR region. This hasn't been required in
      the past but with CM3 the CPC starts using GCR_CL_OTHER rather than
      CPC_CL_OTHER and this will be required for safety.
      
      [ralf@linux-mips.org: Fix merge conflict.]
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11207/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      23d5de8e
    • P
      MIPS: CM: Fix GCR_Cx_CONFIG PVPE mask · 252d6aa6
      Paul Burton 提交于
      The PVPE (or PVP in >= CM3) field is 10 bits wide, but the mask
      previously only covered the bottom 9 bits. Extend the mask to cover all
      10 bits of the field.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11206/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      252d6aa6
    • P
      MIPS: CPS: Early debug using an ns16550-compatible UART · 609cf6f2
      Paul Burton 提交于
      Provide support for outputting early debug information, in the form of
      various register values should an exception occur, during the early
      bringup of secondary cores. This code requires an ns16550-compatible
      UART accessible from the secondary core, and is written in assembly due
      to the environment in which such early exceptions occur where way may
      not have a stack, be coherent or even have initialised caches.
      
      [ralf@linux-mips.org: Fix merge conflict.]
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
      Cc: Maciej W. Rozycki <macro@linux-mips.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11202/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      609cf6f2
    • J
      MIPS: Fix duplicate CP0_* definitions. · 195cee92
      James Hogan 提交于
      Remove the definition in locore.S and move a few of the other similar
      definitions in asm/mipsregs.h too. CP0_INTCTL, CP0_SRSCTL, & CP0_SRSMAP
      are unused so they're just dropped instead. CP0_DDATA_LO is left where
      it is as I have patches to eliminate its use in locore.S and it
      otherwise is unlikely to need to be used from assembly code.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Gleb Natapov <gleb@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: kvm@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/11461/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      195cee92
  2. 26 10月, 2015 6 次提交
  3. 06 10月, 2015 1 次提交
  4. 05 10月, 2015 2 次提交
  5. 30 9月, 2015 1 次提交
  6. 27 9月, 2015 2 次提交
    • P
      MIPS: Initialise MAARs on secondary CPUs · e060f6ed
      Paul Burton 提交于
      MAARs should be initialised on each CPU (or rather, core) in the system
      in order to achieve consistent behaviour & performance. Previously they
      have only been initialised on the boot CPU which leads to performance
      problems if tasks are later scheduled on a secondary CPU, particularly
      if those tasks make use of unaligned vector accesses where some CPUs
      don't handle any cases in hardware for non-speculative memory regions.
      Fix this by recording the MAAR configuration from the boot CPU and
      applying it to secondary CPUs as part of their bringup.
      Reported-by: NDoug Gilmore <doug.gilmore@imgtec.com>
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Andrew Bresticker <abrestic@chromium.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: David Hildenbrand <dahi@linux.vnet.ibm.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Cc: Hemmo Nieminen <hemmo.nieminen@iki.fi>
      Cc: Alex Smith <alex.smith@imgtec.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Patchwork: https://patchwork.linux-mips.org/patch/11239/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      e060f6ed
    • P
      MIPS: CM: Provide a function to map from CPU to VP ID. · 7573b94e
      Paul Burton 提交于
      The VP ID of a given CPU may not match up with the CPU number used by
      Linux. For example, if the width of the VP part of the VP ID is wider
      than log2(number of VPs per core) and the system has multiple cores then
      this will be the case. Alternatively, if a pre-r6 system implements the
      MT ASE with multiple VPEs per core and Linux is built without support
      for the MT ASE then the numbers won't match up either. Provide a
      function to convert from CPU number to VP ID.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Markos Chandras <markos.chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/11211/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7573b94e
  7. 25 9月, 2015 1 次提交
  8. 23 9月, 2015 1 次提交
  9. 16 9月, 2015 2 次提交
    • T
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner 提交于
      Most interrupt flow handlers do not use the irq argument. Those few
      which use it can retrieve the irq number from the irq descriptor.
      
      Remove the argument.
      
      Search and replace was done with coccinelle and some extra helper
      scripts around it. Thanks to Julia for her help!
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
    • P
      KVM: add halt_attempted_poll to VCPU stats · 62bea5bf
      Paolo Bonzini 提交于
      This new statistic can help diagnosing VCPUs that, for any reason,
      trigger bad behavior of halt_poll_ns autotuning.
      
      For example, say halt_poll_ns = 480000, and wakeups are spaced exactly
      like 479us, 481us, 479us, 481us. Then KVM always fails polling and wastes
      10+20+40+80+160+320+480 = 1110 microseconds out of every
      479+481+479+481+479+481+479 = 3359 microseconds. The VCPU then
      is consuming about 30% more CPU than it would use without
      polling.  This would show as an abnormally high number of
      attempted polling compared to the successful polls.
      
      Acked-by: Christian Borntraeger <borntraeger@de.ibm.com<
      Reviewed-by: NDavid Matlack <dmatlack@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      62bea5bf
  10. 11 9月, 2015 5 次提交
    • C
      dma-mapping: consolidate dma_set_mask · 452e06af
      Christoph Hellwig 提交于
      Almost everyone implements dma_set_mask the same way, although some time
      that's hidden in ->set_dma_mask methods.
      
      This patch consolidates those into a common implementation that either
      calls ->set_dma_mask if present or otherwise uses the default
      implementation.  Some architectures used to only call ->set_dma_mask
      after the initial checks, and those instance have been fixed to do the
      full work.  h8300 implemented dma_set_mask bogusly as a no-ops and has
      been fixed.
      
      Unfortunately some architectures overload unrelated semantics like changing
      the dma_ops into it so we still need to allow for an architecture override
      for now.
      
      [jcmvbkbc@gmail.com: fix xtensa]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      452e06af
    • C
      dma-mapping: consolidate dma_supported · ee196371
      Christoph Hellwig 提交于
      Most architectures just call into ->dma_supported, but some also return 1
      if the method is not present, or 0 if no dma ops are present (although
      that should never happeb). Consolidate this more broad version into
      common code.
      
      Also fix h8300 which inorrectly always returned 0, which would have been
      a problem if it's dma_set_mask implementation wasn't a similarly buggy
      noop.
      
      As a few architectures have much more elaborate implementations, we
      still allow for arch overrides.
      
      [jcmvbkbc@gmail.com: fix xtensa]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ee196371
    • C
      dma-mapping: cosolidate dma_mapping_error · efa21e43
      Christoph Hellwig 提交于
      Currently there are three valid implementations of dma_mapping_error:
      
       (1) call ->mapping_error
       (2) check for a hardcoded error code
       (3) always return 0
      
      This patch provides a common implementation that calls ->mapping_error
      if present, then checks for DMA_ERROR_CODE if defined or otherwise
      returns 0.
      
      [jcmvbkbc@gmail.com: fix xtensa]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      efa21e43
    • C
      dma-mapping: consolidate dma_{alloc,free}_noncoherent · 1e893752
      Christoph Hellwig 提交于
      Most architectures do not support non-coherent allocations and either
      define dma_{alloc,free}_noncoherent to their coherent versions or stub
      them out.
      
      Openrisc uses dma_{alloc,free}_attrs to implement them, and only Mips
      implements them directly.
      
      This patch moves the Openrisc version to common code, and handles the
      DMA_ATTR_NON_CONSISTENT case in the mips dma_map_ops instance.
      
      Note that actual non-coherent allocations require a dma_cache_sync
      implementation, so if non-coherent allocations didn't work on
      an architecture before this patch they still won't work after it.
      
      [jcmvbkbc@gmail.com: fix xtensa]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1e893752
    • C
      dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent} · 6894258e
      Christoph Hellwig 提交于
      Since 2009 we have a nice asm-generic header implementing lots of DMA API
      functions for architectures using struct dma_map_ops, but unfortunately
      it's still missing a lot of APIs that all architectures still have to
      duplicate.
      
      This series consolidates the remaining functions, although we still need
      arch opt outs for two of them as a few architectures have very
      non-standard implementations.
      
      This patch (of 5):
      
      The coherent DMA allocator works the same over all architectures supporting
      dma_map operations.
      
      This patch consolidates them and converges the minor differences:
      
       - the debug_dma helpers are now called from all architectures, including
         those that were previously missing them
       - dma_alloc_from_coherent and dma_release_from_coherent are now always
         called from the generic alloc/free routines instead of the ops
         dma-mapping-common.h always includes dma-coherent.h to get the defintions
         for them, or the stubs if the architecture doesn't support this feature
       - checks for ->alloc / ->free presence are removed.  There is only one
         magic instead of dma_map_ops without them (mic_dma_ops) and that one
         is x86 only anyway.
      
      Besides that only x86 needs special treatment to replace a default devices
      if none is passed and tweak the gfp_flags.  An optional arch hook is provided
      for that.
      
      [linux@roeck-us.net: fix build]
      [jcmvbkbc@gmail.com: fix xtensa]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6894258e
  11. 03 9月, 2015 8 次提交