1. 26 2月, 2016 1 次提交
    • L
      drivers/perf: arm_pmu: implement CPU_PM notifier · da4e4f18
      Lorenzo Pieralisi 提交于
      When a CPU is suspended (either through suspend-to-RAM or CPUidle),
      its PMU registers content can be lost, which means that counters
      registers values that were initialized on power down entry have to be
      reprogrammed on power-up to make sure the counters set-up is preserved
      (ie on power-up registers take the reset values on Cold or Warm reset,
      which can be architecturally UNKNOWN).
      
      To guarantee seamless profiling conditions across a core power down
      this patch adds a CPU PM notifier to ARM pmus, that upon CPU PM
      entry/exit from low-power states saves/restores the pmu registers
      set-up (by using the ARM perf API), so that the power-down/up cycle does
      not affect the perf behaviour (apart from a black-out period between
      power-up/down CPU PM notifications that is unavoidable).
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Acked-by: NAshwin Chaugule <ashwin.chaugule@linaro.org>
      Acked-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      da4e4f18
  2. 26 1月, 2016 1 次提交
  3. 16 11月, 2015 1 次提交
    • M
      drivers/perf: kill armpmu_register · b916b785
      Mark Rutland 提交于
      Nothing outside of drivers/perf/arm_pmu.c should call armpmu_register
      any more, so it no longer needs to be in include/linux/perf/arm_pmu.h.
      Additionally, by folding it in to arm_pmu_device_probe we can allow
      drivers to override struct pmu fields without getting blatted by the
      armpmu code.
      
      This patch folds armpmu_register into arm_pmu_device_probe. The logging
      to the console is moved to after the PMU is successfully registered with
      the core perf code.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Suggested-by: NWill Deacon <will.deacon@arm.com>
      Cc: Drew Richardson <drew.richardson@arm.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      b916b785
  4. 31 7月, 2015 1 次提交
    • M
      arm: perf: factor arm_pmu core out to drivers · fa8ad788
      Mark Rutland 提交于
      To enable sharing of the arm_pmu code with arm64, this patch factors it
      out to drivers/perf/. A new drivers/perf directory is added for
      performance monitor drivers to live under.
      
      MAINTAINERS is updated accordingly. Files added previously without a
      corresponsing MAINTAINERS update (perf_regs.c, perf_callchain.c, and
      perf_event.h) are also added.
      
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      [will: augmented Kconfig help slightly]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      fa8ad788
  5. 28 5月, 2015 2 次提交
  6. 27 5月, 2015 1 次提交
    • M
      arm: perf: treat PMUs as CPU affine · cc88116d
      Mark Rutland 提交于
      In multi-cluster systems, the PMUs can be different across clusters, and
      so our logical PMU may not be able to schedule events on all CPUs.
      
      This patch adds a cpumask to encode which CPUs a PMU driver supports
      controlling events for, and limits the driver to scheduling events on
      those CPUs, and enabling and disabling the physical PMUs on those CPUs.
      The cpumask is built based on the interrupt-affinity property, and in
      the absence of such a property a homogenous system is assumed.
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      cc88116d
  7. 24 3月, 2015 1 次提交
    • W
      ARM: pmu: add support for interrupt-affinity property · 9fd85eb5
      Will Deacon 提交于
      Historically, the PMU devicetree bindings have expected SPIs to be
      listed in order of *logical* CPU number. This is problematic for
      bootloaders, especially when the boot CPU (logical ID 0) isn't listed
      first in the devicetree.
      
      This patch adds a new optional property, interrupt-affinity, to the
      PMU node which allows the interrupt affinity to be described using
      a list of phandled to CPU nodes, with each entry in the list
      corresponding to the SPI at the same index in the interrupts property.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9fd85eb5
  8. 30 10月, 2014 5 次提交
  9. 02 7月, 2014 2 次提交
  10. 21 2月, 2014 1 次提交
    • S
      ARM: perf: add hook for event index clearing · eab443ef
      Stephen Boyd 提交于
      On Krait processors we have a many-to-one relationship between
      raw CPU events and the event programmed into the PMNx counter.
      Two raw CPU events could map to the same value programmed in the
      PMNx counter. To avoid this problem, we check for collisions
      during the get_event_idx() callback by setting a bit in a bitmap
      whenever a certain event is used in a PMNx counter (see the next
      patch). Unfortunately, we don't have a hook to clear this bit in
      the bitmap when the event is deleted so let's add an optional
      clear_event_idx() callback for this purpose.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      eab443ef
  11. 09 11月, 2012 2 次提交
  12. 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
  13. 10 7月, 2012 1 次提交
    • W
      ARM: 7448/1: perf: remove arm_perf_pmu_ids global enumeration · 4295b898
      Will Deacon 提交于
      In order to provide PMU name strings compatible with the OProfile
      user ABI, an enumeration of all PMUs is currently used by perf to
      identify each PMU uniquely. Unfortunately, this does not scale well
      in the presence of multiple PMUs and creates a single, global namespace
      across all PMUs in the system.
      
      This patch removes the enumeration and instead uses the name string
      for the PMU to map onto the OProfile variant. perf_pmu_name is
      implemented for CPU PMUs, which is all that OProfile cares about anyway.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4295b898
  14. 07 3月, 2012 1 次提交
    • W
      ARM: 7354/1: perf: limit sample_period to half max_period in non-sampling mode · 57273471
      Will Deacon 提交于
      On ARM, the PMU does not stop counting after an overflow and therefore
      IRQ latency affects the new counter value read by the kernel. This is
      significant for non-sampling runs where it is possible for the new value
      to overtake the previous one, causing the delta to be out by up to
      max_period events.
      
      Commit a737823d ("ARM: 6835/1: perf: ensure overflows aren't missed due
      to IRQ latency") attempted to fix this problem by allowing interrupt
      handlers to pass an overflow flag to the event update function, causing
      the overflow calculation to assume that the counter passed through zero
      when going from prev to new. Unfortunately, this doesn't work when
      overflow occurs on the perf_task_tick path because we have the flag
      cleared and end up computing a large negative delta.
      
      This patch removes the overflow flag from armpmu_event_update and
      instead limits the sample_period to half of the max_period for
      non-sampling profiling runs.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      57273471
  15. 02 12月, 2011 1 次提交
  16. 16 11月, 2011 1 次提交
  17. 31 8月, 2011 2 次提交
  18. 12 8月, 2011 2 次提交
  19. 29 6月, 2011 1 次提交
    • M
      ARM: 6974/1: pmu: refactor reservation · f12482c9
      Mark Rutland 提交于
      Currently, PMU platform_device reservation relies on some minor abuse
      of the platform_device::id field for determining the type of PMU. This
      is problematic for device tree based probing, where the ID cannot be
      controlled.
      
      This patch removes reliance on the id field, and depends on each PMU's
      platform driver to figure out which type it is. As all PMUs handled by
      the current platform_driver name "arm-pmu" are CPU PMUs, this
      convention is hardcoded. New PMU types can be supported through the use
      of {of,platform}_device_id tables
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NJamie Iles <jamie@jamieiles.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      f12482c9
  20. 17 2月, 2011 1 次提交
  21. 17 5月, 2010 1 次提交
    • W
      ARM: 6064/1: pmu: register IRQs at runtime · 49c006b9
      Will Deacon 提交于
      The current PMU infrastructure for ARM requires that the IRQs for the PMU
      device are fixed at compile time and are selected based on the ARCH_ or MACH_ flags. This has the disadvantage of tying the Kernel down to a
      particular board as far as profiling is concerned.
      
      This patch replaces the compile-time IRQ registration with a runtime mechanism which allows the IRQs to be registered with the framework as
      a platform_device.
      
      A further advantage of this change is that there is scope for registering
      different types of performance counters in the future by changing the id
      of the platform_device and attaching different resources to it.
      Acked-by: NJamie Iles <jamie.iles@picochip.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      49c006b9
  22. 30 4月, 2010 1 次提交
  23. 13 2月, 2010 1 次提交