]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
firmware: qcom: scm: initialize tzmem before marking SCM as available
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 30 Jun 2025 12:12:04 +0000 (14:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 14:55:51 +0000 (16:55 +0200)
commitbcd14791ba62d2eaf85b27dc90ca71a96753639b
treeb1a8c38ad6d08f8da088d477fbec3d76d6115989
parent6e7c7570cec6a6ba5acd7491920d3036120047e9
firmware: qcom: scm: initialize tzmem before marking SCM as available

commit 87be3e7a2d0030cda6314d2ec96b37991f636ccd upstream.

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.

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/all/20250120151000.13870-1-johan+linaro@kernel.org/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-3-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/qcom/qcom_scm.c