linux/drivers/hwtracing/coresight
Sai Prakash Ranjan d021f5c5ff coresight: tmc: Fix TMC mode read in tmc_read_unprepare_etb()
Reading TMC mode register without proper coresight power
management can lead to exceptions like the one in the call
trace below in tmc_read_unprepare_etb() when the trace data
is read after the sink is disabled. So fix this by having
a check for coresight sysfs mode before reading TMC mode
management register in tmc_read_unprepare_etb() similar to
tmc_read_prepare_etb().

  SError Interrupt on CPU6, code 0xbe000411 -- SError
  pstate: 80400089 (Nzcv daIf +PAN -UAO)
  pc : tmc_read_unprepare_etb+0x74/0x108
  lr : tmc_read_unprepare_etb+0x54/0x108
  sp : ffffff80d9507c30
  x29: ffffff80d9507c30 x28: ffffff80b3569a0c
  x27: 0000000000000000 x26: 00000000000a0001
  x25: ffffff80cbae9550 x24: 0000000000000010
  x23: ffffffd07296b0f0 x22: ffffffd0109ee028
  x21: 0000000000000000 x20: ffffff80d19e70e0
  x19: ffffff80d19e7080 x18: 0000000000000000
  x17: 0000000000000000 x16: 0000000000000000
  x15: 0000000000000000 x14: 0000000000000000
  x13: 0000000000000000 x12: 0000000000000000
  x11: 0000000000000000 x10: dfffffd000000001
  x9 : 0000000000000000 x8 : 0000000000000002
  x7 : ffffffd071d0fe78 x6 : 0000000000000000
  x5 : 0000000000000080 x4 : 0000000000000001
  x3 : ffffffd071d0fe98 x2 : 0000000000000000
  x1 : 0000000000000004 x0 : 0000000000000001
  Kernel panic - not syncing: Asynchronous SError Interrupt

Fixes: 4525412a50 ("coresight: tmc: making prepare/unprepare functions generic")
Reported-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Tested-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200716175746.3338735-14-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-21 15:48:39 +02:00
..
coresight-catu.c coresight: catu: Use CS_AMBA_ID macro for id table 2020-07-21 15:48:38 +02:00
coresight-catu.h coresight: catu: Cleanup device specific data 2019-06-19 20:29:14 +02:00
coresight-cpu-debug.c coresight: cpu-debug: Add support for Qualcomm Kryo 2019-09-03 22:01:15 +02:00
coresight-cti-platform.c Char/Misc driver patches for 5.8-rc1 2020-06-07 10:59:32 -07:00
coresight-cti-sysfs.c coresight: Include required headers in C files 2020-05-19 16:31:18 +02:00
coresight-cti.c coresight: cti: Fix error handling in probe 2020-07-01 18:44:07 +02:00
coresight-cti.h coresight: Include required headers in C files 2020-05-19 16:31:18 +02:00
coresight-etb10.c coresight: etb10: Make coresight_etb_groups static 2020-05-19 16:31:16 +02:00
coresight-etm3x-sysfs.c coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm3x.c coresight: Initialize arg in sparse friendly way 2020-05-19 16:31:17 +02:00
coresight-etm4x-sysfs.c coresight: etmv4: Update default filter and initialisation 2020-05-19 16:31:17 +02:00
coresight-etm4x.c coresight: etmv4: Counter values not saved on disable 2020-07-21 15:48:39 +02:00
coresight-etm4x.h coresight: etmv4: Fix resource selector constant 2020-07-21 15:48:39 +02:00
coresight-etm-cp14.c coresight: Moving framework and drivers to SPDX identifier 2018-05-14 16:19:59 +02:00
coresight-etm-perf.c coresight: Fix DEBUG_LOCKS_WARN_ON for uninitialized attribute 2019-08-01 20:51:34 +02:00
coresight-etm-perf.h coresight: perf: Add "sinks" group to PMU directory 2019-02-08 12:27:36 +01:00
coresight-etm.h coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-funnel.c coresight: funnel: Fix missing spin_lock_init() 2019-11-19 19:18:15 +01:00
coresight-platform.c coresight: Use devm_kcalloc() in coresight_alloc_conns() 2020-07-21 15:48:39 +02:00
coresight-priv.h coresight: Avoid casting void pointers 2020-05-19 16:31:18 +02:00
coresight-replicator.c coresight: replicator: Reset replicator if context is lost 2020-07-21 15:48:38 +02:00
coresight-stm.c coresight: Drop double check for ACPI companion device 2020-07-21 15:48:39 +02:00
coresight-sysfs.c coresight: Expose device connections via sysfs 2020-05-19 16:31:15 +02:00
coresight-tmc-etf.c coresight: tmc: Fix TMC mode read in tmc_read_unprepare_etb() 2020-07-21 15:48:39 +02:00
coresight-tmc-etr.c coresight: tmc: Add shutdown callback for TMC ETR 2020-07-21 15:48:39 +02:00
coresight-tmc.c coresight: tmc: Add shutdown callback for TMC ETR 2020-07-21 15:48:39 +02:00
coresight-tmc.h coresight: tmc: Add shutdown callback for TMC ETR 2020-07-21 15:48:39 +02:00
coresight-tpiu.c coresight: Use platform agnostic names 2019-06-20 07:56:13 +02:00
coresight.c coresight: Fix support for sparsely populated ports 2020-05-19 16:31:16 +02:00
Kconfig docs: fix broken references to text files 2020-04-20 15:35:59 -06:00
Makefile coresight: Add generic sysfs link creation functions 2020-05-19 16:31:15 +02:00