17 Oct, 2016

1 commit

  • In acpi_get_pmu_hw_inf we pass the address of a local variable to IS_ERR(),
    which doesn't make sense, as the pointer must be a real, valid pointer.
    This doesn't cause a functional problem, as IS_ERR() will evaluate as
    false, but the check is bogus and causes static checkers to complain.

    Remove the bogus check.

    The bug is reported by Dan Carpenter in [1]

    [1] https://www.spinics.net/lists/arm-kernel/msg535957.html

    Signed-off-by: Tai Nguyen
    Acked-by: Mark Rutland
    Signed-off-by: Will Deacon

    Tai Nguyen
     

08 Oct, 2016

1 commit

  • Pull ARM SoC driver updates from Arnd Bergmann:
    "Driver updates for ARM SoCs, including a couple of newly added
    drivers:

    - The Qualcomm external bus interface 2 (EBI2), used in some of their
    mobile phone chips for connecting flash memory, LCD displays or
    other peripherals

    - Secure monitor firmware for Amlogic SoCs, and an NVMEM driver for
    the EFUSE based on that firmware interface.

    - Perf support for the AppliedMicro X-Gene performance monitor unit

    - Reset driver for STMicroelectronics STM32

    - Reset driver for SocioNext UniPhier SoCs

    Aside from these, there are minor updates to SoC-specific bus,
    clocksource, firmware, pinctrl, reset, rtc and pmic drivers"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits)
    bus: qcom-ebi2: depend on HAS_IOMEM
    pinctrl: mvebu: orion5x: Generalise mv88f5181l support for 88f5181
    clk: mvebu: Add clk support for the orion5x SoC mv88f5181
    dt-bindings: EXYNOS: Add Exynos5433 PMU compatible
    clocksource: exynos_mct: Add the support for ARM64
    perf: xgene: Add APM X-Gene SoC Performance Monitoring Unit driver
    Documentation: Add documentation for APM X-Gene SoC PMU DTS binding
    MAINTAINERS: Add entry for APM X-Gene SoC PMU driver
    bus: qcom: add EBI2 driver
    bus: qcom: add EBI2 device tree bindings
    rtc: rtc-pm8xxx: Add support for pm8018 rtc
    nvmem: amlogic: Add Amlogic Meson EFUSE driver
    firmware: Amlogic: Add secure monitor driver
    soc: qcom: smd: Reset rx tail rather than tx
    memory: atmel-sdramc: fix a possible NULL dereference
    reset: hi6220: allow to compile test driver on other architectures
    reset: zynq: add driver Kconfig option
    reset: sunxi: add driver Kconfig option
    reset: stm32: add driver Kconfig option
    reset: socfpga: add driver Kconfig option
    ...

    Linus Torvalds
     

04 Oct, 2016

1 commit

  • Pull CPU hotplug updates from Thomas Gleixner:
    "Yet another batch of cpu hotplug core updates and conversions:

    - Provide core infrastructure for multi instance drivers so the
    drivers do not have to keep custom lists.

    - Convert custom lists to the new infrastructure. The block-mq custom
    list conversion comes through the block tree and makes the diffstat
    tip over to more lines removed than added.

    - Handle unbalanced hotplug enable/disable calls more gracefully.

    - Remove the obsolete CPU_STARTING/DYING notifier support.

    - Convert another batch of notifier users.

    The relayfs changes which conflicted with the conversion have been
    shipped to me by Andrew.

    The remaining lot is targeted for 4.10 so that we finally can remove
    the rest of the notifiers"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
    cpufreq: Fix up conversion to hotplug state machine
    blk/mq: Reserve hotplug states for block multiqueue
    x86/apic/uv: Convert to hotplug state machine
    s390/mm/pfault: Convert to hotplug state machine
    mips/loongson/smp: Convert to hotplug state machine
    mips/octeon/smp: Convert to hotplug state machine
    fault-injection/cpu: Convert to hotplug state machine
    padata: Convert to hotplug state machine
    cpufreq: Convert to hotplug state machine
    ACPI/processor: Convert to hotplug state machine
    virtio scsi: Convert to hotplug state machine
    oprofile/timer: Convert to hotplug state machine
    block/softirq: Convert to hotplug state machine
    lib/irq_poll: Convert to hotplug state machine
    x86/microcode: Convert to hotplug state machine
    sh/SH-X3 SMP: Convert to hotplug state machine
    ia64/mca: Convert to hotplug state machine
    ARM/OMAP/wakeupgen: Convert to hotplug state machine
    ARM/shmobile: Convert to hotplug state machine
    arm64/FP/SIMD: Convert to hotplug state machine
    ...

    Linus Torvalds
     

03 Oct, 2016

1 commit

  • Pull arm64 updates from Will Deacon:
    "It's a bit all over the place this time with no "killer feature" to
    speak of. Support for mismatched cache line sizes should help people
    seeing whacky JIT failures on some SoCs, and the big.LITTLE perf
    updates have been a long time coming, but a lot of the changes here
    are cleanups.

    We stray outside arch/arm64 in a few areas: the arch/arm/ arch_timer
    workaround is acked by Russell, the DT/OF bits are acked by Rob, the
    arch_timer clocksource changes acked by Marc, CPU hotplug by tglx and
    jump_label by Peter (all CC'd).

    Summary:

    - Support for execute-only page permissions
    - Support for hibernate and DEBUG_PAGEALLOC
    - Support for heterogeneous systems with mismatches cache line sizes
    - Errata workarounds (A53 843419 update and QorIQ A-008585 timer bug)
    - arm64 PMU perf updates, including cpumasks for heterogeneous systems
    - Set UTS_MACHINE for building rpm packages
    - Yet another head.S tidy-up
    - Some cleanups and refactoring, particularly in the NUMA code
    - Lots of random, non-critical fixes across the board"

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (100 commits)
    arm64: tlbflush.h: add __tlbi() macro
    arm64: Kconfig: remove SMP dependence for NUMA
    arm64: Kconfig: select OF/ACPI_NUMA under NUMA config
    arm64: fix dump_backtrace/unwind_frame with NULL tsk
    arm/arm64: arch_timer: Use archdata to indicate vdso suitability
    arm64: arch_timer: Work around QorIQ Erratum A-008585
    arm64: arch_timer: Add device tree binding for A-008585 erratum
    arm64: Correctly bounds check virt_addr_valid
    arm64: migrate exception table users off module.h and onto extable.h
    arm64: pmu: Hoist pmu platform device name
    arm64: pmu: Probe default hw/cache counters
    arm64: pmu: add fallback probe table
    MAINTAINERS: Update ARM PMU PROFILING AND DEBUGGING entry
    arm64: Improve kprobes test for atomic sequence
    arm64/kvm: use alternative auto-nop
    arm64: use alternative auto-nop
    arm64: alternative: add auto-nop infrastructure
    arm64: lse: convert lse alternatives NOP padding to use __nops
    arm64: barriers: introduce nops and __nops macros for NOP sequences
    arm64: sysreg: replace open-coded mrs_s/msr_s with {read,write}_sysreg_s
    ...

    Linus Torvalds
     

19 Sep, 2016

1 commit


17 Sep, 2016

1 commit

  • In preparation for ACPI support, add a pmu_probe_info table to
    the arm_pmu_device_probe() call. This table gets used when
    probing in the absence of a devicetree node for PMU.

    Signed-off-by: Mark Salter
    Signed-off-by: Jeremy Linton
    Signed-off-by: Will Deacon

    Mark Salter
     

16 Sep, 2016

1 commit


09 Sep, 2016

3 commits

  • In systems with heterogeneous CPUs, there are multiple logical CPU PMUs,
    each of which covers a subset of CPUs in the system. In some cases
    userspace needs to know which CPUs a given logical PMU covers, so we'd
    like to expose a cpumask under sysfs, similar to what is done for uncore
    PMUs.

    Unfortunately, prior to commit 00e727bb389359c8 ("perf stat: Balance
    opening and reading events"), perf stat only correctly handled a cpumask
    holding a single CPU, and only when profiling in system-wide mode. In
    other cases, the presence of a cpumask file could cause perf stat to
    behave erratically.

    Thus, exposing a cpumask file would break older perf binaries in cases
    where they would otherwise work.

    To avoid this issue while still providing userspace with the information
    it needs, this patch exposes a differently-named file (cpus) under
    sysfs. New tools can look for this and operate correctly, while older
    tools will not be adversely affected by its presence.

    Signed-off-by: Mark Rutland
    Cc: Will Deacon
    Signed-off-by: Will Deacon

    Mark Rutland
     
  • Now that the 32-bit and 64-bit perf backends use the common groups
    directly, remove the fallback and no longer allow the groups array to be
    overridden.

    Signed-off-by: Mark Rutland
    Cc: Will Deacon
    Signed-off-by: Will Deacon

    Mark Rutland
     
  • In preparation for adding common attribute groups, add an array of
    attribute group pointers to arm_pmu, which will be used if the
    backend hasn't already set pmu::attr_groups.

    Subsequent patches will move backends over to using these, before adding
    common fields.

    Signed-off-by: Mark Rutland
    Cc: Will Deacon
    Signed-off-by: Will Deacon

    Mark Rutland
     

07 Sep, 2016

1 commit


03 Sep, 2016

3 commits

  • Signed-off-by: Sebastian Andrzej Siewior
    Cc: Peter Zijlstra
    Cc: Mark Rutland
    Cc: Will Deacon
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160817171420.sdwk2qivxunzryz4@linutronix.de
    Signed-off-by: Thomas Gleixner

    Sebastian Andrzej Siewior
     
  • Patch 7f1d642fbb5c ("drivers/perf: arm-pmu: Fix handling of SPI lacking
    interrupt-affinity property") unintended also fixes perf_event support
    for bcm2835 which doesn't have PMU interrupts. Unfortunately this change
    introduce a NULL pointer dereference on bcm2835, because irq_is_percpu
    always expected to be called with a valid IRQ. So fix this regression
    by validating the IRQ before.

    Tested-by: Kevin Hilman
    Signed-off-by: Stefan Wahren
    Fixes: 7f1d642fbb5c ("drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property")
    Signed-off-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Stefan Wahren
     
  • In case of a IRQ type mismatch in of_pmu_irq_cfg() the
    device node for interrupt affinity isn't freed. So fix this
    issue by calling of_node_put().

    Signed-off-by: Stefan Wahren
    Fixes: fa8ad7889d83 ("arm: perf: factor arm_pmu core out to drivers")
    Signed-off-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Stefan Wahren
     

10 Aug, 2016

2 commits

  • Patch 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt
    affinity mask") added support for partitionned PPI setups, but
    inadvertently broke setups using SPIs without the "interrupt-affinity"
    property (which is the case for UP platforms).

    This patch restore the broken functionnality by testing whether the
    interrupt is percpu or not instead of relying on the using_spi flag
    that really means "SPI *and* interrupt-affinity property".

    Acked-by: Mark Rutland
    Reported-by: Geert Uytterhoeven
    Tested-by: Geert Uytterhoeven
    Fixes: 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask")
    Signed-off-by: Marc Zyngier
    Signed-off-by: Will Deacon

    Marc Zyngier
     
  • arm_pmu_mutex is never held long and we don't want to sleep while the
    lock is being held as it's executed in the context of hotplug notifiers.
    So it can be converted to a simple spinlock instead.

    Without this patch we get the following warning:

    BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
    in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/2
    no locks held by swapper/2/0.
    irq event stamp: 381314
    hardirqs last enabled at (381313): _raw_spin_unlock_irqrestore+0x7c/0x88
    hardirqs last disabled at (381314): cpu_die+0x28/0x48
    softirqs last enabled at (381294): _local_bh_enable+0x28/0x50
    softirqs last disabled at (381293): irq_enter+0x58/0x78
    CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.7.0 #12
    Call trace:
    dump_backtrace+0x0/0x220
    show_stack+0x24/0x30
    dump_stack+0xb4/0xf0
    ___might_sleep+0x1d8/0x1f0
    __might_sleep+0x5c/0x98
    mutex_lock_nested+0x54/0x400
    arm_perf_starting_cpu+0x34/0xb0
    cpuhp_invoke_callback+0x88/0x3d8
    notify_cpu_starting+0x78/0x98
    secondary_start_kernel+0x108/0x1a8

    This patch converts the mutex to spinlock to eliminate the above
    warnings. This constraints pmu->reset to be non-blocking call which is
    the case with all the ARM PMU backends.

    Cc: Stephen Boyd
    Fixes: 37b502f121ad ("arm/perf: Fix hotplug state machine conversion")
    Acked-by: Mark Rutland
    Signed-off-by: Sudeep Holla
    Signed-off-by: Will Deacon

    Sudeep Holla
     

30 Jul, 2016

1 commit

  • Pull smp hotplug updates from Thomas Gleixner:
    "This is the next part of the hotplug rework.

    - Convert all notifiers with a priority assigned

    - Convert all CPU_STARTING/DYING notifiers

    The final removal of the STARTING/DYING infrastructure will happen
    when the merge window closes.

    Another 700 hundred line of unpenetrable maze gone :)"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    timers/core: Correct callback order during CPU hot plug
    leds/trigger/cpu: Move from CPU_STARTING to ONLINE level
    powerpc/numa: Convert to hotplug state machine
    arm/perf: Fix hotplug state machine conversion
    irqchip/armada: Avoid unused function warnings
    ARC/time: Convert to hotplug state machine
    clocksource/atlas7: Convert to hotplug state machine
    clocksource/armada-370-xp: Convert to hotplug state machine
    clocksource/exynos_mct: Convert to hotplug state machine
    clocksource/arm_global_timer: Convert to hotplug state machine
    rcu: Convert rcutree to hotplug state machine
    KVM/arm/arm64/vgic-new: Convert to hotplug state machine
    smp/cfd: Convert core to hotplug state machine
    x86/x2apic: Convert to CPU hotplug state machine
    profile: Convert to hotplug state machine
    timers/core: Convert to hotplug state machine
    hrtimer: Convert to hotplug state machine
    x86/tboot: Convert to hotplug state machine
    arm64/armv8 deprecated: Convert to hotplug state machine
    hwtracing/coresight-etm4x: Convert to hotplug state machine
    ...

    Linus Torvalds
     

20 Jul, 2016

1 commit

  • Mark Rutland pointed out that this commit is incomplete:

    7d88eb695a1f ("arm/perf: Convert to hotplug state machine")

    The problem is that:

    > We may have multiple PMUs (e.g. two in big.LITTLE systems), and
    > __oprofile_cpu_pmu only contains one of these. So this conversion is not
    > correct.
    >
    > We were relying on the notifier list implicitly containing a list of
    > those PMUs. It seems like we need an explicit list here.
    >
    > We keep __oprofile_cpu_pmu around for legacy 32-bit users of OProfile
    > (on non-hetereogeneous systems), and that's all that the variable should
    > be used for.

    Introduce arm_pmu_list to correctly handle multiple PMUs in the system.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Mark Rutland
    Cc: Anna-Maria Gleixner
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Cc: linux-tip-commits@vger.kernel.org
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160719111733.GA22911@linutronix.de
    Signed-off-by: Ingo Molnar

    Sebastian Andrzej Siewior
     

15 Jul, 2016

1 commit

  • Straight forward conversion w/o bells and whistles.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Cc: Linus Torvalds
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Will Deacon
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153335.794097159@linutronix.de
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

09 Jul, 2016

1 commit

  • On a big-little system, PMUs can be wired to CPUs using per CPU
    interrups (PPI). In this case, it is important to make sure that
    the enable/disable do happen on the right set of CPUs.

    So instead of relying on the interrupt-affinity property, we can
    use the actual percpu affinity that DT exposes as part of the
    interrupt specifier. The DT binding is also updated to reflect
    the fact that the interrupt-affinity property shouldn't be used
    in that case.

    Acked-by: Rob Herring
    Tested-by: Caesar Wang
    Signed-off-by: Marc Zyngier
    Signed-off-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Marc Zyngier
     

15 Jun, 2016

1 commit

  • There is a problem in the non-devicetree PMU probing where some
    probe functions may get the number of supported events through
    smp_call_function_any() using the arm_pmu supported_cpus mask.
    But at the time the probe function is called, the supported_cpus
    mask is empty so the call fails. This patch makes sure the mask
    is set before calling the init function rather than after.

    Signed-off-by: Mark Salter
    Signed-off-by: Jeremy Linton
    Signed-off-by: Will Deacon

    Mark Salter
     

03 Jun, 2016

3 commits

  • pmu->irq_affinity will not be freed if an error occurred within
    arm_pmu_device_probe after of_pmu_irq_cfg has been called.

    Note that in the case of_pmu_irq_cfg is returning an error,
    pmu->irq_affinity will not be set, but it should be NULL as pmu was
    kzalloc'd. Therefore the result kfree(NULL) is benign.

    Signed-off-by: Julien Grall
    Acked-by: Mark Rutland
    Signed-off-by: Will Deacon

    Julien Grall
     
  • The global variable __oprofile_cpu_pmu is set before the PMU is fully
    initialized. If an error occurs before the end of the initialization,
    the PMU will be freed and the variable will contain an invalid pointer.

    This will result in a kernel crash when perf will be used.

    Fix it by moving the setting of __oprofile_cpu_pmu when the PMU is fully
    initialized (i.e when it is no longer possible to fail).

    Cc:
    Signed-off-by: Julien Grall
    Acked-by: Mark Rutland
    Signed-off-by: Will Deacon

    Julien Grall
     
  • The only function called by of_pmu_irq_cfg that will increment the
    reference count on dn is of_parse_phandle.

    Each time we successfully parse a possible CPU from an
    interrupt-affinity property, we increment the refcount of that CPU node
    once via of_parse_handle. After validating the CPU is possible, we
    decrement the refcount once. Subsequently, we decrement the refcount
    again, either as part of an early break if we don't have a matching SPI,
    or as part of the end of the loop body.

    This will lead to decrementing twice the refcounnt.
    Remove the second pairs of call to of_node_put as nobody is using dn
    between the first and second call to of_node_put.

    Signed-off-by: Julien Grall
    Acked-by: Mark Rutland
    Signed-off-by: Will Deacon

    Julien Grall
     

05 May, 2016

1 commit

  • Commit:

    26657848502b7847 ("perf/core: Verify we have a single perf_hw_context PMU")

    forcefully prevents multiple PMUs from sharing perf_hw_context, as this
    generally doesn't make sense. It is a common bug for uncore PMUs to
    use perf_hw_context rather than perf_invalid_context, which this detects.

    However, systems exist with heterogeneous CPUs (and hence heterogeneous
    HW PMUs), for which sharing perf_hw_context is necessary, and possible
    in some limited cases.

    To make this work we have to perform some gymnastics, as we did in these
    commits:

    66eb579e66ecfea5 ("perf: allow for PMU-specific event filtering")
    c904e32a69b7c779 ("arm: perf: filter unschedulable events")

    To allow those systems to work, we must allow PMUs for heterogeneous
    CPUs to share perf_hw_context, though we must still disallow sharing
    otherwise to detect the common misuse of perf_hw_context.

    This patch adds a new PERF_PMU_CAP_HETEROGENEOUS_CPUS for this, updates
    the core logic to account for this, and makes use of it in the arm_pmu
    code that is used for systems with heterogeneous CPUs. Comments are
    added to make the rationale clear and hopefully avoid accidental abuse.

    Signed-off-by: Mark Rutland
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Alexander Shishkin
    Cc: Arnaldo Carvalho de Melo
    Cc: Catalin Marinas
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Thomas Gleixner
    Cc: Vince Weaver
    Cc: Will Deacon
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/20160426103346.GA20836@leverpostej
    Signed-off-by: Ingo Molnar

    Mark Rutland
     

21 Apr, 2016

1 commit

  • Commit da4e4f18afe0 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
    added code in the arm perf infrastructure that allows the kernel to
    save/restore perf counters whenever the CPU enters a low-power
    state. The kernel saves/restores the counters for each active event
    through the armpmu_{stop/start} ARM pmu API, so that the low-power state
    enter/exit cycle is emulated through pmu start/stop operations for each
    event in use.

    However, calling armpmu_start() for each active event on power up
    executes code that requires RCU locking (perf_event_update_userpage())
    to be functional, so, given that the core may call the CPU_PM notifiers
    while running the idle thread in an quiescent RCU state this is not
    allowed as detected through the following splat when kernel is run with
    CONFIG_PROVE_LOCKING enabled:

    [ 49.293286]
    [ 49.294761] ===============================
    [ 49.298895] [ INFO: suspicious RCU usage. ]
    [ 49.303031] 4.6.0-rc3+ #421 Not tainted
    [ 49.306821] -------------------------------
    [ 49.310956] include/linux/rcupdate.h:872 rcu_read_lock() used
    illegally while idle!
    [ 49.318530]
    [ 49.318530] other info that might help us debug this:
    [ 49.318530]
    [ 49.326451]
    [ 49.326451] RCU used illegally from idle CPU!
    [ 49.326451] rcu_scheduler_active = 1, debug_locks = 0
    [ 49.337209] RCU used illegally from extended quiescent state!
    [ 49.342892] 2 locks held by swapper/2/0:
    [ 49.346768] #0: (cpu_pm_notifier_lock){......}, at:
    [] cpu_pm_exit+0x18/0x80
    [ 49.355492] #1: (rcu_read_lock){......}, at: []
    perf_event_update_userpage+0x0/0x260

    This patch wraps the armpmu_start() call (that indirectly calls
    perf_event_update_userpage()) on CPU_PM notifier power state exit (or
    failed entry) within the RCU_NONIDLE() macro so that the RCU subsystem
    is made aware the calling cpu is not idle from an RCU perspective for
    the armpmu_start() call duration, therefore fixing the issue.

    Fixes: da4e4f18afe0 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
    Signed-off-by: Lorenzo Pieralisi
    Reported-by: James Morse
    Suggested-by: Kevin Hilman
    Cc: Ashwin Chaugule
    Cc: Kevin Hilman
    Cc: Sudeep Holla
    Cc: Daniel Lezcano
    Cc: Mathieu Poirier
    Acked-by: Mark Rutland
    Acked-by: Paul E. McKenney
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Lorenzo Pieralisi
     

21 Mar, 2016

1 commit

  • Commit c6b90653f1f7 ("drivers/perf: arm_pmu: make info messages more
    verbose") breaks booting on systems where the PMU is probed without
    devicetree (e.g by inspecting the MIDR of the current CPU). In this case,
    pdev->dev.of_node is NULL and we shouldn't try to access its ->fullname
    field when printing probe error messages.

    This patch fixes the probing code to use of_node_full_name, which safely
    handles NULL nodes and removes the "Error %i" part of the string, since
    it's not terribly useful.

    Reported-by: Guenter Roeck
    Signed-off-by: Will Deacon

    Will Deacon
     

26 Feb, 2016

1 commit

  • 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
    Cc: Sudeep Holla
    Cc: Daniel Lezcano
    Cc: Mathieu Poirier
    Cc: Mark Rutland
    Acked-by: Ashwin Chaugule
    Acked-by: Kevin Hilman
    Signed-off-by: Lorenzo Pieralisi
    Signed-off-by: Will Deacon

    Lorenzo Pieralisi
     

09 Feb, 2016

1 commit

  • On a big.LITTLE system e.g. with Cortex A57 and A53 in case not all cores
    are online at PMU probe time we might get

    hw perfevents: failed to probe PMU!
    hw perfevents: failed to register PMU devices!

    making it unclear which cores failed, here.

    Add the device tree full name which failed and the error value resulting
    in a more verbose and helpful message like

    hw perfevents: /soc/pmu_a53: failed to probe PMU! Error -6
    hw perfevents: /soc/pmu_a53: failed to register PMU devices! Error -6

    Signed-off-by: Dirk Behme
    Signed-off-by: Will Deacon

    Dirk Behme
     

26 Jan, 2016

1 commit

  • ARMv7 counters other than the CPU cycle counter only work if the Secure
    Debug Enable Register (SDER) SUNIDEN bit is set.

    Since access to the SDER is only possible in secure state, it will
    only be done if the device tree property "secure-reg-access" is set.

    Without this:

    Performance counter stats for 'sleep 1':

    14606094 cycles # 0.000 GHz
    0 instructions # 0.00 insns per cycle

    After applying:

    Performance counter stats for 'sleep 1':

    5843809 cycles
    2566484 instructions # 0.44 insns per cycle

    1.020144000 seconds time elapsed

    Some platforms (eg i.MX53) may also need additional platform specific
    setup.

    Acked-by: Rob Herring
    Signed-off-by: Martin Fuzzey
    Signed-off-by: Pooya Keshavarzi
    Signed-off-by: George G. Davis
    [will: add warning if property is found on arm64]
    Signed-off-by: Will Deacon

    Martin Fuzzey
     

16 Nov, 2015

1 commit

  • 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: Mark Rutland
    Suggested-by: Will Deacon
    Cc: Drew Richardson
    Cc: Pawel Moll
    Signed-off-by: Will Deacon

    Mark Rutland
     

05 Nov, 2015

1 commit

  • Pull arm64 updates from Catalin Marinas:

    - "genirq: Introduce generic irq migration for cpu hotunplugged" patch
    merged from tip/irq/for-arm to allow the arm64-specific part to be
    upstreamed via the arm64 tree

    - CPU feature detection reworked to cope with heterogeneous systems
    where CPUs may not have exactly the same features. The features
    reported by the kernel via internal data structures or ELF_HWCAP are
    delayed until all the CPUs are up (and before user space starts)

    - Support for 16KB pages, with the additional bonus of a 36-bit VA
    space, though the latter only depending on EXPERT

    - Implement native {relaxed, acquire, release} atomics for arm64

    - New ASID allocation algorithm which avoids IPI on roll-over, together
    with TLB invalidation optimisations (using local vs global where
    feasible)

    - KASan support for arm64

    - EFI_STUB clean-up and isolation for the kernel proper (required by
    KASan)

    - copy_{to,from,in}_user optimisations (sharing the memcpy template)

    - perf: moving arm64 to the arm32/64 shared PMU framework

    - L1_CACHE_BYTES increased to 128 to accommodate Cavium hardware

    - Support for the contiguous PTE hint on kernel mapping (16 consecutive
    entries may be able to use a single TLB entry)

    - Generic CONFIG_HZ now used on arm64

    - defconfig updates

    * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (91 commits)
    arm64/efi: fix libstub build under CONFIG_MODVERSIONS
    ARM64: Enable multi-core scheduler support by default
    arm64/efi: move arm64 specific stub C code to libstub
    arm64: page-align sections for DEBUG_RODATA
    arm64: Fix build with CONFIG_ZONE_DMA=n
    arm64: Fix compat register mappings
    arm64: Increase the max granular size
    arm64: remove bogus TASK_SIZE_64 check
    arm64: make Timer Interrupt Frequency selectable
    arm64/mm: use PAGE_ALIGNED instead of IS_ALIGNED
    arm64: cachetype: fix definitions of ICACHEF_* flags
    arm64: cpufeature: declare enable_cpu_capabilities as static
    genirq: Make the cpuhotplug migration code less noisy
    arm64: Constify hwcap name string arrays
    arm64/kvm: Make use of the system wide safe values
    arm64/debug: Make use of the system wide safe value
    arm64: Move FP/ASIMD hwcap handling to common code
    arm64/HWCAP: Use system wide safe values
    arm64/capabilities: Make use of system wide safe value
    arm64: Delay cpu feature capability checks
    ...

    Linus Torvalds
     

15 Oct, 2015

1 commit


07 Oct, 2015

1 commit

  • Now that the arm_pmu framework has been factored out to drivers/perf we
    can make use of it for arm64, gaining support for heterogeneous PMUs
    and unifying the two codebases before they diverge further.

    The as yet unused PMU name for PMUv3 is changed to armv8_pmuv3, matching
    the style previously applied to the 32-bit PMUs.

    Signed-off-by: Mark Rutland
    Acked-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Mark Rutland
     

31 Jul, 2015

1 commit

  • 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
    Cc: Greg Kroah-Hartman
    Cc: Ingo Molnar
    Cc: Linus Walleij
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Will Deacon
    Signed-off-by: Mark Rutland
    [will: augmented Kconfig help slightly]
    Signed-off-by: Will Deacon

    Mark Rutland