linux/drivers/firmware/qcom
Bartosz Golaszewski 7ab36b51c6 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>
2025-07-16 22:50:55 -05:00
..
Kconfig firmware: qcom: scm: Refactor code to support multiple dload mode 2024-08-14 22:14:42 -05:00
Makefile firmware: qcom: add a dedicated TrustZone buffer allocator 2024-06-23 16:08:04 -05:00
qcom_qseecom_uefisecapp.c firmware: qcom: uefisecapp: fix efivars registration race 2025-02-08 11:38:03 -06:00
qcom_qseecom.c
qcom_scm-legacy.c
qcom_scm-smc.c firmware: qcom: scm: smc: Narrow 'mempool' variable scope 2025-01-06 18:36:59 -06:00
qcom_scm.c firmware: qcom: scm: request the waitqueue irq *after* initializing SCM 2025-07-16 22:50:55 -05:00
qcom_scm.h firmware: qcom: scm: take struct device as argument in SHM bridge enable 2025-07-16 22:50:55 -05:00
qcom_tzmem.c firmware: qcom: scm: take struct device as argument in SHM bridge enable 2025-07-16 22:50:55 -05:00
qcom_tzmem.h firmware: qcom: add a dedicated TrustZone buffer allocator 2024-06-23 16:08:04 -05:00