On 11/4/25 8:35 AM, Mukesh Ojha wrote: > On SoCs running with a non-Gunyah-based hypervisor, Linux must take > responsibility for creating the SHM bridge both for metadata (before > calling qcom_scm_pas_init_image()) and for remoteproc memory (before > calling qcom_scm_pas_auth_and_reset()). We have taken care the things > required for qcom_scm_pas_auth_and_reset(). > > Lets put these awareness of above conditions into > qcom_scm_pas_init_image() and qcom_scm_pas_metadata_release(). > > Signed-off-by: Mukesh Ojha <[email protected]> > --- > drivers/firmware/qcom/qcom_scm.c | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > > diff --git a/drivers/firmware/qcom/qcom_scm.c > b/drivers/firmware/qcom/qcom_scm.c > index aabdef295492..9d3e45ec73ac 100644 > --- a/drivers/firmware/qcom/qcom_scm.c > +++ b/drivers/firmware/qcom/qcom_scm.c > @@ -625,6 +625,33 @@ static int __qcom_scm_pas_init_image(u32 pas_id, > dma_addr_t mdata_phys, void *me > return ret; > } > > +static int qcom_scm_pas_prep_and_init_image(struct qcom_scm_pas_context *ctx, > + const void *metadata, size_t size) > +{ > + struct qcom_scm_pas_metadata *mdt_ctx; > + struct qcom_scm_res res; > + phys_addr_t mdata_phys; > + void *mdata_buf; > + int ret; > + > + mdata_buf = qcom_tzmem_alloc(__scm->mempool, size, GFP_KERNEL); > + if (!mdata_buf) > + return -ENOMEM;
I'm still a little sour about this function having to be separate just because we use a different allocator.. Did we conclude that using set_dma_ops(some_tzmem_ops) was not going to work? Konrad

