]> git.ipfire.org Git - thirdparty/linux.git/commit
firmware: qcom: scm: request the waitqueue irq *after* initializing SCM
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 30 Jun 2025 12:12:05 +0000 (14:12 +0200)
committerBjorn Andersson <andersson@kernel.org>
Thu, 17 Jul 2025 03:50:55 +0000 (22:50 -0500)
commit7ab36b51c6bee56e1a1939063dd10d602fe49d13
treedba72bc2938079db80b74cb96872deafe47b018b
parent87be3e7a2d0030cda6314d2ec96b37991f636ccd
firmware: qcom: scm: request the waitqueue irq *after* initializing SCM

There's a subtle race in the SCM driver: we assign the __scm pointer
before requesting the waitqueue interrupt. Assigning __scm marks the SCM
API as ready to accept calls. It's possible that a user makes a call
right after we set __scm and the firmware raises an interrupt before the
driver's ready to service it. Move the __scm assignment after we request
the interrupt.

This has the added benefit of allowing us to drop the goto label.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-4-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/firmware/qcom/qcom_scm.c