On Mon, Jul 06, 2026 at 09:13:22PM +0300, Dmitry Baryshkov wrote:
> On Fri, May 01, 2026 at 12:42:53AM +0530, Mukesh Ojha wrote:
> > The PAS image initialization path always retains the metadata buffer
> > when a valid qcom_scm_pas_context is provided, even if the caller does
> > not require it. This implicit behavior leads to unclear buffer ownership
> > and forces new users of qcom_mdt_pas_load() to manually release
> > metadata, which is error‑ prone and incorrect.
> > 
> > Add a keep_mdt_buf flag to struct qcom_scm_pas_context to make metadata
> > retention explicit.  Metadata buffers are now freed by default and are
> > only preserved when this flag is set. qcom_q6v5_pas enables this during
> > probe for contexts that require retained metadata for subsequent PAS
> > operations, while existing callers continue to work unchanged.
> 
> Would it make sense to make new API backwards-compatible, so that we
> dont' need to touch other drivers at the same time? It probably means
> adding ->free_mdt_buf flag rather than keep_mdt_buf.

Only remoteproc peripherals need to set the flag and do the
release call later, while the rest of the clients like Iris, IPA,
etc. do not need to set the flag, which is aligned with backward
compatibility for non-rproc clients where their metadata memory
gets freed in the same call where it was allocated.

free_mdt_buf does not look suitable, at least name-wise, for the
reason that now I need to add this change to set this flag for
all non-rproc clients, while with keep_mdt_buf, just rproc
drivers need to set this flag which will make this backword
compatible .

-- 
-Mukesh Ojha

Reply via email to