Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp1484267imk; Mon, 4 Jul 2022 04:08:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1srHBZ7jnSkuh0HkEYN3PYOc1r5xyUo88Faigty+Dvgb3DnknTp7lqgA8SbmqS82jxpKP3N X-Received: by 2002:a05:6402:2812:b0:439:acad:dfba with SMTP id h18-20020a056402281200b00439acaddfbamr17331778ede.412.1656932903781; Mon, 04 Jul 2022 04:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656932903; cv=none; d=google.com; s=arc-20160816; b=tcfuuiltLq5JcBGJn/toTBU1EqsKTg05GDMTfTT9FVJdGdfHQWoq53KHsPj6eqZ+ad kfrsFJhzZLdQ9kYK/Qb+JsH/84shYcs6mFM971LtQ/olRl2mDkOjZOutAdZiIbbslC6C 7VDA/5vg8MOhgzsEUHrcrflC87SdP59DL37FFaV1z1tagLJfRwSRK7F3KtK5d1VzQBEu BjEtZXZ7fH7i9O8u6u+TwZFVvrnZeX8foPJsOhcpHH1ToqIKq2fuJnshTMSNeZ6sxpr4 XIQHqVAHeYVD7MAP1prwPi2T/PVVPloEII/72KHmuCzoK+VoY2Yruwvz1DtSl1ytNqTa KFqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=M4QvTS+wSpMaAjZh7/js3m5Nlq5gip3SBYGbexHKUOU=; b=nG5GO+ZQayO8s1jRIzzMtSYAdAcG8RYtGIWpW1iX87eOGzdDtl9+OzL/rRKZkvFqvC TqrOoh9qVmOsm56pShLq55iIxdhFapoofDl/5WAtW5W4qQaUSVSeOmA76O9ma18eNpl/ 436uMZi0XNXVx0TESQQtLqV7BhdPM14p9RdpNe5JXliIqbOySUI7PfZ6MyKNBltSTI8h q23hwLBw+LhDACQ3nS/mstfssodPFA7KVfAKamVCEWLeSUyr4ZD8zbNQwMy3OycNQNcK YG7XUxn6m6m1dfkDnlFoThPvXvZv0Hs8gqWIqp/TEOg38TjqLUMh3sMro6McLB3xCk8A 3IBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz1-20020a1709072ce100b006ff03a0cdf6si10222041ejc.951.2022.07.04.04.07.58; Mon, 04 Jul 2022 04:08:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234323AbiGDKWD (ORCPT + 99 others); Mon, 4 Jul 2022 06:22:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234100AbiGDKVp (ORCPT ); Mon, 4 Jul 2022 06:21:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10BC2DF11 for ; Mon, 4 Jul 2022 03:19:49 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 -- 2.32.0