From patchwork Thu Feb 4 16:59:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12067867 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 21B05C433E0 for ; Thu, 4 Feb 2021 17:01:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D6FB464F65 for ; Thu, 4 Feb 2021 17:01:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6FB464F65 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=9kApHBwjbut8knOj7lkO/b8RtuHv3eKHwlIwpwAiTpk=; b=EtlXYcBoX0td9k5Jyg/L4u4Vk+ Px91gOILKrcfL0fQ26Ob/TrRpJuLPfnTVawann1QxrVML7rCcLUcN+lqxg+qGjMU3BeihkM2YtoMU VGe5bGxtiMU1kPs4JPZYfDf5T6J1h8piBCvciaJNcGzkpE2TTHrwDQwybMf4Di5IJBdINOyQTUfy4 SyWY3rCnOLdYvMcNAT9OMY/39FX7CBuMQH5Cd1GkLDBMuusqsIMOuA/z8BjsD3GYASxo7hYoNv3gh PxNz/CWkt/7UFkTlkw+4YwajZhZqBb9wgFGbFqF1iLkrmvtboNg6MCKwhtKwNsEMiF2urNhizte5b 5fyJdOyQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7hzb-00083r-GB; Thu, 04 Feb 2021 17:00:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7hzX-000824-Hs for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 17:00:28 +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 125B711D4; Thu, 4 Feb 2021 09:00:22 -0800 (PST) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4EEC23F73B; Thu, 4 Feb 2021 09:00:20 -0800 (PST) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 0/3] Introduce SCMI System Power Control driver Date: Thu, 4 Feb 2021 16:59:10 +0000 Message-Id: <20210204165913.42582-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-20210204_120027_674462_2643F780 X-CRM114-Status: GOOD ( 16.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, sudeep.holla@arm.com, lukasz.luba@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, cristian.marussi@arm.com 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 series, building on top of the recently introduced SCMI System Power Protocol support, adds a new SCMI driver which, registering for SystemPower notifications, acts accordingly to satisfy SCMI plaform system transitions requests like shutdown/reboot both of graceful and forceful kind. (possibly involving userspace when the request is of the graceful kind) Interaction with userspace boils down to the same orderly_ Kernel methods used by ACPI to handle similar shutdown requests. 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. The series has been rebased in v5 on top of: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/ since this last series about SCMI modularization carries also a few changes in the SCMI interface exposed to drivers like this one. This whole series, rebased as above specified, can be found (with some messy DEBUG patches on top) at [1]. Thanks Cristian [1]: https://gitlab.arm.com/linux-arm/linux-cm/-/commits/scmi_system_power_control_ext_V5 --- v4 --> v5 - rebased on SCMI Modules v5 series to use new SCMI protocols interface - removed signal based shutdown/reboot - removed all module parameters - added 60secs fixed timeout to shutdwon/reboot requests - make it modularizable to cope with SCMI core modularization - refactored all data config structs - using dev_* instead of pr_* v3 --> v4 - rebased v5.11-rc2 - removed unneeded ugly usage of atomics and barriers - simplfied SysPower shutdown state machine - split out macro definition to different patch v2 --> v3 - rebased - some minor cleanup in codestyle and commit message v1 --> v2 - split out of SCMI System Power Protocol series now merged Cristian Marussi (3): firmware: arm_scmi: support only one single SystemPower device firmware: arm_scmi: add System Power utility macro firmware: arm_scmi: add SCMI System Power Control driver drivers/firmware/Kconfig | 12 + drivers/firmware/arm_scmi/Makefile | 1 + drivers/firmware/arm_scmi/bus.c | 25 ++ .../firmware/arm_scmi/scmi_power_control.c | 347 ++++++++++++++++++ include/linux/scmi_protocol.h | 1 + 5 files changed, 386 insertions(+) create mode 100644 drivers/firmware/arm_scmi/scmi_power_control.c