From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79741E74905 for ; Mon, 2 Oct 2023 18:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wTXXx8CjAwj0WBa8hPI0AkHzKBC6+ymdMal2UC7x46M=; b=SViq3I54hnQL0a kApPTRKzVtbp5CmL2CItvUoJlkzuA3W1DdpxHRYExiXIXlDx5ACPOk8x9eirHKnS7//GgGvTbky07 cVVBSB657PwFKU6GKVv6sqb/4h5PubGJW3aWcgm2ZMaOKSS3jTdLyKXdvr/YENgBDCGY9k3mFGU91 snw9GuH2gA8mRtD/OYqcB31wNCDfnYaZS+ARRQFW3A+zdx/QMfJJbGMK1T2vQ5m49FahRyY+rX0U6 Hb15qq7U3VZNGpSkrlp4anNXioFVqeHpNL7BBaNIdRbSD+2HQGdrAoY5u8idEjzQXb8XNTUWp+7eo GWBexHlpnNp5cK/PYwLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnNVX-00DCh8-1A; Mon, 02 Oct 2023 18:19:03 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnNVV-00DCgL-10 for linux-arm-kernel@bombadil.infradead.org; Mon, 02 Oct 2023 18:19:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:In-Reply-To:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JTHelUlse8IqAMEkn3+OwaSpVuDEvR+XOh2gu1M9D5c=; b=qlHyLuf74CtbsBDxQjkIhYsfHL b6P6EkGQFdzAJRqJXDp7Fd0HVZ5SD687Yvb0FpQu01caj2jkqYh/pVSFWUWq1aQrjMlY9CIIVa8+E QbyTqqYWPipEoue3+GchJongAIBEwDNDhPRIyAx6LnVeyST+1g3+zr48Rwk4rasDq4wUZaCchNwzX OPMG2B03nNFzYmUhV7xB5M/v24v2XKts19wReN85/Ffagc1iUNQ85F+CltSxM7XbPBTnN5jw923gy 2H3fgqEaIFtHDQbQ3h0RwSANJ50lVdlPjAWmQP/03S6SVb+kIojg84ZnCv58bCNNFlu71z+C/D1xY mybYRqTQ==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1qnNVQ-00ATPq-MR for linux-arm-kernel@lists.infradead.org; Mon, 02 Oct 2023 18:18:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696270700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JTHelUlse8IqAMEkn3+OwaSpVuDEvR+XOh2gu1M9D5c=; b=iwK2+rlSyhSLHZOAxqowclMb0ZAK3AhHVLOcm5XsGCLGgxmO4tBsKCTpecsm03IEFTdlyn 9XfmXD5g5HAlFLwiedxIsas9aJW0bX/B1re+7lE0LwVtAe/9qAMoReFf6faOZv/la/Hr0l AmElbvgZexKySDOJ3SDf4hmvYnr9ifI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696270709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JTHelUlse8IqAMEkn3+OwaSpVuDEvR+XOh2gu1M9D5c=; b=dAFmbJYyCvkuRGf2R8UrI0XnC6oG03tuM9GcbqwMSJsWKTryAKaYJi2F9YrYn81V0cAUiz UWC91EBHt2rO4INT41U4Zcui0GUkX/0TEV8Mbqbo06qixfMKzYqKG6R4MAXZP1tLnEBRTl +YbdN5qvt8s4AJ+EcfSNzKoQe4crTZ4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696270722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JTHelUlse8IqAMEkn3+OwaSpVuDEvR+XOh2gu1M9D5c=; b=TjKNok2NOFqeeQJdDQMUD0G9ot8U/M51jPqzfVkR2j6RFOlVScY8jKVxc57ZIsUtJVIHBG wpKWf2QkE6wD1j9jCXIRwQisTT3M+c9T75izgqFSnd37Yz3/Vcsn9gGkHfdhzjKUvFJ5gZ fORpZ7tDF59ktJFHPfWVUla67FmD12o= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-601-BHJOuhjLPeeRCjQTWFC68g-1; Mon, 02 Oct 2023 14:18:04 -0400 X-MC-Unique: BHJOuhjLPeeRCjQTWFC68g-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-775869cf2f5so335280785a.1 for ; Mon, 02 Oct 2023 11:18:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696270684; x=1696875484; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JTHelUlse8IqAMEkn3+OwaSpVuDEvR+XOh2gu1M9D5c=; b=HzH3Fcc11Wcgvy0hxRTHSmrda+2JqyZViBuOE+l0+0p3I8IK4c8Cn2pxL6Yf+eUuKd uRqJurB4xpw6xQwdscUEkoBtlqet7jxx/KAHmO3P/qaZccOEhYE1Wsc7+TS7PRtlcTTa B/VB4KZ8dNNkq9dOlAzltyAnzLs/NnjIfGD5TVLyE0byX4QngpIoX9Z3cxxb1m5UgyMF a8wjYocN+ypaxoArXEsfee4Hdw4sxpazYtR9M8fu1QtqX60m/T6FD/KhUd9iwWprBBWw lyLRCXDyjX1V66zyiT6tOAyahsdBNorBqvXZKULYUpyDwPFoseAbO6L6XqKPX9aaIT5V RaMg== X-Gm-Message-State: AOJu0Ywe8rf4/f+KkEh3u/KlZS8dl30xAKTIuY5W2dW+aHGCPMF1II6f hT3kt4H/WwEu5fvNXeChoIrljIgL/irDrF1vMW81Jg2lefh03P9Xtd3bibOWEvJegOwBPwOZDYD VVRngN0A8lQk1gmRVstUb6fgUtTHQNqXMjl4= X-Received: by 2002:a05:620a:4090:b0:76c:ae1f:201e with SMTP id f16-20020a05620a409000b0076cae1f201emr539267qko.27.1696270684154; Mon, 02 Oct 2023 11:18:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjEc7izGr0GyD8cKh/uiIXCkEVxKgvtniJXa7m5bt13+TPqrNIMC8w/At/Vr4WizGwvTagDA== X-Received: by 2002:a05:620a:4090:b0:76c:ae1f:201e with SMTP id f16-20020a05620a409000b0076cae1f201emr539250qko.27.1696270683850; Mon, 02 Oct 2023 11:18:03 -0700 (PDT) Received: from brian-x1 (c-73-214-169-22.hsd1.pa.comcast.net. [73.214.169.22]) by smtp.gmail.com with ESMTPSA id ld7-20020a056214418700b0065d89f4d537sm3313105qvb.45.2023.10.02.11.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:18:02 -0700 (PDT) Date: Mon, 2 Oct 2023 14:18:01 -0400 From: Brian Masney To: Nikunj Kela 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 Message-ID: References: <20230718160833.36397-1-quic_nkela@quicinc.com> <20230911194359.27547-1-quic_nkela@quicinc.com> <20230911194359.27547-2-quic_nkela@quicinc.com> MIME-Version: 1.0 In-Reply-To: <20230911194359.27547-2-quic_nkela@quicinc.com> User-Agent: Mutt/2.2.9 (2022-11-12) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231002_191856_900047_CDA276E8 X-CRM114-Status: GOOD ( 24.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel