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 X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B113C4708F for ; Tue, 1 Jun 2021 10:27:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E32AD613AB for ; Tue, 1 Jun 2021 10:27:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E32AD613AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CRFOpuz5Cj+Ml9lbY6yPhWMbWYWeDm7nqdMFZgAqc9k=; b=2uSFibczRCgTxN KvHfxw9riTeFCxEAIWqySRODmuQ6nHNwU9nMIDgLNNJpm7oivt/FVNa7JhNGuPPogUpnq5HqtsVMt sDFuZ+Sln8sHr48UZitER6If3niGHe+ROJ/i4Mq98FveoTx4tyqGtUfUtyPqQ6x2OE4nPCUPgs/9F tyxG+Z377oFGLESlVwcdALg01Usd3obXT+Dny0LEwsMxd9W/+jWUIGVY1dKcypMOqyESxdC7P6bYW gr9sOBG8AdmYE01qOIzqJS0WWOeoMObVFMlN7dNfBfyEVak/iBCgh9QCVEbBbXcOGkkDLrl+ysAQq Yog0QzpqPc4p5qX2/tqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo1Zv-00FtsP-4b; Tue, 01 Jun 2021 10:24:55 +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 1lo1Zg-00FtoX-8u for linux-arm-kernel@lists.infradead.org; Tue, 01 Jun 2021 10:24:42 +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 610D311FB; Tue, 1 Jun 2021 03:24:35 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B2FF3F73D; Tue, 1 Jun 2021 03:24:33 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, cristian.marussi@arm.com Subject: [PATCH v2 0/5] Review/Extend SCMI Transport Core layer Date: Tue, 1 Jun 2021 11:24:16 +0100 Message-Id: <20210601102421.26581-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_032440_435424_F85DFD3E X-CRM114-Status: GOOD ( 16.60 ) 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: , MIME-Version: 1.0 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 Hi all, this short series is meant to review and extend a couple of SCMI transport core layer mechanisms in order to ease the interaction with more complex SCMI transport driver like the upcoming virtio-scmi and optee-scmi. The commits in this series have not and *should not* have any impact or require any change in the currently existing SCMI transports. The three main principal area of change are: - introduce monotonically increasing message tokens: change the policy used by the OSPM agent to select sequence number for outgoing messages in order to minimize the re-use of recently utilized tokens so as to mitigate the possible misbehaviors on reception of late arrival 'ghost' reply from the platform, currently hard to identify and discard. More details and ASCII art of the involved logics follows in the related commit :D - introduce optional support for delegated xfers: expose a few helpers from the SCMI core transport layer that can be used by the transports to actively query the core for existing in-flight transactions already associated with a received message header or to obtain a brand new xfer to accommodate a just received notification. The general idea is to optionally let the transports process early and more of their transport specific payloads filling the xfer already naturally associated with the received message header, so that the transport specific implementations can get rid early-on of their specific message envelope structures (before even calling into the core scmi_rx_callback()) and so avoiding upfront the need to keep track of the state of such transport specific message envelopes till the core has processed them till completion or timeout. (while not modifying the signature of scmi_rx_callback)....any feedback even on a more sensible naming for this optional feature would be highly appreciated :D - add optional support for transport-specific init/exit functions: when a transport provides .init/.exit functions in its scmi_desc descriptor, they will be called early on during SCMI core stack init/deinit, so well ahead of SCMI core probing. This allows some transports like virtio/optee to have performed early on some specific setup, such as registering as drivers also with some other kernel subsystem like virtio or optee, before the main SCMI stack is probed. This early init cannot be done through the usual kernel module_* methods because an SCMI transport implementation is not a full-fledged driver but compiled as part of the SCMI core itself, so using module_init() in a transport makes then SCMI core fail to build as a single module including the desired transports. This, as said, is intended to be preparatory work for the rework and simplification of the WIP virtio-scmi series. (init/exit support is indeed needed also by upcoming optee transport) The series is based on sudeep/for-next [1] on top of commit: commit a3b884cef873 ("firmware: arm_scmi: Add clock management to the SCMI power domain") Any feedback welcome. Thanks, Cristian --- v1 --> v2: - fixed a lot of typos in "firmware: arm_scmi: Introduce monotonically increasing tokens" - added init/exit optional support patch [1]:https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi Cristian Marussi (5): firmware: arm_scmi: reset_rx_to_maxsz during async commands firmware: arm_scmi: Add support for type handling in common functions firmware: arm_scmi: Add transport optional init/exit support firmware: arm_scmi: Introduce monotonically increasing tokens firmware: arm_scmi: Introduce delegated xfers support drivers/firmware/arm_scmi/common.h | 51 +++- drivers/firmware/arm_scmi/driver.c | 449 ++++++++++++++++++++++++++--- 2 files changed, 460 insertions(+), 40 deletions(-) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel