Re: [PATCH 3/4] firmware: qcom: scm: initialize tzmem before marking SCM as available
From: Konrad Dybcio
Date: Wed Jun 25 2025 - 10:47:57 EST
On 6/25/25 10:14 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> Now that qcom_scm_shm_bridge_enable() uses the struct device passed to
> it as argument to make the QCOM_SCM_MP_SHM_BRIDGE_ENABLE SCM call, we
> can move the TZMem initialization before the assignment of the __scm
> pointer in the SCM driver (which marks SCM as ready to users) thus
> fixing the potential race between consumer calls and the memory pool
> initialization.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> ---
I'm not sure any user of tzmem ever checks qcom_scm_is_available()
(or is it orthogonal to this problem?)
Konrad