1. 07 Sep, 2016 1 commit
  2. 26 Aug, 2016 3 commits
    • Mark Rutland's avatar
      bus: arm-ccn: make event groups reliable · d662ed2e
      Mark Rutland authored
      The CCN PMU driver leaves the counting logic always enabled, and thus
      events are enabled while groups are manipulated. As each event is
      stopped and read individually, this leads to arbitrary skew across event
      groups, which can be seen if counting several identical events.
      
      To avoid this, implement pmu_{enable,disable} callbacks to stop and
      start all counters atomically around event manipulation. As the counters
      are now stopped, we cannot poll the cycle counter to wait for events to
      drain from the bus. However, as the counters are stopped and the events
      will not be read regardless, we can simply allow the bus to drain
      naturally.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      d662ed2e
    • Mark Rutland's avatar
      bus: arm-ccn: fix hrtimer registration · 5b1e01f3
      Mark Rutland authored
      The CCN PMU driver has a single hrtimer, used to simulate a periodic
      interrupt on systems where the overflow interrupt is not possible to
      use. The hrtimer is started when any event is started, and cancelled when
      any event is stopped. Thus, stopping a single event is sufficient to
      disable to hrtimer, and overflows (of other events) may be lost.
      
      To avoid this, this patch reworks the hrtimer start/cancel to only occur
      when the first event is added to a PMU, and the last event removed,
      making use of the existing bitmap counting active events.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      5b1e01f3
    • Mark Rutland's avatar
      bus: arm-ccn: fix PMU interrupt flags · 0811ef7e
      Mark Rutland authored
      Currently the IRQ core is permitted to make the CCN PMU IRQ handler
      threaded, and will allow userspace to change the CPU affinity of the
      interrupt behind our back. Both of these could violate our
      synchronisation requirements with the core perf code, which relies upon
      strict CPU affinity and disabling of interrupts to guarantee mutual
      exclusion in some cases.
      
      As with the CPU PMU drivers, we should request the interrupt with
      IRQF_NOBALANCING and IRQF_NO_THREAD, to avoid these issues.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarPawel Moll <pawel.moll@arm.com>
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      0811ef7e
  3. 17 Aug, 2016 5 commits
    • Pawel Moll's avatar
      bus: arm-ccn: Add missing event attribute exclusions for host/guest · 3249bce4
      Pawel Moll authored
      CCN PMUs have no knowledge into VM-related origins of the memory
      traffic, therefore can't handle requests for host-only or guest-only
      events.
      
      Added appropriate exclusions (they should have been there from the
      beginning). This required changing the error code returned, as the
      userspace tool only re-negotiates the options (exclude_guest is true by
      default) only for EINVAL.
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      3249bce4
    • Pawel Moll's avatar
      bus: arm-ccn: Correct required arguments for XP PMU events · 90d11e26
      Pawel Moll authored
      XP can provide events from two sources: watchpoints, observing traffic
      on device ports and PMU looking at internal buses.
      
      Unfortunately the sysfs definition of the PMU events was requiring
      port number (instead of bus number) and direction (the buses are
      unidirectional), as these fields were shared with the watchpoint event.
      
      Although it does not introduce a major problem (port can be used as
      bus alias and direction is simply ignored for XP PMU events), it's
      better to fix it now, before external tools start depending on this
      behaviour.
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      90d11e26
    • Pawel Moll's avatar
      bus: arm-ccn: Fix XP watchpoint settings bitmask · b928466b
      Pawel Moll authored
      The code setting XP watchpoint comparator and mask registers should, in
      order to be fully compliant with specification, zero one or more most
      significant bits of each field. In both L cases it means zeroing bit 63.
      The bitmask doing this was wrong, though, zeroing bit 60 instead.
      Fortunately, due to a lucky coincidence, this turned out to be fairly
      innocent with the existing hardware.
      
      Fixed now.
      
      Cc: stable@vger.kernel.org # 3.17+
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      b928466b
    • Pawel Moll's avatar
      bus: arm-ccn: Do not attempt to configure XPs for cycle counter · b7c1beb2
      Pawel Moll authored
      Fuzzing the CCN perf driver revealed a small but definitely dangerous
      mistake in the event setup code. When a cycle counter is requested, the
      driver should not reconfigure the events bus at all, otherwise it will
      corrupt (in most but the simplest cases) its configuration and may end
      up accessing XP array out of its bounds and corrupting control
      registers.
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
      Tested-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: stable@vger.kernel.org # 3.17+
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      b7c1beb2
    • Pawel Moll's avatar
      bus: arm-ccn: Fix PMU handling of MN · 4e486cba
      Pawel Moll authored
      The "Miscellaneous Node" fell through cracks of node initialisation,
      as its ID is shared with HN-I.
      
      This patch treats MN as a special case (which it is), adding separate
      validation check for it and pre-defining the node ID in relevant events
      descriptions. That way one can simply run:
      
      	# perf stat -a -e ccn/mn_ecbarrier/ <workload>
      
      Additionally, direction in the MN pseudo-events XP watchpoint
      definitions is corrected to be "TX" (1) as they are defined from the
      crosspoint point of view (thus barriers are transmitted from XP to MN).
      
      Cc: stable@vger.kernel.org # 3.17+
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      4e486cba
  4. 08 Aug, 2016 1 commit
  5. 14 Jul, 2016 2 commits
  6. 11 Jul, 2016 2 commits
    • Ben Dooks's avatar
      bus: mvebu-mbus: make mvebu_mbus_syscore_ops static · ac29abf3
      Ben Dooks authored
      Make mvebu_mbus_syscore_ops static as it does not get
      used or declared outside mvebu-mbus.c to fix the following
      sparse warning:
      
      linux/drivers/bus/mvebu-mbus.c:1092:20: warning: symbol 'mvebu_mbus_syscore_ops' was not declared. Should it be static?
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      ac29abf3
    • Ben Dooks's avatar
      bus: mvebu-mbus: fix __iomem on register pointers · fce7b5ae
      Ben Dooks authored
      The save_cpu_target functions should take "u32 __iomem *", not a
      plain "u32 *" as it is passed to register access functions. Fix
      the following warnings by adding the annotation:
      
      drivers/bus/mvebu-mbus.c:739:17: warning: incorrect type in argument 2 (different address spaces)
      drivers/bus/mvebu-mbus.c:739:17:    expected void volatile [noderef] <asn:2>*addr
      drivers/bus/mvebu-mbus.c:739:17:    got unsigned int [usertype] *
      drivers/bus/mvebu-mbus.c:741:17: warning: incorrect type in argument 2 (different address spaces)
      drivers/bus/mvebu-mbus.c:741:17:    expected void volatile [noderef] <asn:2>*addr
      drivers/bus/mvebu-mbus.c:741:17:    got unsigned int [usertype] *
      drivers/bus/mvebu-mbus.c:742:17: warning: incorrect type in argument 2 (different address spaces)
      drivers/bus/mvebu-mbus.c:742:17:    expected void volatile [noderef] <asn:2>*addr
      drivers/bus/mvebu-mbus.c:742:17:    got unsigned int [usertype] *
      drivers/bus/mvebu-mbus.c:744:17: warning: incorrect type in argument 2 (different address spaces)
      drivers/bus/mvebu-mbus.c:744:17:    expected void volatile [noderef] <asn:2>*addr
      drivers/bus/mvebu-mbus.c:744:17:    got unsigned int [usertype] *
      drivers/bus/mvebu-mbus.c:790:17: warning: incorrect type in argument 2 (different address spaces)
      drivers/bus/mvebu-mbus.c:790:17:    expected void volatile [noderef] <asn:2>*addr
      drivers/bus/mvebu-mbus.c:790:17:    got unsigned int [usertype] *
      drivers/bus/mvebu-mbus.c:792:17: warning: incorrect type in argument 2 (different address spaces)
      drivers/bus/mvebu-mbus.c:792:17:    expected void volatile [noderef] <asn:2>*addr
      drivers/bus/mvebu-mbus.c:792:17:    got unsigned int [usertype] *
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      fce7b5ae
  7. 01 Jul, 2016 1 commit
    • Jon Hunter's avatar
      bus: Add support for Tegra ACONNECT · 46a88534
      Jon Hunter authored
      Add a bus driver for the Tegra ACONNECT which is used to interface to
      various devices within the Audio Processing Engine (APE). The purpose
      of the bus driver is to register child devices that are accessed via
      the ACONNECT bus and through the device parent child relationship,
      ensure that the appropriate power domain and clocks are enabled for
      the ACONNECT when any of the child devices are active. Hence, the
      ACONNECT driver simply enables runtime-pm for the ACONNECT device
      so that when a child device is resumed, it will enable the power-domain
      and clocks associated with the ACONNECT.
      Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      46a88534
  8. 23 Jun, 2016 2 commits
  9. 13 May, 2016 2 commits
  10. 09 May, 2016 1 commit
    • Suzuki K Poulose's avatar
      arm-ccn: Enable building as module · 5420f9fd
      Suzuki K Poulose authored
      arm-ccn driver uses irq_set_affinity, which is not exported and
      hence cannot be built as a module, eventhough we have all the
      bits ready. This patch makes use of the exported helper
      irq_set_affinity_hint() instead. Also, the __free_irq expects
      the affinity_hint to be NULL when we free the irq. So set the
      affinity_hint to NULL at clean up.
      
      Now that we can build it as a module, update the Kconfig to
      reflect the change.
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: default avatarPawel Moll <pawel.moll@arm.com>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      5420f9fd
  11. 18 Apr, 2016 1 commit
  12. 12 Apr, 2016 1 commit
  13. 30 Mar, 2016 1 commit
    • Arnd Bergmann's avatar
      bus: mvebu-mbus: use %pa to print phys_addr_t · 77644ad8
      Arnd Bergmann authored
      A recent change to the mbus driver added a warning printk that
      prints a phys_addr_t using the %x format string, which fails in
      case we build with 64-bit phys_addr_t:
      
      drivers/bus/mvebu-mbus.c: In function 'mvebu_mbus_get_dram_win_info':
      drivers/bus/mvebu-mbus.c:975:9: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'phys_addr_t {aka long long unsigned int}' [-Werror=format=]
      
      This uses the special %pa format string instead, so we always
      print the correct type.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: f2900ace ("bus: mvebu-mbus: provide api for obtaining IO and DRAM window information")
      Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      77644ad8
  14. 27 Mar, 2016 1 commit
  15. 14 Mar, 2016 1 commit
  16. 12 Mar, 2016 1 commit
  17. 29 Feb, 2016 14 commits