Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp206624lfu; Wed, 30 Mar 2022 20:57:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrib6/NnIVIxM68V7pHAS1HagFnlCc1RpnT7c0WAROm+CpoSNCv/UmD7g7OrKTfbY7btP+ X-Received: by 2002:a17:90b:4c09:b0:1c7:6c8:43c8 with SMTP id na9-20020a17090b4c0900b001c706c843c8mr3714200pjb.208.1648699071101; Wed, 30 Mar 2022 20:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648699071; cv=none; d=google.com; s=arc-20160816; b=h8C8pLb/1Ub+poLVQogklb+Y03okRPlztZJ0YS0kXcjdi/nBZkaisCVBO4Sm9IEHyk p+k3DhZzXqYHXJfY8HGmFMR8eB5y5XbZPehp9Dl9yErEyY4FdthJXl4JY4ykS9p7h3MZ GqV4gysg+fkFtc1r+GPjO70PbS9pncyV58WEC6w5/C4ZTsr6qLJEfZ+ex8JQjL54nXfz kWEwaTuIEsEihErMnbNPfnKb0sdM9+jF4UDUBNWw7b6BhFX0Z+0FCdlw1EDdV89XOgqw ytHRmRLkCg8z2ykWt3FFvn3LQfbOqMnCBxwYr4ny6FyWvivIOzQSh1/AlcvVGD1BV5FG o+ew== 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=lCx9Y7nxFnPIcXL9UYv1aOBRmBv1PdQXD/g2WMkm5pM=; b=xNR4vi4Nchzzjgr/kZohwd5v8LYt9EBncd8N8Ly2NJIqii9k5bpjnwyhcWxNiS9vJH 8Ulg3Wxu58mGl1/2LWUI4YJw16qONbIGA2cVVp7B1JzfesO8XoJUlR6DygaZxkWuTYmN EcMC7sPh8clK8+T+5L3sUsGLCx0xSG/exeGGGnCd689CNAUDknV6gELUqMABSqr2NJfL 18AEU/oMEIu9LUO2VhyH5Snf6zv9mQcNQ6XZEERUPm/ZOZB7TPeCu2vViegcqfq4K5+A MB6VGYC+Gkurh0t7ZrO6vSK7hRyScHbZ7oHjUJ7tiy5n+dthAHJDx3wyH+B53pTJLMkL Jc+g== 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: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c142-20020a624e94000000b004fa77892f86si21217899pfb.57.2022.03.30.20.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 20:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECED11704F6; Wed, 30 Mar 2022 20:10:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347813AbiC3PIS (ORCPT + 99 others); Wed, 30 Mar 2022 11:08:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347797AbiC3PIQ (ORCPT ); Wed, 30 Mar 2022 11:08:16 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4512E98F7A for ; Wed, 30 Mar 2022 08:06:29 -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 F1E8C23A; Wed, 30 Mar 2022 08:06:28 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A28163F73B; Wed, 30 Mar 2022 08:06:27 -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: [PATCH 00/22] SCMIv3.1 Miscellaneous changes Date: Wed, 30 Mar 2022 16:05:29 +0100 Message-Id: <20220330150551.2573938-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=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 all, this series introduces a bunch of SCMIv3.1 miscellaneous changes to support basically all the SCMIv3.1 specification [1] addition with the exclusion of the Powercap protocol and driver which will be introduced later on in another series. Most notably the series adds: - supports across all protocols for long resources naming using *_NAME_GET dedicated new commands - Clock protocol Rate change pre and post notifications - Voltage protocol asynchronous voltage level set command (VOLTAGE_LEVEL_SET_COMPLETE delayed response) - Perf protocol power-cost in micro-watts (only internal support) - Perf protocol PERFORMANCE_LIMITS_SET new checks Beside this, the series starts with a few general fixes (01-08/22) and a couple of refactoring: - one (09/22) simply to split out of common.h into a new protocols.h all the structures needed only by protocol code, so that the protocol implementation can include such reduced header instead of the whole common.h which was growing insanely - another around the handling of multi-part commands. SCMI already allowed to issue some commands using a multi-message scheme through which a particularly big response, which could possibly not fit the underlying transport max payload size, could have been split into multiple chunks. Such logic, though, was scattered all across various protocols, leading to a lot of code duplication, so, before adding even more duplication with SCMIv3.1, I split out the common logic to a couple of helpers to handle such mechanism in a common way through some abstract iterators (13/22) and then ported all the protocols users of such mechanism to the common iterators (14,16-18/22). SCMIv3.1 new features have been tested with an emulated backend server, while refactoring has been chekced against a standard SCMI stack running on a JUNO. The series is based on sudeep/for-next/scmi/updates [2] on top of commit 38a0e5b735d6 ("clk: scmi: Support atomic clock enable/disable API") Any feedback very welcome, Thanks, Cristian [1]: https://developer.arm.com/documentation/den0056/d/?lang=en [2]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi/updates --- Cristian Marussi (22): firmware: arm_scmi: Fix sorting of retrieved clock rates firmware: arm_scmi: Make protocols init fail on basic errors firmware: arm_scmi: Fix Base list protocols enumeration firmware: arm_scmi: Validate BASE_DISCOVER_LIST_PROTOCOLS reply firmware: arm_scmi: Dynamically allocate protocols array firmware: arm_scmi: Make name_get operations return a const firmware: arm_scmi: Check CLOCK_RATE_SET_COMPLETE async reply firmware: arm_scmi: Remove unneeded NULL termination of clk name firmware: arm_scmi: Split protocol specific definitions in a dedicated header firmware: arm_scmi: Introduce a common SCMIv3.1 .extended_name_get helper firmware: arm_scmi: Add SCMIv3.1 extended names protocols support firmware: arm_scmi: Parse clock_enable_latency conditionally firmware: arm_scmi: Add iterators for multi-part commands firmware: arm_scmi: Use common iterators in Sensor protocol firmware: arm_scmi: Add SCMIv3.1 SENSOR_AXIS_NAME_GET support firmware: arm_scmi: Use common iterators in Clock protocol firmware: arm_scmi: Use common iterators in Voltage protocol firmware: arm_scmi: Use common iterators in Perf protocol firmware: arm_scmi: Add SCMIv3.1 Clock notifications firmware: arm_scmi: Add SCMIv3.1 VOLTAGE_LEVEL_SET_COMPLETE firmware: arm_scmi: Add SCMI v3.1 Perf power-cost in microwatts firmware: arm_scmi: Add SCMIv3.1 PERFORMANCE_LIMITS_SET checks drivers/firmware/arm_scmi/base.c | 43 +- drivers/firmware/arm_scmi/clock.c | 337 +++++++++++--- drivers/firmware/arm_scmi/common.h | 225 +-------- drivers/firmware/arm_scmi/driver.c | 165 ++++++- drivers/firmware/arm_scmi/perf.c | 162 ++++--- drivers/firmware/arm_scmi/power.c | 44 +- drivers/firmware/arm_scmi/protocols.h | 318 +++++++++++++ drivers/firmware/arm_scmi/reset.c | 40 +- drivers/firmware/arm_scmi/sensors.c | 645 +++++++++++++++----------- drivers/firmware/arm_scmi/system.c | 9 +- drivers/firmware/arm_scmi/voltage.c | 218 ++++++--- include/linux/scmi_protocol.h | 31 +- 12 files changed, 1495 insertions(+), 742 deletions(-) create mode 100644 drivers/firmware/arm_scmi/protocols.h -- 2.32.0