linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Jim Quinlan <jim2101024@gmail.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	bcm-kernel-feedback-list@broadcom.com,
	james.quinlan@broadcom.com,
	"open list:SYSTEM CONTROL & POWER/MANAGEMENT INTERFACE Mes..." 
	<linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt
Date: Tue, 5 Jan 2021 17:35:26 +0000	[thread overview]
Message-ID: <20210105173526.yvjh2bxnofjzmc6n@bogus> (raw)
In-Reply-To: <e37cb2fc-14a3-b658-9df7-6f67a2c4d755@gmail.com>

On Tue, Dec 22, 2020 at 07:37:22PM -0800, Florian Fainelli wrote:
> 
> 
> On 12/22/2020 6:56 AM, Jim Quinlan wrote:
> > The SMC/HVC SCMI transport is modified to allow the completion of an SCMI
> > message to be indicated by an interrupt rather than the return of the smc
> > call.  This accommodates the existing behavior of the BrcmSTB SCMI
> > "platform" whose SW is already out in the field and cannot be changed.
> > 
> > Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> 
> This looks good to me, just one question below:
> 
> [snip]
> 
> > @@ -111,6 +145,8 @@ static int smc_send_message(struct scmi_chan_info *cinfo,
> >  	shmem_tx_prepare(scmi_info->shmem, xfer);
> >  
> >  	arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res);
> > +	if (scmi_info->irq)
> > +		wait_for_completion(&scmi_info->tx_complete);
> 
> Do we need this to have a preceding call to reinit_completion()? It does
> not look like this is going to make any practical difference but there
> are drivers doing that for correctness.

Why do you think that might not cause any issue ? After first message
is completed and ISR is executed, the completion flag remains done for
ever. So practically 2nd message onwards won't block in wait_for_completion
which means return from smc/hvc is actually completion too which is clearly
wrong or am I missing something ?

Jim, please confirm either way. If you agree I can add the below snippet,
no need to repost.

Regards,
Sudeep

--
diff --git i/drivers/firmware/arm_scmi/smc.c w/drivers/firmware/arm_scmi/smc.c
index fd41d436e34b..86eac0831d3c 100644
--- i/drivers/firmware/arm_scmi/smc.c
+++ w/drivers/firmware/arm_scmi/smc.c
@@ -144,6 +145,8 @@ static int smc_send_message(struct scmi_chan_info *cinfo,

        shmem_tx_prepare(scmi_info->shmem, xfer);

+       if (scmi_info->irq)
+               reinit_completion(&scmi_info->tx_complete);
        arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res);
        if (scmi_info->irq)
                wait_for_completion(&scmi_info->tx_complete);


  reply	other threads:[~2021-01-05 17:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 14:56 [PATCH v4 0/2] firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt Jim Quinlan
2020-12-22 14:56 ` [PATCH v4 1/2] dt-bindings: arm: Add optional interrupt to smc/hvc SCMI transport Jim Quinlan
2020-12-23  2:48   ` Florian Fainelli
2021-01-03 16:40   ` Rob Herring
2020-12-22 14:56 ` [PATCH v4 2/2] firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt Jim Quinlan
2020-12-23  3:37   ` Florian Fainelli
2021-01-05 17:35     ` Sudeep Holla [this message]
     [not found]       ` <CA+-6iNwnA+3kaHom3XRpTLOu_4QsHOmFiZ2M2=sA7Go-uADe1g@mail.gmail.com>
2021-01-05 18:32         ` Jim Quinlan
2021-01-06  9:30           ` Sudeep Holla
2021-01-06 14:33             ` Jim Quinlan
2021-01-04 14:57 ` [PATCH v4 0/2] " Jim Quinlan
2021-01-04 16:02   ` Sudeep Holla
2021-01-11 18:30 ` 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=20210105173526.yvjh2bxnofjzmc6n@bogus \
    --to=sudeep.holla@arm.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=jim2101024@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).