]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Probe for MIPS MT perf counters per TC
authorMatt Redfearn <matt.redfearn@mips.com>
Fri, 20 Apr 2018 10:23:03 +0000 (11:23 +0100)
committerJames Hogan <jhogan@kernel.org>
Tue, 15 May 2018 12:33:48 +0000 (13:33 +0100)
commit145595493f52edab9f697398db8dac0185c20c1c
treeb1b53056e508652bbe147a228640e08a54efc6ae
parentd098f36e6bbe659c4e58d070db9f43216111d317
MIPS: Probe for MIPS MT perf counters per TC

Processors implementing the MIPS MT ASE may have performance counters
implemented per core or per TC. Processors implemented by MIPS
Technologies signify presence per TC through a bit in the implementation
specific Config7 register. Currently the code which probes for their
presence blindly reads a magic number corresponding to this bit, despite
it potentially having a different meaning in the CPU implementation.

Since CPU features are generally detected by cpu-probe.c, perform the
detection here instead. Introduce cpu_set_mt_per_tc_perf which checks
the bit in config7 and call it from MIPS CPUs known to implement this
bit and the MT ASE, specifically, the 34K, 1004K and interAptiv.

Once the presence of the per-tc counter is indicated in cpu_data, tests
for it can be updated to use this flag.

Suggested-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Matt Redfearn <matt.redfearn@mips.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Maciej W. Rozycki <macro@mips.com>
Cc: linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/19136/
Signed-off-by: James Hogan <jhogan@kernel.org>
arch/mips/include/asm/cpu.h
arch/mips/include/asm/mipsregs.h
arch/mips/kernel/cpu-probe.c