On Wed, Nov 18, 2026 at 06:38:25PM +0530, Puranam V G Tejaswi wrote: > The Adreno driver asks the secure world to initialize some GPU registers > through qcom_scm_gpu_init_regs(), and fails to power up the GPU if this > call fails. > > Not every secure world implements this call. When it is missing, the > call fails in the same way as a real error, so the driver cannot tell > the two cases apart. > > Add qcom_scm_gpu_init_regs_is_available(), similar to > qcom_scm_set_gpu_smmu_aperture_is_available(), so that the driver can > check whether the secure world supports the call before making it. > > Signed-off-by: Puranam V G Tejaswi <[email protected]>
Acked-by: Bjorn Andersson <[email protected]> Regards, Bjorn > --- > drivers/firmware/qcom/qcom_scm.c | 7 +++++++ > include/linux/firmware/qcom/qcom_scm.h | 1 + > 2 files changed, 8 insertions(+) > > diff --git a/drivers/firmware/qcom/qcom_scm.c > b/drivers/firmware/qcom/qcom_scm.c > index 030e4ba90812..f4f34b7dd0b2 100644 > --- a/drivers/firmware/qcom/qcom_scm.c > +++ b/drivers/firmware/qcom/qcom_scm.c > @@ -1941,6 +1941,13 @@ int qcom_scm_lmh_dcvsh(u32 payload_fn, u32 > payload_reg, u32 payload_val, > } > EXPORT_SYMBOL_GPL(qcom_scm_lmh_dcvsh); > > +bool qcom_scm_gpu_init_regs_is_available(void) > +{ > + return __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_GPU, > + QCOM_SCM_SVC_GPU_INIT_REGS); > +} > +EXPORT_SYMBOL_GPL(qcom_scm_gpu_init_regs_is_available); > + > int qcom_scm_gpu_init_regs(u32 gpu_req) > { > struct qcom_scm_desc desc = { > diff --git a/include/linux/firmware/qcom/qcom_scm.h > b/include/linux/firmware/qcom/qcom_scm.h > index a0a6bc0229c4..c9e88b2904e3 100644 > --- a/include/linux/firmware/qcom/qcom_scm.h > +++ b/include/linux/firmware/qcom/qcom_scm.h > @@ -131,6 +131,7 @@ bool qcom_scm_lmh_dcvsh_available(void); > */ > #define QCOM_SCM_GPU_TSENSE_EN_REQ BIT(3) > > +bool qcom_scm_gpu_init_regs_is_available(void); > int qcom_scm_gpu_init_regs(u32 gpu_req); > > int qcom_scm_shm_bridge_create(u64 pfn_and_ns_perm_flags, > > -- > 2.34.1 >
