Re: [PATCH v4 1/4] firmware: arm_scmi: Add polling support for completion in smc

From: Sudeep Holla
Date: Wed Oct 04 2023 - 12:12:04 EST


On Tue, Oct 03, 2023 at 08:53:20AM -0700, Nikunj Kela wrote:
>
> On 10/3/2023 3:33 AM, Sudeep Holla wrote:
> > On Mon, Sep 11, 2023 at 12:43:56PM -0700, Nikunj Kela wrote:
> > > Currently, the return from the smc call assumes the completion of
> > > the scmi request. However this may not be true in virtual platforms
> > > that are using hvc doorbell.
> > >
> > Hmm, it is expectation from SMCCC for the fast calls. Is you HVC FID
> > not a fast call. AFAIK, only TOS use yielding calls. Are you using them
> > here ? If not, this must complete when the SMC/HVC returns. We added
> > support for platforms indicating the same via interrupt.
> >
> > I would like to avoid adding this build config. Why does it require polling ?
> > Broken firmware ? I would add a compatible for that. Or if the qcom always
> > wants to do this way, just make it specific to the qcom compatible.
> >
> > I would avoid a config flag as it needs to be always enabled for single
> > image and affects other platforms as well. So please drop this change.
> > If this is absolutely needed, just add additional property which DT
> > maintainers may not like as it is more like a policy or just make it
> > compatible specific.
> >
> > --
> > Regards,
> > Sudeep
> We are using Fast call FID. We are using completion IRQ for all the scmi
> instances except one where we need to communicate with the server when GIC
> is in suspended state in HLOS. We will need to poll the channel for
> completion in that use case. I am open to suggestions.

IIUC, for the sake of that one corner case, you have added the polling
Kconfig and will be enabled for all the case and even on other platforms
in a single Image. I think we could be something better, no ?

Please share details on that one corner case.
Is it in the scmi drivers already ? If so, specifics please.
If no, again provide details on how you plan to use. We do have ways
to make a polling call, but haven't mixed it with interrupt based calls
for a reason, but we can revisit if it makes sense.

--
Regards,
Sudeep