From: Nikunj Kela <quic_nkela@quicinc.com>
To: Brian Masney <bmasney@redhat.com>
Cc: <sudeep.holla@arm.com>, <cristian.marussi@arm.com>,
<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
<conor+dt@kernel.org>, <andersson@kernel.org>,
<konrad.dybcio@linaro.org>,
<linux-arm-kernel@lists.infradead.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v4 1/4] firmware: arm_scmi: Add polling support for completion in smc
Date: Mon, 2 Oct 2023 11:36:01 -0700 [thread overview]
Message-ID: <8d5af4d7-23fc-a03e-bad8-760209b537a0@quicinc.com> (raw)
In-Reply-To: <ZRsJWdZVMc+F5ZgF@brian-x1>
On 10/2/2023 11:18 AM, Brian Masney 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.
>>
>> This change adds a Kconfig to enable the polling for the request
>> completion.
>>
>> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
>> ---
>> drivers/firmware/arm_scmi/Kconfig | 14 ++++++++++++++
>> drivers/firmware/arm_scmi/smc.c | 15 ++++++++++++++-
>> 2 files changed, 28 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig
>> index ea0f5083ac47..771d60f8319f 100644
>> --- a/drivers/firmware/arm_scmi/Kconfig
>> +++ b/drivers/firmware/arm_scmi/Kconfig
>> @@ -125,6 +125,20 @@ config ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE
>> in atomic context too, at the price of using a number of busy-waiting
>> primitives all over instead. If unsure say N.
>>
>> +config ARM_SCMI_TRANSPORT_SMC_POLL_COMPLETION
>> + bool "Enable polling support for SCMI SMC transport"
>> + depends on ARM_SCMI_TRANSPORT_SMC
>> + help
>> + Enable completion polling support for SCMI SMC based transport.
>> +
>> + If you want the SCMI SMC based transport to poll for the completion,
>> + answer Y.
>> + Enabling completion polling might be desired in the absence of the a2p
>> + irq when the return from smc/hvc call doesn't indicate the completion
>> + of the SCMI requests. This might be useful for instances used in
>> + virtual platforms.
>> + If unsure say N.
>> +
>> config ARM_SCMI_TRANSPORT_VIRTIO
>> bool "SCMI transport based on VirtIO"
>> depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
>> diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c
>> index c193516a254d..0a0b7e401159 100644
>> --- a/drivers/firmware/arm_scmi/smc.c
>> +++ b/drivers/firmware/arm_scmi/smc.c
>> @@ -250,6 +250,16 @@ static void smc_mark_txdone(struct scmi_chan_info *cinfo, int ret,
>> smc_channel_lock_release(scmi_info);
>> }
>>
>> +#ifdef CONFIG_ARM_SCMI_TRANSPORT_SMC_POLL_COMPLETION
>> +static bool
>> +smc_poll_done(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer)
>> +{
>> + struct scmi_smc *scmi_info = cinfo->transport_info;
>> +
>> + return shmem_poll_done(scmi_info->shmem, xfer);
>> +}
>> +#endif
>> +
>> static const struct scmi_transport_ops scmi_smc_ops = {
>> .chan_available = smc_chan_available,
>> .chan_setup = smc_chan_setup,
>> @@ -257,6 +267,9 @@ static const struct scmi_transport_ops scmi_smc_ops = {
>> .send_message = smc_send_message,
>> .mark_txdone = smc_mark_txdone,
>> .fetch_response = smc_fetch_response,
>> +#ifdef CONFIG_ARM_SCMI_TRANSPORT_SMC_POLL_COMPLETION
>> + .poll_done = smc_poll_done,
>> +#endif
>> };
>>
>> const struct scmi_desc scmi_smc_desc = {
>> @@ -272,6 +285,6 @@ const struct scmi_desc scmi_smc_desc = {
>> * for the issued command will be immmediately ready to be fetched
>> * from the shared memory area.
>> */
>> - .sync_cmds_completed_on_ret = true,
>> + .sync_cmds_completed_on_ret = !IS_ENABLED(CONFIG_ARM_SCMI_TRANSPORT_SMC_POLL_COMPLETION),
>> .atomic_enabled = IS_ENABLED(CONFIG_ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE),
> From a Linux distributor viewpoint, it would be nice if this was
> determined at runtime, rather than at compile time. We generate a single
> kernel binary that's used on systems from multiple hardware
> manufacturers. We'd run into an issue if one company required this, but
> another one didn't. We may potentially run into this same type of issue
> with the upstream arm64 defconfig.
>
> Brian
This is a transport dependent property. Either the transport supports
"completion on return of the smc call" or not. For a given platform,
this will be fixed for all channels. This is similar to
CONFIG_ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE which is also a Kconfig.
next prev parent reply other threads:[~2023-10-02 18:36 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 16:08 [PATCH 0/2] Add qcom hvc/shmem transport Nikunj Kela
2023-07-18 16:08 ` [PATCH 1/2] dt-bindings: arm: Add qcom specific hvc transport for SCMI Nikunj Kela
2023-07-18 17:21 ` Rob Herring
2023-07-18 18:12 ` Krzysztof Kozlowski
2023-07-18 18:18 ` Nikunj Kela
2023-07-19 10:39 ` Sudeep Holla
2023-07-19 13:58 ` Nikunj Kela
2023-07-18 16:08 ` [PATCH 2/2] firmware: arm_scmi: Add qcom hvc/shmem transport Nikunj Kela
2023-07-18 18:17 ` Krzysztof Kozlowski
2023-07-18 18:25 ` Nikunj Kela
2023-07-18 18:42 ` Krzysztof Kozlowski
2023-07-18 21:16 ` Nikunj Kela
2023-07-19 6:15 ` Krzysztof Kozlowski
2023-07-18 18:29 ` Bjorn Andersson
2023-07-18 18:53 ` Nikunj Kela
2023-07-18 19:07 ` Bjorn Andersson
2023-07-18 19:10 ` Nikunj Kela
2023-07-18 19:30 ` Bjorn Andersson
2023-07-18 22:05 ` Nikunj Kela
2023-07-19 10:55 ` Cristian Marussi
2023-07-19 14:02 ` Nikunj Kela
2023-07-23 2:15 ` kernel test robot
2023-07-24 16:44 ` [PATCH v2 0/3] " Nikunj Kela
2023-07-24 16:44 ` [PATCH v2 1/3] dt-bindings: arm: convert nested if-else construct to allOf Nikunj Kela
2023-07-25 6:01 ` Krzysztof Kozlowski
2023-07-24 16:44 ` [PATCH v2 2/3] dt-bindings: arm: Add qcom specific hvc transport for SCMI Nikunj Kela
2023-07-25 6:06 ` Krzysztof Kozlowski
2023-07-24 16:44 ` [PATCH v2 3/3] firmware: arm_scmi: Add qcom hvc/shmem transport Nikunj Kela
2023-07-25 17:03 ` Cristian Marussi
2023-07-25 17:12 ` Nikunj Kela
2023-07-31 14:04 ` Nikunj Kela
2023-08-01 7:27 ` kernel test robot
2023-08-11 17:57 ` [PATCH v3 0/3] " Nikunj Kela
2023-08-11 17:57 ` [PATCH v3 1/3] dt-bindings: arm: convert nested if-else construct to allOf Nikunj Kela
2023-08-11 17:57 ` [PATCH v3 2/3] dt-bindings: arm: Add qcom specific hvc transport for SCMI Nikunj Kela
2023-08-11 17:57 ` [PATCH v3 3/3] firmware: arm_scmi: Add qcom hvc/shmem transport Nikunj Kela
2023-09-05 16:06 ` [PATCH v3 0/3] " Nikunj Kela
2023-09-05 16:37 ` Krzysztof Kozlowski
2023-09-07 10:36 ` Sudeep Holla
2023-09-07 14:20 ` Nikunj Kela
2023-09-07 16:16 ` [PATCH 0/2] " Konrad Dybcio
2023-09-07 22:32 ` Nikunj Kela
2023-09-11 19:43 ` [PATCH v4 0/4] Add qcom hvc/shmem transport support Nikunj Kela
2023-09-11 19:43 ` [PATCH v4 1/4] firmware: arm_scmi: Add polling support for completion in smc Nikunj Kela
2023-10-02 18:18 ` Brian Masney
2023-10-02 18:36 ` Nikunj Kela [this message]
2023-10-03 10:33 ` Sudeep Holla
2023-10-03 10:50 ` Cristian Marussi
2023-10-03 15:53 ` Nikunj Kela
2023-10-04 16:11 ` Sudeep Holla
2023-10-05 3:25 ` Nikunj Kela
2023-09-11 19:43 ` [PATCH v4 2/4] dt-bindings: arm: convert nested if-else construct to allOf Nikunj Kela
2023-09-11 19:43 ` [PATCH v4 3/4] dt-bindings: arm: Add new compatible for smc/hvc transport for SCMI Nikunj Kela
2023-10-03 10:44 ` Sudeep Holla
2023-10-03 15:59 ` Nikunj Kela
2023-10-04 15:53 ` Sudeep Holla
2023-10-05 21:51 ` Nikunj Kela
2023-09-11 19:43 ` [PATCH v4 4/4] firmware: arm_scmi: Add qcom hvc/shmem transport support Nikunj Kela
2023-10-02 18:34 ` Brian Masney
2023-10-02 18:39 ` Brian Masney
2023-10-02 18:45 ` Nikunj Kela
2023-10-02 18:42 ` Nikunj Kela
2023-10-03 10:48 ` Sudeep Holla
2023-10-03 11:19 ` Sudeep Holla
2023-10-03 16:16 ` Nikunj Kela
2023-10-04 16:06 ` Sudeep Holla
2023-10-04 17:48 ` Nikunj Kela
2023-10-05 22:20 ` Bjorn Andersson
2023-10-05 22:33 ` Nikunj Kela
2023-10-06 7:26 ` Sudeep Holla
2023-09-18 15:01 ` [PATCH v4 0/4] " Nikunj Kela
2023-09-18 15:15 ` Sudeep Holla
2023-09-18 15:54 ` Brian Masney
2023-09-19 8:56 ` Sudeep Holla
2023-10-02 17:31 ` Nikunj Kela
2023-10-02 17:58 ` Cristian Marussi
2023-10-03 10:34 ` Sudeep Holla
2023-09-18 20:32 ` Krzysztof Kozlowski
2023-10-06 16:42 ` [PATCH v5 0/2] Add qcom smc/hvc " Nikunj Kela
2023-10-06 16:42 ` [PATCH v5 1/2] dt-bindings: arm: Add new compatible for smc/hvc transport for SCMI Nikunj Kela
2023-10-06 20:08 ` Brian Masney
2023-10-09 14:41 ` Sudeep Holla
2023-10-09 14:52 ` Nikunj Kela
2023-10-09 21:03 ` Konrad Dybcio
2023-10-06 16:42 ` [PATCH v5 2/2] firmware: arm_scmi: Add qcom smc/hvc transport support Nikunj Kela
2023-10-06 20:17 ` Brian Masney
2023-10-09 14:47 ` Sudeep Holla
2023-10-09 14:59 ` Nikunj Kela
2023-10-09 15:29 ` Sudeep Holla
2023-10-09 17:49 ` Nikunj Kela
2023-10-09 19:08 ` Sudeep Holla
2023-10-09 19:16 ` Nikunj Kela
2023-10-09 19:14 ` [PATCH v6 0/2] " Nikunj Kela
2023-10-09 19:14 ` [PATCH v6 1/2] dt-bindings: arm: Add new compatible for smc/hvc transport for SCMI Nikunj Kela
2023-10-09 19:14 ` [PATCH v6 2/2] firmware: arm_scmi: Add qcom smc/hvc transport support Nikunj Kela
2023-10-10 10:42 ` Sudeep Holla
2023-10-10 10:21 ` [PATCH v6 0/2] " Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d5af4d7-23fc-a03e-bad8-760209b537a0@quicinc.com \
--to=quic_nkela@quicinc.com \
--cc=andersson@kernel.org \
--cc=bmasney@redhat.com \
--cc=conor+dt@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®