From patchwork Mon Jul 4 10:19:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12905058 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 1D8AEC43334 for ; Mon, 4 Jul 2022 10:52:05 +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:MIME-Version: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=rrjJi5/gcYIpozdC2ngajzanwd/lgA4SAnsxuzAFdcg=; b=2krlvD2cdv/CR8 8HkBqyBz9Ukm9D1T8A/AGhM0evOD1w51dmrqflVZvmQ72VvQasLfVEeXkDyltE2X161g9ejgIXS+y xIG/mJ+NE+5oIUN0YbhM+0TD/223FJY7eR0n5PpRBBoJsNKipnebGDETGfSQa42P82opbjnPJGLIz WHIg6r9xSo+U8IlYd/u5O1L9R90P2yJWUV3zoWixrvtyl4ygXFRHIOP+rvyaVtFXcNWHu0U2k2LTq PSgagGbaRhIn3SfLJ7mTDqVjsUN/xpYHs7GXEn0PuM4mUYW9sJq1FeDOmNizLNdsUP0+JSzTopIyy 9e+o2zWONSID/On5GVVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8JfU-007Fdx-IU; Mon, 04 Jul 2022 10:51:04 +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 1o8JBJ-006u1h-7X for linux-arm-kernel@lists.infradead.org; Mon, 04 Jul 2022 10:19:56 +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 2BBC423A; Mon, 4 Jul 2022 03:19:49 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EAE253F792; Mon, 4 Jul 2022 03:19:47 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, Cristian Marussi Subject: [PATCH v2 0/4] Introduce SCMI System Power Control driver Date: Mon, 4 Jul 2022 11:19:29 +0100 Message-Id: <20220704101933.2981635-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220704_031953_351040_129B719A X-CRM114-Status: GOOD ( 13.19 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This series is a respin of an old series[0] parked for a while waiting for a required SCMI specification change to be published. The series, building on top of the SCMI System Power Protocol, adds a new SCMI driver which, registering for SystemPower notifications, takes care to satisfy SCMI plaform system-transitions graceful requests like shutdown or reboot involving userspace interactions as needed. Interaction with userspace boils down to the same orderly_ Kernel methods used by ACPI to handle similar shutdown requests. The latest SCMI v3.1 specification [1], which adds a new timeout field to the graceful notifications payload, let the platform advertise for how long it will possibly wait for the requested system state transition to happen before forcibly enforcing it. As a part of the series, patch 1/3 enforces, at the SCMI core level, the creation of one single SCMI SystemPower device, to avoid promoting the design of systems in which multiple SCMI platforms can advertise the concurrent support of SystemPower protocol: when multiple SCMI platform are defined, only one of them should be in charge of SystemPower comms with the OSPM, so only one such SystemPower device across all platforms is allowed to be created. Thanks, Cristian [0]:https://lore.kernel.org/linux-arm-kernel/20210204165913.42582-1-cristian.marussi@arm.com/ [1]:https://developer.arm.com/documentation/den0056/d/?lang=en --- v1 --> v2 - moved checks about single SystemPower device creation from bus into driver - dropped patch about removing ida_simple_* obsolete calls Cristian Marussi (4): firmware: arm_scmi: Support only one single SystemPower device firmware: arm_scmi: Add SCMIv3.1 SystemPower extensions firmware: arm_scmi: Add devm_protocol_acquire helper firmware: arm_scmi: Add SCMI System Power Control driver drivers/firmware/arm_scmi/Kconfig | 12 + drivers/firmware/arm_scmi/Makefile | 1 + drivers/firmware/arm_scmi/bus.c | 1 + drivers/firmware/arm_scmi/driver.c | 93 ++++- .../firmware/arm_scmi/scmi_power_control.c | 362 ++++++++++++++++++ drivers/firmware/arm_scmi/system.c | 17 +- include/linux/scmi_protocol.h | 7 + 7 files changed, 477 insertions(+), 16 deletions(-) create mode 100644 drivers/firmware/arm_scmi/scmi_power_control.c