Suzuki K Poulose
59cd503c8c
coresight: STM: Balance enable/disable
...
commit 4474f4c40a9c607c7317e686b23619b7b768004f upstream.
The stm is automatically enabled when an application sets the policy
via ->link() call back by using coresight_enable(), which keeps the
refcount of the current users of the STM. However, the unlink() callback
issues stm_disable() directly, which leaves the STM turned off, without
the coresight layer knowing about it. This prevents any further uses
of the STM hardware as the coresight layer still thinks the STM is
turned on and doesn't enable the hardware when required. Even manually
enabling the STM via sysfs can't really enable the hw.
e.g,
$ echo 1 > $CS_DEVS/$ETR/enable_sink
$ mkdir -p $CONFIG_FS/stp-policy/$source.0/stm_test/
$ echo 32768 65535 > $CONFIG_FS/stp-policy/$source.0/stm_test/channels
$ echo 64 > $CS_DEVS/$source/traceid
$ ./stm_app
Sending 64000 byte blocks of pattern 0 at 0us intervals
Success to map channel(32768~32783) to 0xffffa95fa000
Sending on channel 32768
$ dd if=/dev/$ETR of=~/trace.bin.1
597+1 records in
597+1 records out
305920 bytes (306 kB) copied, 0.399952 s, 765 kB/s
$ ./stm_app
Sending 64000 byte blocks of pattern 0 at 0us intervals
Success to map channel(32768~32783) to 0xffff7e9e2000
Sending on channel 32768
$ dd if=/dev/$ETR of=~/trace.bin.2
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.0232083 s, 0.0 kB/s
Note that we don't get any data from the ETR for the second session.
Also dmesg shows :
[ 77.520458] coresight-tmc 20800000.etr: TMC-ETR enabled
[ 77.537097] coresight-replicator etr_replicator@20890000: REPLICATOR enabled
[ 77.558828] coresight-replicator main_replicator@208a0000: REPLICATOR enabled
[ 77.581068] coresight-funnel 208c0000.main_funnel: FUNNEL inport 0 enabled
[ 77.602217] coresight-tmc 20840000.etf: TMC-ETF enabled
[ 77.618422] coresight-stm 20860000.stm: STM tracing enabled
[ 139.554252] coresight-stm 20860000.stm: STM tracing disabled
# End of first tracing session
[ 146.351135] coresight-tmc 20800000.etr: TMC read start
[ 146.514486] coresight-tmc 20800000.etr: TMC read end
# Note that the STM is not turned on via stm_generic_link()->coresight_enable()
# and hence none of the components are turned on.
[ 152.479080] coresight-tmc 20800000.etr: TMC read start
[ 152.542632] coresight-tmc 20800000.etr: TMC read end
This patch fixes the problem by balancing the unlink operation by using
the coresight_disable(), keeping the coresight layer in sync with the
hardware state and thus allowing normal usage of the STM component.
Fixes: commit 237483aa5c ("coresight: stm: adding driver for CoreSight STM component")
Cc: Pratik Patel <pratikp@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Reported-by: Robert Walker <robert.walker@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12 06:41:42 +01:00
..
accessibility
acpi
acpi, nfit: fix acpi_nfit_flush_probe() crash
2017-02-14 15:25:32 -08:00
amba
android
ANDROID: binder: Clear binder and cookie when setting handle in flat binder struct
2016-10-24 19:37:48 +02:00
ata
libata: Fix ATA request sense
2017-02-09 08:08:27 +01:00
atm
atm: fix improper return value
2016-12-05 14:53:46 -05:00
auxdisplay
auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays
2016-10-06 17:03:41 +02:00
base
base/memory, hotplug: fix a kernel oops in show_valid_zones()
2017-02-09 08:08:28 +01:00
bcma
Revert "bcma: init serial console directly from ChipCommon code"
2017-02-09 08:08:28 +01:00
block
virtio_blk: avoid DMA to stack for the sense buffer
2017-01-19 20:18:03 +01:00
bluetooth
Bluetooth: btwilink: Fix probe return value
2016-10-20 10:14:49 +02:00
bus
bus: vexpress-config: fix device reference leak
2017-01-19 20:18:07 +01:00
cdrom
char
drivers: char: mem: Fix thinkos in kmem address checks
2017-01-19 20:18:03 +01:00
clk
ARM: 8631/1: clkdev: Detect errors in clk_hw_register_clkdev() for mass registration
2017-01-15 13:42:57 +01:00
clocksource
clocksource/exynos_mct: Clear interrupt when cpu is shut down
2017-01-26 08:24:40 +01:00
connector
cpufreq
cpufreq: intel_pstate: Disable energy efficiency optimization
2017-02-14 15:25:31 -08:00
cpuidle
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
2016-10-15 09:26:12 -07:00
crypto
crypto: ccp - Fix double add when creating new DMA command
2017-02-14 15:25:33 -08:00
dax
device-dax: fix private mapping restriction, permit read-only
2016-12-06 17:42:37 -08:00
dca
devfreq
PM / devfreq: Fix the bug of devfreq_add_device when governor is NULL
2017-01-26 08:24:44 +01:00
dio
dma
dmaengine: cppi41: Fix oops in cppi41_runtime_resume
2017-02-09 08:08:29 +01:00
dma-buf
Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux
2016-10-11 18:12:22 -07:00
edac
* Altera Arria10 enablement of NAND, DMA, USB, QSPI and SD-MMC FIFO
2016-10-04 12:06:26 -07:00
eisa
extcon
extcon: return error code on failure
2017-01-19 20:18:03 +01:00
firewire
firewire: net: fix fragmented datagram_size off-by-one
2016-11-03 14:46:39 +01:00
firmware
efi/fdt: Avoid FDT manipulation after ExitBootServices()
2017-02-09 08:08:25 +01:00
fmc
fpga
gpio
gpio: Move freeing of GPIO hogs before numbing of the device
2017-01-19 20:18:00 +01:00
gpu
drm/dp/mst: fix kernel oops when turning off secondary monitor
2017-02-23 17:44:36 +01:00
hid
HID: wacom: Fix poor prox handling in 'wacom_pl_irq'
2017-02-09 08:08:29 +01:00
hsi
hv
Drivers: hv: vmbus: finally fix hv_need_to_signal_on_read()
2017-02-14 15:25:39 -08:00
hwmon
hwmon: (it87) Ensure that pwm control cache is current before updating values
2017-03-12 06:41:42 +01:00
hwspinlock
hwtracing
coresight: STM: Balance enable/disable
2017-03-12 06:41:42 +01:00
i2c
Revert "i2c: designware: detect when dynamic tar update is possible"
2017-02-23 17:44:36 +01:00
ide
idle
nmi_backtrace: generate one-line reports for idle cpus
2016-10-07 18:46:30 -07:00
iio
iio: health: max30100: fixed parenthesis around FIFO count check
2017-02-09 08:08:30 +01:00
infiniband
IB/rxe: Fix mem_check_range integer overflow
2017-02-14 15:25:42 -08:00
input
Input: elan_i2c - add ELAN0605 to the ACPI table
2017-02-23 17:44:35 +01:00
iommu
iommu/vt-d: Flush old iommu caches for kdump when the device gets context mapped
2017-01-12 11:39:28 +01:00
ipack
ipack: print a hex number after a 0x prefix
2016-10-27 18:43:43 -07:00
irqchip
irqchip/bcm7038-l1: Implement irq_cpu_offline() callback
2017-01-12 11:39:31 +01:00
isdn
ISDN: eicon: silence misleading array-bounds warning
2017-02-01 08:33:06 +01:00
leds
lguest
lightnvm
Merge branch 'for-4.9/block' of git://git.kernel.dk/linux-block
2016-10-07 14:42:05 -07:00
macintosh
mailbox
mailbox: PCC: Fix lockdep warning when request PCC channel
2016-11-14 22:07:38 +01:00
mcb
mcb: Add a dma_device to mcb_device
2016-09-27 12:33:47 +02:00
md
bcache: Make gc wakeup sane, remove set_task_state()
2017-02-23 17:44:36 +01:00
media
media: Properly pass through media entity types in entity enumeration
2017-03-12 06:41:41 +01:00
memory
ARM: SoC driver updates for v4.9
2016-10-07 21:23:40 -07:00
memstick
memstick: rtsx_usb_ms: Manage runtime PM when accessing the device
2016-10-17 15:43:05 +02:00
message
mfd
mfd: tps65217: Fix page fault on unloading modules
2017-01-12 11:39:23 +01:00
misc
mei: move write cb to completion on credentials failures
2017-01-12 11:39:21 +01:00
mmc
mmc: sdhci-acpi: support deferred probe
2017-03-12 06:41:40 +01:00
mtd
mtd: spi-nor: Fix some error codes in cqspi_setup_flash()
2017-01-26 08:24:44 +01:00
net
rtlwifi: rtl_usb: Fix for URB leaking when doing ifconfig up/down
2017-02-26 11:10:52 +01:00
nfc
mei: bus: fix received data size check in NFC fixup
2016-10-31 10:25:22 -06:00
ntb
ntb_transport: Pick an unused queue
2017-02-23 17:44:36 +01:00
nubus
nvdimm
libnvdimm, pfn: fix memmap reservation size versus 4K alignment
2017-02-14 15:25:32 -08:00
nvme
nvme: apply DELAY_BEFORE_CHK_RDY quirk at probe time too
2017-01-19 20:18:05 +01:00
nvmem
ARM: SoC driver updates for v4.9
2016-10-07 21:23:40 -07:00
of
of, numa: Return NUMA_NO_NODE from disable of_node_to_nid() if nid not possible.
2017-01-09 08:32:25 +01:00
oprofile
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
2016-10-10 20:16:43 -07:00
parisc
parport
pci
PCI/PME: Restore pcie_pme_driver.remove
2017-02-23 17:44:36 +01:00
pcmcia
pcmcia: fix return value of soc_pcmcia_regulator_set
2016-11-11 08:45:08 -08:00
perf
perf: xgene: Remove bogus IS_ERR() check
2016-10-17 15:50:07 +01:00
phy
phy: twl4030-usb: Fix for musb session bit based PM
2016-11-17 16:25:40 +01:00
pinctrl
pinctrl: intel: merrifield: Add missed check in mrfld_config_set()
2017-02-09 08:08:29 +01:00
platform
goldfish: Sanitize the broken interrupt handler
2017-02-26 11:10:52 +01:00
pnp
power
power: supply: bq27xxx_battery: Fix register map for BQ27510 and BQ27520
2017-01-19 20:18:07 +01:00
powercap
powercap/intel_rapl: fix and tidy up error handling
2017-01-19 20:18:07 +01:00
pps
pps: kc: fix non-tickless system config dependency
2016-10-11 15:06:32 -07:00
ps3
ptp
drivers/ptp: Fix kernel memory disclosure
2016-10-13 10:20:06 -04:00
pwm
pwm: Fix device reference leak
2016-11-29 16:43:24 +01:00
rapidio
mm: replace get_user_pages() write/force parameters with gup_flags
2016-10-19 08:11:43 -07:00
ras
regulator
regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce
2017-02-09 08:08:28 +01:00
remoteproc
remoteproc: st: Fix error return code in st_rproc_probe()
2017-01-19 20:18:06 +01:00
reset
reset: uniphier: rename MIO reset to SD reset for Pro5, PXs2, LD20 SoCs
2016-10-22 18:31:42 +09:00
rpmsg
rpmsg: virtio_rpmsg_bus: fix channel creation
2017-01-26 08:24:44 +01:00
rtc
rtc: omap: prevent disabling of clock/module during suspend
2016-11-04 23:11:39 +01:00
s390
scsi: zfcp: fix use-after-free by not tracing WKA port open/close on failed send
2017-02-14 15:25:39 -08:00
sbus
scsi
Fix missing sanity check in /dev/sg
2017-02-23 17:44:35 +01:00
sfi
sh
sn
soc
soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe()
2017-01-26 08:24:45 +01:00
spi
spi: s3c64xx: fix inconsistency between binding and driver
2017-03-12 06:41:41 +01:00
spmi
spmi: pmic-arb: Return an error code if sanity check fails
2016-09-27 12:43:34 +02:00
ssb
ssb: Fix error routine when fallback SPROM fails
2017-01-09 08:32:16 +01:00
staging
staging: rtl: fix possible NULL pointer dereference
2017-03-12 06:41:42 +01:00
target
target: Fix COMPARE_AND_WRITE ref leak for non GOOD status
2017-02-14 15:25:37 -08:00
tc
thermal
thermal: hwmon: Properly report critical temperature in sysfs
2017-01-09 08:32:18 +01:00
thunderbolt
tty
tty: serial: msm: Fix module autoload
2017-02-26 11:10:51 +01:00
uio
usb
USB: serial: console: fix uninitialised spinlock
2017-02-26 11:10:52 +01:00
uwb
uwb: fix device reference leaks
2016-11-01 09:04:04 -06:00
vfio
vfio/pci: Fix integer overflows, bitmask check
2016-10-26 13:49:29 -06:00
vhost
vhost: fix initialization for vq->is_le
2017-02-09 08:08:28 +01:00
video
fbdev: color map copying bounds checking
2017-02-01 08:33:02 +01:00
virt
mm: replace get_user_pages() write/force parameters with gup_flags
2016-10-19 08:11:43 -07:00
virtio
Revert "vring: Force use of DMA API for ARM-based systems with legacy devices"
2017-02-09 08:08:28 +01:00
vlynq
vme
vme: Fix wrong pointer utilization in ca91cx42_slave_get
2017-01-19 20:18:02 +01:00
w1
watchdog
watchdog: qcom: fix kernel panic due to external abort on non-linefetch
2017-01-06 10:40:16 +01:00
xen
swiotlb: Convert swiotlb_force from int to enum
2017-01-26 08:24:44 +01:00
zorro
Kconfig
Makefile
A small bug fix and a new driver for acting as an IPMI device.
2016-10-23 15:56:23 -07:00