1. 05 10月, 2012 1 次提交
    • W
      ARM: 7548/1: include linux/sched.h in syscall.h · 8ef102c6
      Wade Farnsworth 提交于
      The syscall tracing patch introduces a compile bug in lttng-modules
      when the latter calls syscall_get_nr(), similar to the following:
      
      <path-to-linux>/arch/arm/include/asm/syscall.h:21:2: error: implicit declaration of function 'task_thread_info' [-Werror=implicit-function-declaration]
      
      The issue is that we are using task_thread_info() in the
      syscall_get_nr() function in asm/syscall.h, but not explicitly
      including sched.h from this file, so we can expect this bug might
      surface any time that syscall_get_nr() is called.
      
      Explicitly including sched.h solves the problem.
      
      Cc: <stable@vger.kernel.org> [3.5, 3.6]
      Signed-off-by: NWade Farnsworth <wade_farnsworth@mentor.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      8ef102c6
  2. 03 10月, 2012 1 次提交
  3. 02 10月, 2012 2 次提交
    • R
      ARM: kill off arch_is_coherent · 48aa820f
      Rob Herring 提交于
      With ixp2xxx removed, there are no platforms that define arch_is_coherent,
      so the last occurrences of arch_is_coherent can be removed. Any new
      platform with coherent i/o should use coherent dma mapping functions.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      48aa820f
    • R
      ARM: add coherent dma ops · dd37e940
      Rob Herring 提交于
      arch_is_coherent is problematic as it is a global symbol. This
      doesn't work for multi-platform kernels or platforms which can support
      per device coherent DMA.
      
      This adds arm_coherent_dma_ops to be used for devices which connected
      coherently (i.e. to the ACP port on Cortex-A9 or A15). The arm_dma_ops
      are modified at boot when arch_is_coherent is true.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Marek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      dd37e940
  4. 27 9月, 2012 1 次提交
  5. 22 9月, 2012 1 次提交
  6. 20 9月, 2012 2 次提交
  7. 16 9月, 2012 5 次提交
    • M
      ARM: 7522/1: arch_timers: register a time/cycle counter · a1b2dde7
      Marc Zyngier 提交于
      Some subsystems (KVM for example) need access to a cycle counter.
      In the KVM case, this is used to measure the time delta between
      host and guest in order to accurately generate timer events for
      the guest.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      a1b2dde7
    • D
      ARM: 7511/1: opcodes: Opcode definitions for the Virtualization Extensions · 508514ed
      Dave Martin 提交于
      For now, this patch just adds a definition for the HVC instruction.
      More can be added here later, as needed.
      
      Now that we have a real example of how to use the opcode injection
      macros properly, this patch also adds a cross-reference from the
      explanation in opcodes.h (since without an example, figuring out
      how to use the macros is not that easy).
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      508514ed
    • D
      ARM: 7510/1: opcodes: Add helpers for emitting custom opcodes · a61a41a0
      Dave Martin 提交于
      This patch adds some __inst_() macros for injecting custom opcodes
      in assembler (both inline and in .S files).  They should make it
      easier and cleaner to get things right in little-/big-
      endian/ARM/Thumb-2 kernels without a lot of #ifdefs.
      
      This pure-preprocessor approach is preferred over the alternative
      method of wedging extra assembler directives into the assembler
      input using top-level asm() blocks, since there is no way to
      guarantee that the compiler won't reorder those with respect to
      each other or with respect to non-toplevel asm() blocks, unless
      -fno-toplevel-reorder is passed (which is in itself somewhat
      undesirable because it defeats some potential optimisations).
      
      Currently <asm/unified.h> _does_ silently rely on the compiler not
      reordering at the top level, but it seems better to avoid adding
      extra code which depends on this if the same result can be achieved
      in another way.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      a61a41a0
    • D
      ARM: 7509/1: opcodes: Make opcode byteswapping macros assembly-compatible · 0ce3de23
      Dave Martin 提交于
      Most of the existing macros don't work with assembler, due to the
      use of type casts and C functions from <linux/swab.h>.
      
      This patch abstracts out those operations and provides simple
      explicit versions for use in assembly code.
      
      __opcode_is_thumb32() and __opcode_is_thumb16() are also converted
      to do bitmask-based testing to avoid confusion if these are used in
      assembly code (the assembler typically treats all arithmetic values
      as signed).
      
      These changes avoid the need for the compiler to pre-evaluate
      constant expressions used to generate opcodes.  By ensuring that
      the forms of these expressions can be evaluated directly by the
      assembler, we can just stringify the expressions directly into the
      asm during the preprocessing pass.  The alternative approach
      (passing the evaluated expression via an inline asm "i" constraint)
      gets painful because the contents of the asm and the constraints
      must be kept in sync.  This makes the resulting macros awkward to
      use.
      
      Retaining the C forms of the macros allows more efficient code to
      be generated when opcodes are generated programmatically at run-
      time, but there is no way to embed run-time-generated opcodes in
      asm() blocks.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      0ce3de23
    • D
      ARM: 7508/1: opcodes: Don't define the thumb32 byteswapping macros for BE32 · 57b9da32
      Dave Martin 提交于
      The existing __mem_to_opcode_thumb32() is incorrect for BE32
      platforms.  However, these don't support Thumb-2 kernels, so this
      option is not so relevant for those platforms anyway.
      
      This operation is complicated by the lack of unaligned memory
      access support prior to ARMv6.
      
      Rather than provide a "working" macro which will probably won't get
      used (or worse, will get misused), this patch removes the macro for
      BE32 kernels.  People manipulating Thumb opcodes prior to ARMv6
      should almost certainly be splitting these operations into
      halfwords anyway, using __opcode_thumb32_{first,second,compose}()
      and the 16-bit opcode transformations.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      57b9da32
  8. 14 9月, 2012 4 次提交
  9. 13 9月, 2012 1 次提交
    • M
      ARM: SoC: add per-platform SMP operations · abcee5fb
      Marc Zyngier 提交于
      This adds a 'struct smp_operations' to abstract the CPU initialization
      and hot plugging functions on SMP systems, which otherwise conflict
      in a multiplatform kernel. This also helps shmobile and potentially
      others that have more than one method to do these.
      
      To allow the kernel to continue building, the platform hooks are
      defined as weak symbols which are overrided by the platform code.
      Once all platforms are converted, the "weak" attribute will be
      removed and the function made static.
      
      Unlike the original version from Marc, this new version from Arnd
      does not use a generalized abstraction for per-soc data structures
      but only tries to solve the problem for the SMP operations. This
      way, we can collapse the previous four data structures into a
      single struct, which is less systematic but also easier to follow
      as a causal reader.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NNicolas Pitre <nico@fluxnic.net>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      abcee5fb
  10. 10 9月, 2012 2 次提交
  11. 08 9月, 2012 1 次提交
  12. 02 9月, 2012 1 次提交
  13. 29 8月, 2012 2 次提交
  14. 25 8月, 2012 6 次提交
    • 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
    • W
      ARM: 7495/1: mutex: use generic atomic_dec-based implementation for ARMv6+ · 08928e7a
      Will Deacon 提交于
      Commit a76d7bd9 ("ARM: 7467/1: mutex: use generic xchg-based
      implementation for ARMv6+") removed the barrier-less, ARM-specific
      mutex implementation in favour of the generic xchg-based code.
      
      Since then, a bug was uncovered in the xchg code when running on SMP
      platforms, due to interactions between the locking paths and the
      MUTEX_SPIN_ON_OWNER code. This was fixed in 0bce9c46 ("mutex: place
      lock in contended state after fastpath_lock failure"), however, the
      atomic_dec-based mutex algorithm is now marginally more efficient for
      ARM (~0.5% improvement in hackbench scores on dual A15).
      
      This patch moves ARMv6+ platforms to the atomic_dec-based mutex code.
      Acked-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>
      08928e7a
    • R
      ARM: 7494/1: use generic termios.h · e780c452
      Rob Herring 提交于
      As pointed out by Arnd Bergmann, this fixes a couple of issues but will
      increase code size:
      
      The original macro user_termio_to_kernel_termios was not endian safe. It
      used an unsigned short ptr to access the low bits in a 32-bit word.
      
      Both user_termio_to_kernel_termios and kernel_termios_to_user_termio are
      missing error checking on put_user/get_user and copy_to/from_user.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Tested-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      e780c452
    • R
      ARM: 7493/1: use generic unaligned.h · d25c881a
      Rob Herring 提交于
      This moves ARM over to the asm-generic/unaligned.h header. This has the
      benefit of better code generated especially for ARMv7 on gcc 4.7+
      compilers.
      
      As Arnd Bergmann, points out: The asm-generic version uses the "struct"
      version for native-endian unaligned access and the "byteshift" version
      for the opposite endianess. The current ARM version however uses the
      "byteshift" implementation for both.
      
      Thanks to Nicolas Pitre for the excellent analysis:
      
      Test case:
      
      int foo (int *x) { return get_unaligned(x); }
      long long bar (long long *x) { return get_unaligned(x); }
      
      With the current ARM version:
      
      foo:
      	ldrb	r3, [r0, #2]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 2B], MEM[(const u8 *)x_1(D) + 2B]
      	ldrb	r1, [r0, #1]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 1B], MEM[(const u8 *)x_1(D) + 1B]
      	ldrb	r2, [r0, #0]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D)], MEM[(const u8 *)x_1(D)]
      	mov	r3, r3, asl #16	@ tmp154, MEM[(const u8 *)x_1(D) + 2B],
      	ldrb	r0, [r0, #3]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 3B], MEM[(const u8 *)x_1(D) + 3B]
      	orr	r3, r3, r1, asl #8	@, tmp155, tmp154, MEM[(const u8 *)x_1(D) + 1B],
      	orr	r3, r3, r2	@ tmp157, tmp155, MEM[(const u8 *)x_1(D)]
      	orr	r0, r3, r0, asl #24	@,, tmp157, MEM[(const u8 *)x_1(D) + 3B],
      	bx	lr	@
      
      bar:
      	stmfd	sp!, {r4, r5, r6, r7}	@,
      	mov	r2, #0	@ tmp184,
      	ldrb	r5, [r0, #6]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 6B], MEM[(const u8 *)x_1(D) + 6B]
      	ldrb	r4, [r0, #5]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 5B], MEM[(const u8 *)x_1(D) + 5B]
      	ldrb	ip, [r0, #2]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 2B], MEM[(const u8 *)x_1(D) + 2B]
      	ldrb	r1, [r0, #4]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 4B], MEM[(const u8 *)x_1(D) + 4B]
      	mov	r5, r5, asl #16	@ tmp175, MEM[(const u8 *)x_1(D) + 6B],
      	ldrb	r7, [r0, #1]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 1B], MEM[(const u8 *)x_1(D) + 1B]
      	orr	r5, r5, r4, asl #8	@, tmp176, tmp175, MEM[(const u8 *)x_1(D) + 5B],
      	ldrb	r6, [r0, #7]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 7B], MEM[(const u8 *)x_1(D) + 7B]
      	orr	r5, r5, r1	@ tmp178, tmp176, MEM[(const u8 *)x_1(D) + 4B]
      	ldrb	r4, [r0, #0]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D)], MEM[(const u8 *)x_1(D)]
      	mov	ip, ip, asl #16	@ tmp188, MEM[(const u8 *)x_1(D) + 2B],
      	ldrb	r1, [r0, #3]	@ zero_extendqisi2	@ MEM[(const u8 *)x_1(D) + 3B], MEM[(const u8 *)x_1(D) + 3B]
      	orr	ip, ip, r7, asl #8	@, tmp189, tmp188, MEM[(const u8 *)x_1(D) + 1B],
      	orr	r3, r5, r6, asl #24	@,, tmp178, MEM[(const u8 *)x_1(D) + 7B],
      	orr	ip, ip, r4	@ tmp191, tmp189, MEM[(const u8 *)x_1(D)]
      	orr	ip, ip, r1, asl #24	@, tmp194, tmp191, MEM[(const u8 *)x_1(D) + 3B],
      	mov	r1, r3	@,
      	orr	r0, r2, ip	@ tmp171, tmp184, tmp194
      	ldmfd	sp!, {r4, r5, r6, r7}
      	bx	lr
      
      In both cases the code is slightly suboptimal.  One may wonder why
      wasting r2 with the constant 0 in the second case for example.  And all
      the mov's could be folded in subsequent orr's, etc.
      
      Now with the asm-generic version:
      
      foo:
      	ldr	r0, [r0, #0]	@ unaligned	@,* x
      	bx	lr	@
      
      bar:
      	mov	r3, r0	@ x, x
      	ldr	r0, [r0, #0]	@ unaligned	@,* x
      	ldr	r1, [r3, #4]	@ unaligned	@,
      	bx	lr	@
      
      This is way better of course, but only because this was compiled for
      ARMv7. In this case the compiler knows that the hardware can do
      unaligned word access.  This isn't that obvious for foo(), but if we
      remove the get_unaligned() from bar as follows:
      
      long long bar (long long *x) {return *x; }
      
      then the resulting code is:
      
      bar:
      	ldmia	r0, {r0, r1}	@ x,,
      	bx	lr	@
      
      So this proves that the presumed aligned vs unaligned cases does have
      influence on the instructions the compiler may use and that the above
      unaligned code results are not just an accident.
      
      Still... this isn't fully conclusive without at least looking at the
      resulting assembly fron a pre ARMv6 compilation.  Let's see with an
      ARMv5 target:
      
      foo:
      	ldrb	r3, [r0, #0]	@ zero_extendqisi2	@ tmp139,* x
      	ldrb	r1, [r0, #1]	@ zero_extendqisi2	@ tmp140,
      	ldrb	r2, [r0, #2]	@ zero_extendqisi2	@ tmp143,
      	ldrb	r0, [r0, #3]	@ zero_extendqisi2	@ tmp146,
      	orr	r3, r3, r1, asl #8	@, tmp142, tmp139, tmp140,
      	orr	r3, r3, r2, asl #16	@, tmp145, tmp142, tmp143,
      	orr	r0, r3, r0, asl #24	@,, tmp145, tmp146,
      	bx	lr	@
      
      bar:
      	stmfd	sp!, {r4, r5, r6, r7}	@,
      	ldrb	r2, [r0, #0]	@ zero_extendqisi2	@ tmp139,* x
      	ldrb	r7, [r0, #1]	@ zero_extendqisi2	@ tmp140,
      	ldrb	r3, [r0, #4]	@ zero_extendqisi2	@ tmp149,
      	ldrb	r6, [r0, #5]	@ zero_extendqisi2	@ tmp150,
      	ldrb	r5, [r0, #2]	@ zero_extendqisi2	@ tmp143,
      	ldrb	r4, [r0, #6]	@ zero_extendqisi2	@ tmp153,
      	ldrb	r1, [r0, #7]	@ zero_extendqisi2	@ tmp156,
      	ldrb	ip, [r0, #3]	@ zero_extendqisi2	@ tmp146,
      	orr	r2, r2, r7, asl #8	@, tmp142, tmp139, tmp140,
      	orr	r3, r3, r6, asl #8	@, tmp152, tmp149, tmp150,
      	orr	r2, r2, r5, asl #16	@, tmp145, tmp142, tmp143,
      	orr	r3, r3, r4, asl #16	@, tmp155, tmp152, tmp153,
      	orr	r0, r2, ip, asl #24	@,, tmp145, tmp146,
      	orr	r1, r3, r1, asl #24	@,, tmp155, tmp156,
      	ldmfd	sp!, {r4, r5, r6, r7}
      	bx	lr
      
      Compared to the initial results, this is really nicely optimized and I
      couldn't do much better if I were to hand code it myself.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Tested-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      d25c881a
    • R
      ARM: 7491/1: use generic version of identical asm headers · 4a8052d8
      Rob Herring 提交于
      Inspired by the AArgh64 claim that it should be separate from ARM and one
      reason was being able to use more asm-generic headers. Doing a diff of
      arch/arm/include/asm and include/asm-generic there are numerous asm
      headers which are functionally identical to their asm-generic counterparts.
      Delete the ARM version and use the generic ones.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Tested-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4a8052d8
    • W
      ARM: 7503/1: mm: only flush both pmd entries for classic MMU · df547e08
      Will Deacon 提交于
      LPAE does not use two pmd entries for a pte, so the additional tlb
      flushing is not required.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      df547e08
  15. 23 8月, 2012 5 次提交
    • S
      ARM: perf: move irq registration into pmu implementation · 051f1b13
      Sudeep KarkadaNagesha 提交于
      This patch moves the CPU-specific IRQ registration and parsing code into
      the CPU PMU backend. This is required because a PMU may have more than
      one interrupt, which in turn can be either PPI (per-cpu) or SPI
      (requiring strict affinity setting at the interrupt distributor).
      Signed-off-by: NSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      [will: cosmetic edits and reworked interrupt dispatching]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      051f1b13
    • W
      ARM: perf: prepare for moving CPU PMU code into separate file · 6dbc0029
      Will Deacon 提交于
      The CPU PMU code is tightly coupled with generic ARM PMU handling code.
      This makes it cumbersome when trying to add support for other ARM PMUs
      (e.g. interconnect, L2 cache controller, bus) as the generic parts of
      the code are not readily reusable.
      
      This patch cleans up perf_event.c so that reusable code is exposed via
      header files to other potential PMU drivers. The CPU code is
      consistently named to identify it as such and also to prepare for moving
      it into a separate file.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6dbc0029
    • S
      ARM: pmu: remove arm_pmu_type enumeration · df3d17e0
      Sudeep KarkadaNagesha 提交于
      The arm_pmu_type enumeration was initially introduced to identify
      different PMU types in the system, the usual one being that on the CPU
      (ARM_PMU_DEVICE_CPU). With the removal of the PMU reservation code and
      the introduction of devicetree bindings for the CPU PMU, the enumeration
      is no longer required.
      
      This patch removes the enumeration and updates the various CPU PMU
      platform devices so that they no longer pass an .id field referring
      to identify the PMU type.
      
      Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Acked-by: NJon Hunter <jon-hunter@ti.com>
      Acked-by: NKukjin Kim <kgene.kim@samsung.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NJiandong Zheng <jdzheng@broadcom.com>
      Signed-off-by: NSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      [will: cosmetic edits and actual removal of the enum type]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      df3d17e0
    • W
      ARM: pmu: remove unused reservation mechanism · f0d1bc47
      Will Deacon 提交于
      The PMU reservation mechanism was originally intended to allow OProfile
      and perf-events to co-ordinate over access to the CPU PMU. Since then,
      OProfile for ARM has moved to using perf as its backend, so the
      reservation code is no longer used.
      
      This patch removes the reservation code for the CPU PMU on ARM.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      f0d1bc47
    • J
      ARM: PMU: Add runtime PM Support · 7be2958e
      Jon Hunter 提交于
      Add runtime PM support to the ARM PMU driver so that devices such as OMAP
      supporting dynamic PM can use the platform->runtime_* hooks to initialise
      hardware at runtime. Without having these runtime PM hooks in place any
      configuration of the PMU hardware would be lost when low power states are
      entered and hence would prevent PMU from working.
      
      This change also replaces the PMU platform functions enable_irq and disable_irq
      added by Ming Lei with runtime_resume and runtime_suspend funtions. Ming had
      added the enable_irq and disable_irq functions as a method to configure the
      cross trigger interface on OMAP4 for routing the PMU interrupts. By adding
      runtime PM support, we can move the code called by enable_irq and disable_irq
      into the runtime PM callbacks runtime_resume and runtime_suspend.
      
      Cc: Ming Lei <ming.lei@canonical.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      7be2958e
  16. 16 8月, 2012 1 次提交
  17. 11 8月, 2012 3 次提交
    • W
      ARM: 7488/1: mm: use 5 bits for swapfile type encoding · f5f2025e
      Will Deacon 提交于
      Page migration encodes the pfn in the offset field of a swp_entry_t.
      For LPAE, we support physical addresses of up to 36 bits (due to
      sparsemem limitations with the size of page flags), requiring 24 bits
      to represent a pfn. A further 3 bits are used to encode a swp_entry into
      a pte, leaving 5 bits for the type field. Furthermore, the core code
      defines MAX_SWAPFILES_SHIFT as 5, so the additional type bit does not
      get used.
      
      This patch reduces the width of the type field to 5 bits, allowing us
      to create up to 31 swapfiles of 64GB each.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      f5f2025e
    • W
      ARM: 7487/1: mm: avoid setting nG bit for user mappings that aren't present · 47f12043
      Will Deacon 提交于
      Swap entries are encoding in ptes such that !pte_present(pte) and
      pte_file(pte). The remaining bits of the descriptor are used to identify
      the swapfile and offset within it to the swap entry.
      
      When writing such a pte for a user virtual address, set_pte_at
      unconditionally sets the nG bit, which (in the case of LPAE) will
      corrupt the swapfile offset and lead to a BUG:
      
      [  140.494067] swap_free: Unused swap offset entry 000763b4
      [  140.509989] BUG: Bad page map in process rs:main Q:Reg  pte:0ec76800 pmd:8f92e003
      
      This patch fixes the problem by only setting the nG bit for user
      mappings that are actually present.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      47f12043
    • C
      ARM: 7486/1: sched_clock: update epoch_cyc on resume · 237ec6f2
      Colin Cross 提交于
      Many clocks that are used to provide sched_clock will reset during
      suspend.  If read_sched_clock returns 0 after suspend, sched_clock will
      appear to jump forward.  This patch resets cd.epoch_cyc to the current
      value of read_sched_clock during resume, which causes sched_clock() just
      after suspend to return the same value as sched_clock() just before
      suspend.
      
      In addition, during the window where epoch_ns has been updated before
      suspend, but epoch_cyc has not been updated after suspend, it is unknown
      whether the clock has reset or not, and sched_clock() could return a
      bogus value.  Add a suspended flag, and return the pre-suspend epoch_ns
      value during this period.
      
      The new behavior is triggered by calling setup_sched_clock_needs_suspend
      instead of setup_sched_clock.
      Signed-off-by: NColin Cross <ccross@android.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      237ec6f2
  18. 09 8月, 2012 1 次提交