On 3/25/26 8:12 PM, Mukesh Ojha wrote:
> DTB PAS context creation should be done only for subsystems that support
> a DTB firmware binary; otherwise, memory is wasted. Move the context
> creation to the appropriate location and, while at it, fix the place
> where the DTB PAS context was being released unconditionally.
>
> Fixes: b13d8baf5601 ("remoteproc: pas: Replace metadata context with PAS
> context structure")
> Signed-off-by: Mukesh Ojha <[email protected]>
> ---
> Changes in v2:
> https://lore.kernel.org/lkml/sxklpgc2rtr75maiu7lg4iukmaetvjyho7ytyyykmtdu2tov3k@gctoozxj7frl/
> - No change.
>
> drivers/remoteproc/qcom_q6v5_pas.c | 36 +++++++++++++++---------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c
> b/drivers/remoteproc/qcom_q6v5_pas.c
> index 46204da046fa..3bde37ac510c 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -250,7 +250,9 @@ static int qcom_pas_load(struct rproc *rproc, const
> struct firmware *fw)
> return 0;
>
> release_dtb_metadata:
> - qcom_scm_pas_metadata_release(pas->dtb_pas_ctx);
> + if (pas->dtb_pas_id)
> + qcom_scm_pas_metadata_release(pas->dtb_pas_ctx);
I suppose just checking for if (pas->dtb_pas_ctx) would be more obvious but
this is effectively equal and other places check for pas_id too
Reviewed-by: Konrad Dybcio <[email protected]>
Konrad