1
0
Fork 0
alistair23-linux/drivers
Sai Prakash Ranjan 347adb0d63 coresight: tmc: Fix TMC mode read in tmc_read_prepare_etb()
On some QCOM platforms like SC7180, SDM845 and SM8150,
reading TMC mode register without proper coresight power
management can lead to async exceptions like the one in
the call trace below in tmc_read_prepare_etb(). This can
happen if the user tries to read the TMC etf data via
device node without setting up source and the sink first.
Fix this by having a check for coresight sysfs mode
before reading TMC mode management register.

 Kernel panic - not syncing: Asynchronous SError Interrupt
 CPU: 7 PID: 2605 Comm: hexdump Tainted: G S                5.4.30 #122
 Call trace:
  dump_backtrace+0x0/0x188
  show_stack+0x20/0x2c
  dump_stack+0xdc/0x144
  panic+0x168/0x36c
  panic+0x0/0x36c
  arm64_serror_panic+0x78/0x84
  do_serror+0x130/0x138
  el1_error+0x84/0xf8
  tmc_read_prepare_etb+0x88/0xb8
  tmc_open+0x40/0xd8
  misc_open+0x120/0x158
  chrdev_open+0xb8/0x1a4
  do_dentry_open+0x268/0x3a0
  vfs_open+0x34/0x40
  path_openat+0x39c/0xdf4
  do_filp_open+0x90/0x10c
  do_sys_open+0x150/0x3e8
  __arm64_compat_sys_openat+0x28/0x34
  el0_svc_common+0xa8/0x160
  el0_svc_compat_handler+0x2c/0x38
  el0_svc_compat+0x8/0x10

Fixes: 4525412a50 ("coresight: tmc: making prepare/unprepare functions generic")
Reported-by: Stephen Boyd <swboyd@chromium.org>
Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200518180242.7916-14-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-19 16:31:17 +02:00
..
accessibility
acpi PM: ACPI: Output correct message on target power state 2020-04-27 10:33:40 +02:00
amba amba: Initialize dma_parms for amba devices 2020-04-28 17:44:34 +02:00
android binderfs: remove redundant assignment to pointer ctx 2020-04-23 16:48:11 +02:00
ata ata: sata_inic162x fix a spelling issue 2020-04-23 09:59:30 -06:00
atm
auxdisplay
base driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires 2020-04-28 17:57:13 +02:00
bcma
block virtio-blk: handle block_device_operations callbacks after hot unplug 2020-05-02 10:28:13 -04:00
bluetooth
bus Merge 5.7-rc5 into char-misc-next 2020-05-11 09:17:15 +02:00
cdrom
char Merge 5.7-rc3 into char-misc-next 2020-04-27 09:34:02 +02:00
clk firmware: xilinx: Use APIs instead of IOCTLs 2020-04-28 15:45:08 +02:00
clocksource clocksource/drivers/timer-vf-pit: Add missing parenthesis 2020-04-05 09:24:58 +02:00
connector
counter counter: 104-quad-8: Add lock guards - generic interface 2020-04-19 17:50:00 +01:00
cpufreq cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once 2020-04-27 10:30:11 +02:00
cpuidle Merge branch 'pm-cpuidle' 2020-04-10 11:32:22 +02:00
crypto Merge 5.7-rc5 into char-misc-next 2020-05-11 09:17:15 +02:00
dax dax: Move mandatory ->zero_page_range() check in alloc_dax() 2020-04-02 19:15:03 -07:00
dca dca: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:25:20 +02:00
devfreq
dio
dma dmaengine: dmatest: Fix process hang when reading 'wait' parameter 2020-04-28 21:46:35 +05:30
dma-buf dma-buf: fix documentation build warnings 2020-04-30 19:47:39 +05:30
edac Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:40:08 -07:00
eisa
extcon Char/Misc driver patches for 5.7-rc1 2020-04-03 13:22:40 -07:00
firewire
firmware firmware: xilinx: Fix an error handling path in 'zynqmp_firmware_probe()' 2020-05-15 16:20:02 +02:00
fpga FPGA Manager changes for 5.8 2020-05-15 16:09:24 +02:00
fsi
gnss
gpio This is the bulk of GPIO development for the v5.7 kernel cycle. 2020-04-04 10:27:00 -07:00
gpu A few minor fixes for an ordering issue in virtio, an (old) gcc warning 2020-05-08 15:04:25 +10:00
greybus greybus: Replace zero-length array with flexible-array 2020-05-13 13:59:13 +02:00
hid HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock 2020-05-04 11:24:58 +02:00
hsi
hv hyperv-fixes for 5.7-rc4 2020-04-27 13:28:27 -07:00
hwmon hwmon: (jc42) Fix name to have no illegal characters 2020-04-18 10:13:07 -07:00
hwspinlock
hwtracing coresight: tmc: Fix TMC mode read in tmc_read_prepare_etb() 2020-05-19 16:31:17 +02:00
i2c i2c: aspeed: Avoid i2c interrupt status clear race condition. 2020-04-30 16:12:33 +02:00
i3c
ide drivers/ide: Fix build regression. 2020-04-04 18:07:59 -07:00
idle Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:40:08 -07:00
iio First set of IIO fixes for the 5.7 cycle. 2020-04-20 14:07:00 +02:00
infiniband RDMA/core: Fix race between destroy and release FD object 2020-04-24 15:40:41 -03:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-04-07 20:20:12 -07:00
interconnect interconnect: qcom: Move the static keyword to the front of declaration 2020-04-29 13:11:44 +02:00
iommu iommu/virtio: Reverse arguments to list_add 2020-05-08 17:31:18 +02:00
ipack
irqchip Merge branch 'irq/gic-v4.1-fixes-5.7' into irq/irqchip-5.7 2020-04-17 08:59:55 +01:00
isdn mISDN: make dmril and dmrim static 2020-04-16 13:52:31 -07:00
leds leds: core: Fix warning message when init_data 2020-04-06 23:12:08 +02:00
lightnvm for-5.7/drivers-2020-03-29 2020-03-30 11:43:51 -07:00
macintosh Char/Misc driver patches for 5.7-rc1 2020-04-03 13:22:40 -07:00
mailbox
mcb
md - Document DM integrity allow_discard feature that was added during 2020-04-30 16:45:08 -07:00
media Power management updates for 5.7-rc1 2020-03-30 15:05:01 -07:00
memory ARM: driver updates 2020-04-03 15:05:35 -07:00
memstick
message
mfd mfd: intel-lpss: Fix Intel Elkhart Lake LPSS I2C input clock 2020-03-30 07:35:28 +01:00
misc habanalabs: update patched_cb_size for Wreg32 2020-05-19 14:48:41 +03:00
mmc Merge 5.7-rc5 into char-misc-next 2020-05-11 09:17:15 +02:00
most most: core: use function subsys_initcall() 2020-04-28 15:04:09 +02:00
mtd mtd: spi-nor: Compile files in controllers/ directory 2020-04-09 22:00:13 +02:00
mux
net net: flow_offload: skip hw stats check for FLOW_ACTION_HW_STATS_DONT_CARE 2020-05-06 20:13:10 -07:00
nfc
ntb pci-v5.7-changes 2020-04-03 14:25:02 -07:00
nubus
nvdimm libnvdimm for 5.7 2020-04-08 21:03:40 -07:00
nvme nvme: fix possible hang when ns scanning fails during error recovery 2020-05-09 16:07:58 -06:00
nvmem nvmem: jz4780-efuse: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:20:02 +02:00
of of: unittest: kmemleak in duplicate property update 2020-04-17 08:31:34 -05:00
opp opp: Manage empty OPP tables with clk handle 2020-04-13 16:14:55 +05:30
oprofile
parisc parisc: Replace setup_irq() by request_irq() 2020-04-05 22:05:23 +02:00
parport parport: remove use of devmodel 2020-04-23 17:05:40 +02:00
pci PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2020-04-14 19:16:51 -05:00
pcmcia pcmcia: remove some unused space characters 2020-03-31 18:48:22 +02:00
perf arm64 updates for 5.7: 2020-03-31 10:05:01 -07:00
phy phy: qualcomm: usb-hs-28nm: Prepare clocks in init 2020-04-30 12:10:49 +05:30
pinctrl This is the bulk of GPIO development for the v5.7 kernel cycle. 2020-04-04 10:27:00 -07:00
platform chrome-platform fixes for v5.7-rc5 2020-05-06 16:40:14 -07:00
pnp
power change email address for Pali Rohár 2020-04-10 15:36:22 -07:00
powercap Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:40:08 -07:00
pps
ps3 powerpc/ps3: Remove an unneeded NULL check 2020-04-03 00:09:59 +11:00
ptp ptp: Remove unneeded conversion to bool 2020-04-21 15:45:32 -07:00
pwm pwm: pca9685: Fix PWM/GPIO inter-operation 2020-04-03 21:41:42 +02:00
rapidio
ras
regulator regulator: Revert "Use driver_deferred_probe_timeout for regulator_init_complete_work" 2020-04-29 19:57:45 +02:00
remoteproc remoteproc fixes for v5.7 2020-04-23 09:28:15 -07:00
reset firmware: xilinx: Remove eemi ops for reset_get_status 2020-04-28 15:45:08 +02:00
rpmsg rpmsg: pull in slab.h 2020-04-17 06:05:29 -04:00
rtc - New Drivers 2020-04-07 19:48:52 -07:00
s390 s390/qeth: fix cancelling of TX timer on dev_close() 2020-05-04 11:21:40 -07:00
sbus
scsi scsi: ibmvscsi: Fix WARN_ON during event pool release 2020-04-28 22:59:55 -04:00
sfi
sh
siox
slimbus slimbus: core: Fix mismatch in of_node_get/put 2020-05-15 16:21:08 +02:00
soc firmware: xilinx: Remove eemi ops for set_requirement 2020-04-28 15:45:09 +02:00
soundwire Char/Misc driver patches for 5.7-rc1 2020-04-03 13:22:40 -07:00
spi firmware: xilinx: Remove eemi ops for fpga related APIs 2020-04-28 15:45:09 +02:00
spmi
ssb
staging staging: gasket: Check the return value of gasket_get_bar_index() 2020-05-05 12:36:05 +02:00
target scsi: target/iblock: fix WRITE SAME zeroing 2020-04-22 00:02:13 -04:00
tc
tee ARM: driver updates 2020-04-03 15:05:35 -07:00
thermal - Convert tsens configuration DT binding to yaml (Rajeshwari) 2020-04-07 20:00:16 -07:00
thunderbolt thunderbolt: Check return value of tb_sw_read() in usb4_switch_op() 2020-04-28 19:00:59 +02:00
tty TTY/Serial fixes for 5.7-rc5 2020-05-08 08:56:16 -07:00
uio uio_hv_generic: add missed sysfs_remove_bin_file 2020-05-15 16:13:19 +02:00
usb usb: chipidea: msm: Ensure proper controller reset using role switch API 2020-05-07 08:46:35 +02:00
vdpa vhost: disable for OABI 2020-04-20 10:19:22 -04:00
vfio vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn() 2020-04-23 12:10:01 -06:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-05-06 20:53:22 -07:00
video drm fixes for 5.7-rc1 2020-04-07 20:24:34 -07:00
virt
virtio virtio-balloon: Avoid using the word 'report' when referring to free page hinting 2020-04-17 06:05:30 -04:00
visorbus drivers: visorbus: Use the correct style for SPDX License Identifier 2020-04-23 17:02:04 +02:00
vlynq
vme
w1 w1_therm: adding bulk read support to trigger multiple conversion on bus 2020-05-15 16:29:00 +02:00
watchdog watchdog: sp805: fix restart handler 2020-04-08 11:18:38 +02:00
xen xen: branch for v5.7-rc2 2020-04-17 10:35:17 -07:00
zorro SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
Kconfig virtio: fixes, vdpa 2020-04-08 10:51:53 -07:00
Makefile virtio: fixes, vdpa 2020-04-08 10:51:53 -07:00