[PATCH 11/11] lib: utils/mpxy: Use domain notifier for deferred creation of MPXY RPMI

Anup Patel anup at brainfault.org
Sun Oct 25 01:59:28 PDT 2026


On Thu, Oct 8, 2026 at 9:43 PM Rahul Pathak
<rahul.pathak at oss.qualcomm.com> wrote:
>
> > +
> > +static int __mpxy_rpmi_defer_notif(struct sbi_domain *dom,
> > +                                  enum sbi_domain_notify_event event,
> > +                                  void *priv)
> > +{
> > +       struct __mpxy_rpmi_defer_init_priv *ipriv = priv;
> > +       int rc;
> > +
> > +       /* Do nothing if domain name does not match */
> > +       if (sbi_strcmp(dom->name, ipriv->dom_name))
> > +               return 0;
> > +
> > +       /* Unregister notifier */
> > +       rc = sbi_domain_unregister_notifier(__mpxy_rpmi_defer_notif,
> > +                                           SBI_DOMAIN_NOTIFY_EVENT_REGISTER, ipriv);
> > +       if (rc)
> > +               return rc;
> > +
> > +       /* Create MPXY RPMI instance */
> > +       rc = __mpxy_rpmi_init(ipriv->data, ipriv->chan, ipriv->mpxy_channel_id, dom);
> > +       if (rc)
> > +               return rc;
> > +
> > +       sbi_free(ipriv);
>
> Freeing the ipriv is only required for success path, what about error cases?

The system boot will fail if the notifier fails but in any case we should
free ipriv so I will update at the time of merging this series.

Thanks for pointing.

Regards,
Anup



More information about the opensbi mailing list