From patchwork Mon Jan 24 10:03:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12721844 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 DDF08C433F5 for ; Mon, 24 Jan 2022 10:05:28 +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: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=lMGCz7m0gt7S5vL1v4uF/0HqPw3qka2aeWQlRsXeJac=; b=fWN+uL7LQflY85 Ki7iMT5xcOqZUhxkddKU6Aapuq9y0kJ6CTSqS9bICSl86hzJufFoX1xWZY/BG/UBB4/ZKXqNAzO7U FDM7C/fw8aAg6C11r9NNwuVoEsAC9ivG4Ob8Ijt3cMzDBgZrC7RRr4gXL3mcPddqSAaAMn0YKpNmT D3XzLKl4UCFz6wSsMGhln2oeSCJOnzQ+bfymaFfZ6jxfTTC1yRUxb8bz7NaWfHLh3PquFvV/Bo5z5 zSqDZtmaB5JOHk0UgKtnH6RSFDqEBRFM8SsVVdVA3Tt/MEq0MuZeDpSFMt7CoivPY9f2C3GpC6PiY 1k7umqAFFNkm2M21jIvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBwCn-002u8g-Bx; Mon, 24 Jan 2022 10:04:09 +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 1nBwCk-002u83-4M for linux-arm-kernel@lists.infradead.org; Mon, 24 Jan 2022 10:04:07 +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 2A5286D; Mon, 24 Jan 2022 02:04:05 -0800 (PST) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7E7533F73B; Mon, 24 Jan 2022 02:04:03 -0800 (PST) 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, peter.hilber@opensynergy.com, igor.skalkin@opensynergy.com, cristian.marussi@arm.com Subject: [PATCH 0/6] Add SCMI Virtio & Clock atomic support Date: Mon, 24 Jan 2022 10:03:35 +0000 Message-Id: <20220124100341.41191-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-20220124_020406_242297_D80D1730 X-CRM114-Status: GOOD ( 15.78 ) 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This small series is the tail-subset of the previous V8 series about atomic support in SCMI [1], whose 8-patches head-subset has now been queued on [2]; as such, it is based on [2] on top of tag scmi-updates-5.17: commit 94d0cd1da14a ("firmware: arm_scmi: Add new parameter to mark_txdone") Patch 1/5 adds polling mode to SCMI VirtIO transport in order to support atomic operations on such transport and it could have been an independent patch indeed, it is provided here only for ease of testing. Patch 2,3 introduce a new optional SCMI binding, atomic_threshold, to configure a platform specific time threshold used in the following patches to select with a finer grain which SCMI resources should be eligible for atomic operations when requested. Patch 4 exposes new SCMI Clock protocol operations to allow an SCMI user to request atomic mode on clock enable commands. Patch 5 adds support to SCMI Clock protocol for a new clock attributes field which advertises typical enable latency for a specific resource. It is marked as RFC since the SCMI spec including such addition is still to be finalized. Finally patch 6 add support for atomic operations to the SCMI clock driver; the underlying logic here is that we register with the Clock framework atomic-capable clock resources if and only if the backing SCMI transport is capable of atomic operations AND the specific clock resource has been advertised by the SCMI platform as having: clock_enable_latency <= atomic_threshold The idea is to avoid costly atomic busy-waiting for resources that have been advertised as 'slow' to operate upon. (i.e. a PLL vs a gating clock) This last patch is marked as RFC too since it is dependent on the previous one (that is RFC-tagged too) To ease testing the whole series can be find at [3]. Any feedback/testing welcome as usual. Thanks, Cristian [1]: https://lore.kernel.org/linux-arm-kernel/20211220195646.44498-1-cristian.marussi@arm.com/ [2]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=scmi-updates-5.17 [3]: https://gitlab.arm.com/linux-arm/linux-cm/-/commits/scmi_atomic_clk_virtio_V1/ Cristian Marussi (6): firmware: arm_scmi: Add atomic mode support to virtio transport dt-bindings: firmware: arm,scmi: Add atomic_threshold optional property firmware: arm_scmi: Support optional system wide atomic_threshold firmware: arm_scmi: Add atomic support to clock protocol [RFC] firmware: arm_scmi: Add support for clock_enable_latency [RFC] clk: scmi: Support atomic clock enable/disable API .../bindings/firmware/arm,scmi.yaml | 10 + drivers/clk/clk-scmi.c | 71 +++- drivers/firmware/arm_scmi/Kconfig | 15 + drivers/firmware/arm_scmi/clock.c | 34 +- drivers/firmware/arm_scmi/driver.c | 36 +- drivers/firmware/arm_scmi/virtio.c | 315 ++++++++++++++++-- include/linux/scmi_protocol.h | 9 +- 7 files changed, 440 insertions(+), 50 deletions(-)