coresight: trbe: Work around the ignored system register writes
authorAnshuman Khandual <anshuman.khandual@arm.com>
Tue, 25 Jan 2022 14:20:35 +0000 (19:50 +0530)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Fri, 11 Mar 2022 10:06:35 +0000 (10:06 +0000)
commitac0ba2100298a3e85d9a92924a959b80612144e6
tree6a0064826f6280d252761640dbc1f51a6b7b55fc
parentdfd42facf1e4ada021b939b4e19c935dcdd55566
coresight: trbe: Work around the ignored system register writes

TRBE implementations affected by Arm erratum #2064142 might fail to write
into certain system registers after the TRBE has been disabled. Under some
conditions after TRBE has been disabled, writes into certain TRBE registers
TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1 and TRBTRG_EL1 will be
ignored and not be effected.

Work around this problem in the TRBE driver by executing TSB CSYNC and DSB
just after the trace collection has stopped and before performing a system
register write to one of the affected registers. This just updates the TRBE
driver as required.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Suzuki Poulose <suzuki.poulose@arm.com>
Cc: coresight@lists.linaro.org
Cc: linux-doc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/1643120437-14352-6-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
arch/arm64/Kconfig
drivers/hwtracing/coresight/coresight-trbe.c
drivers/hwtracing/coresight/coresight-trbe.h