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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65955C433F5 for ; Mon, 13 Dec 2021 11:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbhLML0B (ORCPT ); Mon, 13 Dec 2021 06:26:01 -0500 Received: from foss.arm.com ([217.140.110.172]:52260 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235626AbhLML0A (ORCPT ); Mon, 13 Dec 2021 06:26:00 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C59F6D; Mon, 13 Dec 2021 03:26:00 -0800 (PST) Received: from bogus (unknown [10.57.33.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 858233F793; Mon, 13 Dec 2021 03:25:58 -0800 (PST) Date: Mon, 13 Dec 2021 11:25:55 +0000 From: Sudeep Holla To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [PATCH v7 06/16] firmware: arm_scmi: Add configurable polling mode for transports Message-ID: <20211213112555.vhjhu3xopesvxmio@bogus> References: <20211129191156.29322-1-cristian.marussi@arm.com> <20211129191156.29322-7-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211129191156.29322-7-cristian.marussi@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 29, 2021 at 07:11:46PM +0000, Cristian Marussi wrote: > SCMI communications along TX channels can optionally be provided of a > completion interrupt; when such interrupt is not available, command > transactions should rely on polling, where the SCMI core takes care to > repeatedly evaluate the transport-specific .poll_done() function, if > available, to determine if and when a request was fully completed or > timed out. > > Such mechanism is already present and working on a single transfer base: > SCMI protocols can indeed enable hdr.poll_completion on specific commands > ahead of each transfer and cause that transaction to be handled with > polling. > > Introduce a couple of flags to be able to enforce such polling behaviour > globally at will: > > - scmi_desc.force_polling: to statically switch the whole transport to > polling mode. > > - scmi_chan_info.no_completion_irq: to switch a single channel dynamically > to polling mode if, at runtime, is determined that no completion > interrupt was available for such channel. > > Signed-off-by: Cristian Marussi > --- > v5 --> v6 > - removed check on replies received by IRQs when xfer was requested > as poll_completion (not all transport can suppress IRQs on an xfer basis) > v4 --> v5 > - make force_polling const > - introduce polling_enabled flag to simplify checks on do_xfer > v3 --> v4: > - renamed .needs_polling flag to .no_completion_irq > - refactored error path when polling needed but not supported > --- > drivers/firmware/arm_scmi/common.h | 11 +++++++++++ > drivers/firmware/arm_scmi/driver.c | 17 +++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h > index 6438b5248c24..99b74f4d39b6 100644 > --- a/drivers/firmware/arm_scmi/common.h > +++ b/drivers/firmware/arm_scmi/common.h > @@ -339,11 +339,19 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); > * @dev: Reference to device in the SCMI hierarchy corresponding to this > * channel > * @handle: Pointer to SCMI entity handle > + * @no_completion_irq: Flag to indicate that this channel has no completion > + * interrupt mechanism for synchronous commands. > + * This can be dynamically set by transports at run-time > + * inside their provided .chan_setup(). > + * @polling_enabled: Flag used to annotate if polling mode is currently enabled > + * on this channel. > * @transport_info: Transport layer related information > */ > struct scmi_chan_info { > struct device *dev; > struct scmi_handle *handle; > + bool no_completion_irq; > + bool polling_enabled; Do we really need a separate flag for polling_enabled ? no_completion_irq means you need to enable polling and force_polling too. Just trying to see if we can get rid of unnecessary flags. -- Regards, Sudeep 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 9A2FEC433FE for ; Mon, 13 Dec 2021 11:27:24 +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=0vnneeNJFpsKca0/b9ajNn05+3g639xD5kUeWcLn78s=; b=VDPahuvXFW/JKz miMQFjTN1qN00QycOmomYCOcvCjxwEmCdRPASmvN8KgEJtzZNW6X62LDssXSAjaktmFkTBrjiRiho +d3vZqAT0Pc9I6tKNpkz0W94FmRCRfwR867p9MjLWSR25drmgcaW/Wday9uSLLIkPxIeB5jc5gd/q Q6vfpEjyCkQO+Sp8dT44EkIZvggiTRpCXa5CSsS/8EZ30QCIwc2VGmaMwXi+0LFizhzsN+N61YAht hGotIFtdvISnIEytEBko58HlHjpfuCR0xwyiiUeTqmH4+qeXjpGvDotuyehmFtVVc7LRCP7B3+dN5 ruff0nrkxZ4Ou/W7Dwgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwjT3-009FiF-Lt; Mon, 13 Dec 2021 11:26:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwjSz-009FhI-QE for linux-arm-kernel@lists.infradead.org; Mon, 13 Dec 2021 11:26:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C59F6D; Mon, 13 Dec 2021 03:26:00 -0800 (PST) Received: from bogus (unknown [10.57.33.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 858233F793; Mon, 13 Dec 2021 03:25:58 -0800 (PST) Date: Mon, 13 Dec 2021 11:25:55 +0000 From: Sudeep Holla To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [PATCH v7 06/16] firmware: arm_scmi: Add configurable polling mode for transports Message-ID: <20211213112555.vhjhu3xopesvxmio@bogus> References: <20211129191156.29322-1-cristian.marussi@arm.com> <20211129191156.29322-7-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211129191156.29322-7-cristian.marussi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_032601_968287_468D3823 X-CRM114-Status: GOOD ( 25.17 ) 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, Nov 29, 2021 at 07:11:46PM +0000, Cristian Marussi wrote: > SCMI communications along TX channels can optionally be provided of a > completion interrupt; when such interrupt is not available, command > transactions should rely on polling, where the SCMI core takes care to > repeatedly evaluate the transport-specific .poll_done() function, if > available, to determine if and when a request was fully completed or > timed out. > > Such mechanism is already present and working on a single transfer base: > SCMI protocols can indeed enable hdr.poll_completion on specific commands > ahead of each transfer and cause that transaction to be handled with > polling. > > Introduce a couple of flags to be able to enforce such polling behaviour > globally at will: > > - scmi_desc.force_polling: to statically switch the whole transport to > polling mode. > > - scmi_chan_info.no_completion_irq: to switch a single channel dynamically > to polling mode if, at runtime, is determined that no completion > interrupt was available for such channel. > > Signed-off-by: Cristian Marussi > --- > v5 --> v6 > - removed check on replies received by IRQs when xfer was requested > as poll_completion (not all transport can suppress IRQs on an xfer basis) > v4 --> v5 > - make force_polling const > - introduce polling_enabled flag to simplify checks on do_xfer > v3 --> v4: > - renamed .needs_polling flag to .no_completion_irq > - refactored error path when polling needed but not supported > --- > drivers/firmware/arm_scmi/common.h | 11 +++++++++++ > drivers/firmware/arm_scmi/driver.c | 17 +++++++++++++++++ > 2 files changed, 28 insertions(+) > > diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h > index 6438b5248c24..99b74f4d39b6 100644 > --- a/drivers/firmware/arm_scmi/common.h > +++ b/drivers/firmware/arm_scmi/common.h > @@ -339,11 +339,19 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id); > * @dev: Reference to device in the SCMI hierarchy corresponding to this > * channel > * @handle: Pointer to SCMI entity handle > + * @no_completion_irq: Flag to indicate that this channel has no completion > + * interrupt mechanism for synchronous commands. > + * This can be dynamically set by transports at run-time > + * inside their provided .chan_setup(). > + * @polling_enabled: Flag used to annotate if polling mode is currently enabled > + * on this channel. > * @transport_info: Transport layer related information > */ > struct scmi_chan_info { > struct device *dev; > struct scmi_handle *handle; > + bool no_completion_irq; > + bool polling_enabled; Do we really need a separate flag for polling_enabled ? no_completion_irq means you need to enable polling and force_polling too. Just trying to see if we can get rid of unnecessary flags. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel