2023-10-03 10:33:38

by Sudeep Holla

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

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


2023-10-03 10:51:12

by Cristian Marussi

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

On Tue, Oct 03, 2023 at 11:33:17AM +0100, 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.
>

Not sure if it could be acceptable or controversial, BUT if there is the
need somehow to support polling for yielding calls (depending on the location
of the SCMI server), should not we think about doing this by just looking up
dynamically the fast-call bits in the provided FID ?

Why we need another binding, given that the FID is currently already
statically provided by the DT itself (via smc-id) or dynamically by the
hypervisor at setup by the changes in this series and the SMCCC spec
clearly defines how the IDs are supposed to be formed for
fast-atomic-calls ?

This way we could enforce the compliance with the SMCCC spec tooo...
...for sure it would require a bit of work in the core, though, given the
const nature of some of this structures.

Thanks,
Cristian

2023-10-03 15:53:51

by Nikunj Kela

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


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.

2023-10-04 16:12:06

by Sudeep Holla

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

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

2023-10-05 15:52:43

by Nikunj Kela

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


On 10/4/2023 9:11 AM, Sudeep Holla wrote:
> 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

Ok. I will discard this patch for now from this series and will explore
alternative ways instead of polling that might work in our usecase. If
required, will provide you with more details in a separate patch. Thanks!