Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2814176pxj; Sun, 6 Jun 2021 15:16:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfULkuDrcRejvClZZmB9NdgQIjoeUp6+gi3tLHfVqGO2loEy9XbVKWGvbB09wITFSsgHPi X-Received: by 2002:a17:906:488a:: with SMTP id v10mr14681867ejq.383.1623017784237; Sun, 06 Jun 2021 15:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623017784; cv=none; d=google.com; s=arc-20160816; b=vOT48iBmWXrjJl0cM7Fn3pUzbKK/I0ZTq2V7dkZexWxh1nea/jm6sZTmi2K4shOWbB 3kRHaXtTu9oyrRTCiMLxLpYPck7HL3l5Mj2EYbL1nmIzG8B9vn5CLOmpaCvMVKQ3k5PQ 1bsx2V577YO+2VjPlFxENKKcONga8jB0ARm7fNLRQMOsJnhfNs1DjiypHoZaDwuxViNK O54jHLmIa/pciLgzofzLufEDdhTbxB2yhllv1jMKhZNCdYUJIeqdZsKJrrrXQrhK9dVW iJ2RYP22odw0xDyLXisWYvuQyunLUl4ObDro/BjanoLa15hDVmLinr984beqlBiyu+3v Rs+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=G3ZlrCQySZHDqIkRGYslrIprlEG551aRmCjmR7wrPOE=; b=eGiUz9V2csHfjobyoXFCybeBpsHAIXLjNVVCWfezkhQBtHFGY4GXYIG/zBWPLlTvRd EZfoAkAVtcRIQRwCXkq7gDDCFG7xf3r3sJjZWswGeLzwhoGK9V1RIC82IH4skZhojr1R hSWKgywNRSd5ArBinbirSPu8o+eSDCr/969s4miMSqn0MPwwd6Cg1hhjUMAeGVl48Lk2 qCiANnagDoV7+ZbpEDISN+A+TnNnSpqsySnz60mDlJfgKDRjp0DMMOO9t5of15EakPHq dBK0EuhR1h3bTw4JujQSDgRAJ7dlQyDVsygqBbRk8uc6EdaXtsgSXQAy/zQOcq/wf4WL fGpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si10997003ejy.541.2021.06.06.15.15.40; Sun, 06 Jun 2021 15:16:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230421AbhFFWO6 (ORCPT + 99 others); Sun, 6 Jun 2021 18:14:58 -0400 Received: from foss.arm.com ([217.140.110.172]:46282 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbhFFWO5 (ORCPT ); Sun, 6 Jun 2021 18:14:57 -0400 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 A73AE31B; Sun, 6 Jun 2021 15:13:06 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1FC053F719; Sun, 6 Jun 2021 15:13:04 -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: [RFC PATCH 00/10] Introduce SCMI transport atomic support Date: Sun, 6 Jun 2021 23:12:22 +0100 Message-Id: <20210606221232.33768-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This RFC series mainly aims to introduce atomic support for transport that can support it. At first in [03/10], as a closely related addition, it is introduced a common way for a transport to signal to the SCMI core that it does not offer completion interrupts, so that the usual polling behaviour based on .poll_done() will be required: this can be done enabling statically a global polling behaviour for the whole transport with flag scmi_desc.force_polling OR dynamically enabling at runtime such polling behaviour on a per-channel basis with scmi_chan_info.needs_polling, typically during .chan_setup(). The usual per-command polling selection behaviour based on hdr.poll_completion is preserved as before. then in [04/10], a transport that supports atomic operation on its tx path can now declare itself as .atomic_capable and as a consequence the SCMI core will refrain itself from sleeping on the correspondent rx-path. In [07/10] a simple method is introduced so that an SCMI driver can easily query the core to check if the currently used transport is configured to behave in an atomic manner: in this way, interested SCMI driver users, like Clock framework [08/10], can optionally support atomic operations when operating on an atomically configured transport. Finally there are 2 *tentative" patch for SMC transport: at first [09/10] ports SMC to use the common core completions when completion interrupt is available or otherwise revert to use common core polling mechanism above introduced; then in [10/10] SMC is converted to be .atomic_capable by substituting the mutexes with busy-waiting to keep the channel 'locked'. SMC changes have not been tested so far (I cannot), AND they are just a proposal at this stage to try to better abstract and unify behaviour with the SCMI core; both patches are completely intended as RFCs, though, not only regarding their implementation but even their mere existence is RFC: I mean maybe we just don't want to do such kind of unification/abstraction, and I can just drop those SMC patches if unwanted; any feedback welcome. Atomic support has been minimally tested against the upcoming virtio transport draft(unposted) series, while polling has been tested both with virtio and mailbox transports. The series is based on sudeep/for-next [1] on top of commit: commit 0aa69c9fc80d ("firmware: arm_scmi: Add compatibility checks for shmem node") Given the RFC status of the series in general I still not have CCed any maintainer out of SCMI subsystem. Any feedback welcome. Thanks, Cristian --- [1]:https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi Cristian Marussi (10): firmware: arm_scmi: Reset properly xfer SCMI status firmware: arm_scmi: Add missing xfer reinit_completion firmware: arm_scmi: Add configurable polling mode for transports firmware: arm_scmi: Add support for atomic transports include: trace: Add new scmi_xfer_response_wait event firmware: arm_scmi: Use new trace event scmi_xfer_response_wait firmware: arm_scmi: Add is_transport_atomic() handle method clk: scmi: Support atomic enable/disable API firmware: arm-scmi: Make smc transport use common completions firmware: arm-scmi: Make smc transport atomic drivers/clk/clk-scmi.c | 44 +++++-- drivers/firmware/arm_scmi/common.h | 11 ++ drivers/firmware/arm_scmi/driver.c | 184 +++++++++++++++++++++++++---- drivers/firmware/arm_scmi/smc.c | 60 ++++++---- include/linux/scmi_protocol.h | 8 ++ include/trace/events/scmi.h | 28 +++++ 6 files changed, 277 insertions(+), 58 deletions(-) -- 2.17.1