Re: [PATCH 2/2] coresight: tmc: Add shutdown callback for TMC ETR/ETF

From: Sai Prakash Ranjan
Date: Mon Jun 08 2020 - 10:07:53 EST


Hi Mathieu, Mike

On 2020-06-04 12:57, Sai Prakash Ranjan wrote:


[...]


Robin has a point - user space is long gone at this time. As such the first
question to ask is what kind of CS session was running at the time the system
was shutting down. Was it a perf session of a sysfs session?

I'm guessing it was a sysfs session because user space has been blown away a
while back and part of that process should have killed all perf sessions.

I was enabling trace via sysfs.


If I am correct then simply switching off the ETR HW in the shutdown() amba bus
callback should be fine - otherwise Mike's approach is mandatory. There is
also the exchange between Robin and Sai about removing the SMMU shutdown
callback, but that thread is still incomplete.


If Robin is hinting at removing SMMU shutdown callback, then I think adding
all these shutdown callbacks to all clients of SMMU can be avoided. Git blaming
the thing shows it was added to avoid some kexec memory corruption.


I think I misread the cryptic hint from Robin and it is not right to remove
SMMU shutdown callback. For more details on why that was a bad idea and would
break kexec, please refer to [1].

As for the coresight, can I disable the ETR only in the tmc shutdown callback
or are we still concerned about the userspace coming into picture?

[1] https://lore.kernel.org/patchwork/patch/1253131/

Thanks,
Sai

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation