perf/arm-cmn: Fix port detection for CMN-700
authorRobin Murphy <robin.murphy@arm.com>
Wed, 12 Apr 2023 10:29:40 +0000 (11:29 +0100)
committerWill Deacon <will@kernel.org>
Fri, 14 Apr 2023 12:45:00 +0000 (13:45 +0100)
commit2ad91e44e6b0c7ef1ed151b3bb2242a2144e6085
treec38cb6e20eae52015caadccc3fcbed797d919d86
parenta30b87e6bd7db112deb1e3014b23fb90111bc6c4
perf/arm-cmn: Fix port detection for CMN-700

When the "extra device ports" configuration was first added, the
additional mxp_device_port_connect_info registers were added around the
existing mxp_mesh_port_connect_info registers. What I missed about
CMN-700 is that it shuffled them around to remove this discontinuity.
As such, tweak the definitions and factor out a helper for reading these
registers so we can deal with this discrepancy easily, which does at
least allow nicely tidying up the callsites. With this we can then also
do the nice thing and skip accesses completely rather than relying on
RES0 behaviour where we know the extra registers aren't defined.

Fixes: 23760a014417 ("perf/arm-cmn: Add CMN-700 support")
Reported-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/71d129241d4d7923cde72a0e5b4c8d2f6084525f.1681295193.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c