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

From: Sai Prakash Ranjan
Date: Tue Jun 09 2020 - 11:37:49 EST


Hi Mathieu,

On 2020-06-09 20:57, Mathieu Poirier wrote:
On Mon, 8 Jun 2020 at 08:07, Sai Prakash Ranjan
<saiprakash.ranjan@xxxxxxxxxxxxxx> wrote:

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?

User space isn't a concern, especially after you've confirmed the
problem occured during an ongoing sysfs session.


Will post v3 with comments addressed after 5.8-rc1 is out.

Thanks,
Sai

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