From patchwork Thu Sep 5 22:02:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 13793036 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 DFB2DCE7A9F for ; Thu, 5 Sep 2024 22:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: 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=41WL+feSyoP7RX6WUBTtYFgCqTaroj/Azw0jftS6Ft0=; b=uBlv29jU4m7obC ARsf4nRuL+ihCx8KrLTR1BRj8UabmagdzXQbnGSjKujskJkf1elEaXNBnj9FzkYk8b3BCN+Sr+dqg sXAeLwKtltdLZS9057ZiB4ZJ5g64QrS5LmBWVDzYlwUZmMl4wleGoH5iJQxZCT5nRTdTZ7CDQhQ7C wWQHLO19vvfei7AgS1hCePziN7sD4i2LM3tjB/cBYbg3BUyUWv6WhCKdXhqNwW35Fgip7j0UHKsVT +SvLfghYhOi1zE9LjWav+Snx9qdM3qDrUiOCohRkjr/h5Mc4ET2TV6gi3UILLD5GfBxL1n6nhyx6+ Gwp73feACURFkiwFG66A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smKdc-00000009xwm-2LxO; Thu, 05 Sep 2024 22:07:36 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smKZs-00000009xP2-3IG9 for linux-arm-kernel@bombadil.infradead.org; Thu, 05 Sep 2024 22:03:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=41WL+feSyoP7RX6WUBTtYFgCqTaroj/Azw0jftS6Ft0=; b=DC1bTjqZg+XpST8s8DEo0Cm72N qitekIXzlNM2DCE3OSiwVkqp6xCV+tqLwngnmK3fwqion5iPA18LAKsMFki+YVMOj4fgkForf/Xek EXiNCKjCDPkIQc8MeOgU/isnsWgFjMBjoZP6QxtZ8iAyBwYI8fxjrflsUsEeNNu4MJROVjc0k0/Es KU5eHOmfpDseudGzH10vJm6aXI9e43dfDS/j17t2Q+kT27dbTjjB+92dM+K84Ho6ZxMv2gHpjFMHC 7tZZgPUD38nlFuNUXWwe+FDcR05O48GKOiXof4u97/4C+XqiapDB+qkeFo5acpyj1SlBqVRC7KDgq Yz7Bbf3Q==; Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1smKZa-00000000YrU-3J2d for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 22:03:42 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-714302e7285so1154808b3a.2 for ; Thu, 05 Sep 2024 15:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725573802; x=1726178602; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=41WL+feSyoP7RX6WUBTtYFgCqTaroj/Azw0jftS6Ft0=; b=tAyqJ7ZFECzmKPLsZpqHdxKKhw3DwpB3yLMoOsyf4d+ybwVzregKGN+1cPBWVU4ZrR m+GkKJqZp0eoEsTF8ncBsL4FiihrzVHg4Q8pN9ATok1PQEXzNBjx3eGROcVgEcRg5lMB p1NKwsRzPBQSM1bQJse5uXP0ru4MpSnEIjYiQYhsIlwYzyZYz/1TzENe5JSo24xHNiaX 06PYqBK6tRuCnr6n+TV3jvV1rIpi/+tFLTYSfloqLok7C7DsAGi2Afozslf1m909Q+Gb 0pZEHC4/eUNHmY6gxASWHdG+T64BsidHB0yG/gmb6ABUyerJIzqOBR/LpizfjGWFauZx Deiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725573802; x=1726178602; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=41WL+feSyoP7RX6WUBTtYFgCqTaroj/Azw0jftS6Ft0=; b=kgsWxpcOzQRNc1MojgEkTK8GfPrL6pUVMk166bSiPiZzPojr5vmw06M4z2U5Ionuct 7zp2OVOfPwhlf6GMC0ahV4LnCXBjAZiP42UqfmvVFAeSMgJp1+VjhFZ+bf3MYrI2vXop CaKrYJ73EGvq1zq54I4E2qK4qX+/B34QQdV5avVS3E/NzKTPkAe1H4mRvWvbNB55JZQF 4H1Sn7bmvp0SgngLozPqWA84fkdD49NoWkkMBR9vF5IeYRBzYbqGcl0MeicrBrxpSuiR QaWe5hbpt36McCGxhkyyElaXA3YPRs3z0b2PzJwoe4rSDYpotmO0K3RoTaO1JhDsoihU 6qOg== X-Forwarded-Encrypted: i=1; AJvYcCUpe318J2pImP100ZXST7iCQbGtwjQdKmyrf+qfbaWe54ks7q0kKb0TeUcC6WIAckJUwlgdaD027g8QY0d+w797@lists.infradead.org X-Gm-Message-State: AOJu0Yy7nIIJ+uqNTFbMCriCSQ3g+F8Dv5xIpjezSHuAjExyNrZn/cE9 2+o+Qfi7ewYayjWy+Wu3m61XXK2IGz23pyPSXeJr3obaVQ9SjtGuAol45OGpv/Q= X-Google-Smtp-Source: AGHT+IFgAUMIvSHgLESeGQfg1z9nn91qdHyz9Ic0DH/cx4rUi6lSF6kZn33ca2MEKbqpkbORknGKjA== X-Received: by 2002:a05:6a00:4b04:b0:717:87f3:92e8 with SMTP id d2e1a72fcca58-71787f3943amr5777885b3a.29.1725573801896; Thu, 05 Sep 2024 15:03:21 -0700 (PDT) Received: from localhost ([71.212.170.185]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7177853326csm3674034b3a.64.2024.09.05.15.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 15:03:21 -0700 (PDT) From: Kevin Hilman Subject: [PATCH v3 0/3] pmdomain: ti_sci: collect and send low-power mode constraints Date: Thu, 05 Sep 2024 15:02:48 -0700 Message-Id: <20240905-lpm-v6-10-constraints-pmdomain-v3-0-e359cbb39654@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJAq2mYC/4WPQW7DIBBFr2Kx7lgMxgiiqOo9qi6wGTdIwXbBR Y0i372EdNF2kx0fad77/8oSRU+JHZori5R98stcQvfUsPFk53cC70pmggvJNRdwXgNkBchhXOa 0RevnLcEa3BLKE6auc1NvaZLSsAJZI03+qwpe3+450sdn8Wz3TzbYRIUVgt8OTVYtIsQRb7eBU rK1waE51gKGSzRSCNMiN1qXGhDS+jLYy9kPkdqCeWY3zcmnbYmXOitj9fws6B8tyAgcHGo1KO3 IyfEPvtKz+EVE85AoClEq7ERvFed6+kfc9/0bd5GPXIgBAAA= To: Ulf Hansson , linux-pm@vger.kernel.org Cc: Nishanth Menon , Vibhore Vardhan , Dhruva Gole , Akashdeep Kaur , Sebin Francis , Markus Schneider-Pargmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3407; i=khilman@baylibre.com; h=from:subject:message-id; bh=saMma2ymybzJWYTTQFbUhKrtLeP15luhuGW/Ddk6lvk=; b=owEBbQKS/ZANAwAKAVk3GJrT+8ZlAcsmYgBm2iqoDl3qzuImDgvwy/56oUMlM8+yJq6igJ7Fl rZgheaAL/yJAjMEAAEKAB0WIQR7h0YOFpJ/qfW/8QxZNxia0/vGZQUCZtoqqAAKCRBZNxia0/vG Ze+UD/9uq+XFgxGVyjsf141ywlVwWX13BifJhHv9TaLtyRv/mPy9n8DeyYOdKh7Qa9HE7oynp+q PkaRGCpTCdQYKWn+J3ONAu+YIWd0kSUBcNtRBOW4JhUDj+2nfj1lM/J4Qo6xl5AEP7pi2ZKeAM+ 6FJ92MQx21wVKK9EuLaDhMmw+RgGkBBKgOo7qgULHex+KH+OjkfKlhRHdGxLDBJqGgFyL/BQa0Y TMtAJyY4/B09khl3xYJdNcOzSmsq9Da7Z5i2nqKP7SLG9yfDc6ZbHHajIp+n7KMbyo77YHmvmP9 Z4WIZIJDR8+b+OE6t9K4tG8EILxqwe5WBruldHXQSgTHnA3Qug6dcQicN4dyxBeltbb3cnv9e5T 8p5MTulteVJK5aoNUxjfN4GdCW2PySJ1rxdNqNuJVGRQQjn24Xl9UeoHGqUjNO7Z0/AfTnDf8xd 1XqH0WoIJbhK44Ow2QjXbx/VLIW5lBW45kWennL7Luwjvr8UKnHiYZZzY7npEooWz/fHYH1WIET h7UqLGZ4XQNp6W3Gev1Zi5KxoHAzW7GTJ5mYGwVrKiaGsqn+KNYjnozLc7hMsmGrcfixuh4Swb+ 87EgNoVS605opqr0/RCk+vS6h0WrhqsnR4V6fhIIhNQUmW6HWceObv8LNcHtYzqmoGoCj+qw13j fWGGCVds62bmNUA== X-Developer-Key: i=khilman@baylibre.com; a=openpgp; fpr=7B87460E16927FA9F5BFF10C5937189AD3FBC665 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_230335_399897_9CC0C8C6 X-CRM114-Status: GOOD ( 18.59 ) 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 The latest (10.x) version of the firmware for the PM co-processor (aka device manager, or DM) adds support for a "managed" mode, where the DM firmware will select the specific low power state which is entered when Linux requests a system-wide suspend. In this mode, the DM will always attempt the deepest low-power state available for the SoC. However, Linux (or OSes running on other cores) may want to constrain the DM for certain use cases. For example, the deepest state may have a wakeup/resume latency that is too long for certain use cases. Or, some wakeup-capable devices may potentially be powered off in deep low-power states, but if one of those devices is enabled as a wakeup source, it should not be powered off. These kinds of constraints are are already known in Linux by the use of existing APIs such as per-device PM QoS and device wakeup APIs, but now we need to communicate these constraints to the DM. For TI SoCs with TI SCI support, all DM-managed devices will be connected to a TI SCI PM domain. So the goal of this series is to use the PM domain driver for TI SCI devices to collect constraints, and communicate them to the DM via the new TI SCI APIs. This is all managed by TI SCI PM domain code. No new APIs are needed by Linux drivers. Any device that is managed by TI SCI will be checked for QoS constraints or wakeup capability and the constraints will be collected and sent to the DM. This series depends on the support for the new TI SCI APIs (v10) and was also tested with this series to update 8250_omap serial support for AM62x[2]. [1] https://lore.kernel.org/all/20240801195422.2296347-1-msp@baylibre.com [2] https://lore.kernel.org/all/20240807141227.1093006-1-msp@baylibre.com/ Signed-off-by: Kevin Hilman --- Changes in v3: - change latency set functions to static void - Link to v2: https://lore.kernel.org/r/20240819-lpm-v6-10-constraints-pmdomain-v2-0-461325a6008f@baylibre.com Changes in v2: - To simplify this version a bit, drop the pmdomain ->power_off() changes. Constraints only sent during ->suspend() path. The pmdomain path was an optimization that may be added back later. - With the above simplification, drop the extra state variables that had been added to keep track of constraint status. - Link to v1: https://lore.kernel.org/r/20240805-lpm-v6-10-constraints-pmdomain-v1-0-d186b68ded4c@baylibre.com --- Kevin Hilman (3): pmdomain: ti_sci: add per-device latency constraint management pmdomain: ti_sci: add wakeup constraint management pmdomain: ti_sci: handle wake IRQs for IO daisy chain wakeups drivers/pmdomain/ti/ti_sci_pm_domains.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) --- base-commit: ad7eb1b6b92ee0c959a0a6ae846ddadd7a79ea64 change-id: 20240802-lpm-v6-10-constraints-pmdomain-f33df5aef449 prerequisite-message-id: <20240904194229.109886-1-msp@baylibre.com> prerequisite-patch-id: a0efbf22e69d23dba8bb96db4032ca644935709b prerequisite-patch-id: a9b6a17956ff6a09a6ed19c35df9018e28b5059b prerequisite-patch-id: 2999da190c1ba63aabecc55fae501d442e4e0d7b prerequisite-patch-id: 69a741b9c81d7990937483fc481aafa70e67669d prerequisite-patch-id: 945b15416a011cb40007c5d95561786c1776bb98 Best regards,