Re: [PATCH] soc: qcom: cmd-db: map shared memory as WT, not WB

From: Maulik Shah (mkshah)
Date: Fri Mar 29 2024 - 00:54:08 EST




On 3/29/2024 3:49 AM, Volodymyr Babchuk wrote:

Hi Maulik

"Maulik Shah (mkshah)" <quic_mkshah@xxxxxxxxxxx> writes:

On 3/28/2024 1:39 AM, Volodymyr Babchuk wrote:
It appears that hardware does not like cacheable accesses to this
region. Trying to access this shared memory region as Normal Memory
leads to secure interrupt which causes an endless loop somewhere in
Trust Zone.

Linux does not write into cmd-db region. This region is write
protected by XPU. Making this region uncached magically solves the XPU
write fault
issue.

Can you please include above details?

Sure, I'll add this to the next version.


Thanks.


In downstream, we have below which resolved similar issue on qcm6490.

cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WC);

Downstream SA8155P also have MEMREMAP_WC. Can you please give it a try
on your device?

Yes, MEMREMAP_WC works as well. This opens the question: which type is
more correct? I have no deep understanding in QCOM internals so it is
hard to me to answer this question.


XPU may have falsely detected clean cache eviction as "write" into the write protected region so using uncached flag MEMREMAP_WC may be helping here and is more correct in my understanding.

This can also be included in commit message.

Thanks,
Maulik