From patchwork Fri Sep 6 16:14: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: 13794441 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 D17E2E6FE2F for ; Fri, 6 Sep 2024 16:22:17 +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=wn2UpEZi41nSQjInl6SrXLXpD6o8knFu4d9yCjfYxLY=; b=wsrb9D5UGejXjI EBNL51K4j/2eJTQcMEN8dTXu2hzNO7qJ2pwlqJxORfr+DQECPLBps+t5mKGcA0V3BYzBOuzp0kYuE llzjC/89z61vO2oh/ldJnjq6IxUreFQli0Jwtb9jwtVEAJdqJePGsX2VxjbSAQA3MA8EBolkDz4d7 zHkT2A+9Afut4e+eDn2FsxZEdkMlQXThJ6Ky3KLdhvC27VuZIGDWE5MfhzDAHC+xUUAmCk8Vp5yNr HV8J9ht1BJpANm9V1y2Hve2kl9Ms4oie1jL4jnXZ0+5D3cPGO6RAWZlrpfWbTPUxDOT2f+MjaV4pf 9kgOvJGC53lBy7UJWtsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smbiq-0000000Cwsy-2Tdt; Fri, 06 Sep 2024 16:22:08 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smbc6-0000000Cuzf-0qfO for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 16:15:12 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-718d8d6af8fso710221b3a.3 for ; Fri, 06 Sep 2024 09:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725639309; x=1726244109; 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=wn2UpEZi41nSQjInl6SrXLXpD6o8knFu4d9yCjfYxLY=; b=wMJMcS+i/SIIOWoP9CS7SNvHZC+iLo2AvCnmqsOMe8ZUVq4oKl7jRnqWSyH3bn0F0Q 67bmcDkjFqnAKdf3K6KTQajDBh37vHi2sxe9Clu2rHz4qGnfKPtv6KgOMpn+wCmIZvqs weXllVIYxIq4YQKauGnKJ5XvABuIXfSjT2x6Kjn867Zh22WHLvsD1iZoaMLcfO/dMx2E ToNT3vPB+ObNZzkMjDOVXLyCtVoNFzTzB9ywz7/7ud7fy1KU5HqkFaMB8gbmwhVng6E8 rJlRXkofH8nWpTx+dBF0oYYKrLBO4ZvOrItW5vtcwWNvG6wjZ2dBpvwXtXlV3sUt0jny GVWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725639309; x=1726244109; 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=wn2UpEZi41nSQjInl6SrXLXpD6o8knFu4d9yCjfYxLY=; b=mtm+/283J5X2RBo31V9MoAB1s2xInqVy43uPPGW4dqbggZn2f9jCY2dAUhg/yoxW2p rHY81uB3P8zCVo8ZINFaW24EpQSGRuWazDxW8YTOMvNQRQhXZKHa+861UY4ctLd7IPmw nfOhtABWErs7X+iztteegUEmXRVcLuqiuxlAx0Xmx4+A5hN7LSCi+fNcZbqvL4iawun9 YyFJRNIVI/T2AU4HhUj6eEX7bKMk8cW3Bpk0gtlxyZMlKl/P+oODkhMIX6ATLeGHHjlk QBBreRMwrRSmD2VVE+KDuUSAARWQRbJAVw8A0ODVlj9PAkpHEFeFKu+XvvdGdiPgdi1U pAzw== X-Forwarded-Encrypted: i=1; AJvYcCVpOQVM97gLWGQpb67BLx5huuqAZ6Hwqg3elZnaFLTG+4wiymCW3xgmXqMPz81U1fL2peO5puWefRk3RqI00vg3@lists.infradead.org X-Gm-Message-State: AOJu0YzSboXznpkXYKZYilzBEnPMkFaZF+x9lWzYvb1kCGPcYUE2QXaJ K5W5maLwMvxC+vDWUTl0UafcYKH7lbVp5g27SDLHWPYpGNMI2zS2acJl0i5BDV7uKV20ul7sY5N F X-Google-Smtp-Source: AGHT+IGXiEjqpuXYP+ZXwcYudJb6roUqkR2/hbNZu8SceDTTB9vrlPg/xfywsr+XXuBErr/nLwzJrg== X-Received: by 2002:a05:6a20:6f05:b0:1c6:fa64:e5bc with SMTP id adf61e73a8af0-1cce10ab0e1mr32688520637.34.1725639308743; Fri, 06 Sep 2024 09:15:08 -0700 (PDT) Received: from localhost ([71.212.170.185]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71778521026sm5207535b3a.18.2024.09.06.09.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 09:15:08 -0700 (PDT) From: Kevin Hilman Subject: [PATCH v4 0/3] pmdomain: ti_sci: collect and send low-power mode constraints Date: Fri, 06 Sep 2024 09:14:48 -0700 Message-Id: <20240906-lpm-v6-10-constraints-pmdomain-v4-0-4055557fafbc@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHkq22YC/43P22rEIBAG4FcJXtfgKaKhlL5H6YXGSVdYk1Std Fny7nXdQg8UtneOMN//zxkliB4SGrszilB88utSB3HXoelglhfA3tUZMcIEUYTh4xZwkZgSPK1 LytH4JSe8BbeG+sQz524eDMxCaFSRLcLs31vA0/N1jvD6VnPy9RNZk6BaIfg8dkX2lOI40ctug JRMazB2962AJoJqwZjuKdFK1Ro4pO3RmtPR2wh9ZR7QJebgU17jqZ1VaMv5vGC4dUGhmGBHlbR SOXBi+sE3vbBvItU3RVZFISlng5GEqPkPkX+J+h8deRWBD3qylms5iF/ivu8fmmsmJNoBAAA= 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, Kevin Hilman X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3633; i=khilman@baylibre.com; h=from:subject:message-id; bh=22yU5CB3XbloUlWmjfe5a8u2Ymnn+CEopQkapNyGFjE=; b=owEBbQKS/ZANAwAKAVk3GJrT+8ZlAcsmYgBm2yqLb1vrc1X5+SfRllnnVJ1eiLSPj1yDIjuww OgmoHMsb9mJAjMEAAEKAB0WIQR7h0YOFpJ/qfW/8QxZNxia0/vGZQUCZtsqiwAKCRBZNxia0/vG ZVYKD/42q/r8/QcPQxtIyUr9BU7QOZz1u88iEQbhvPbBomHdzAKnCIFIawoUzvkpThwNZfd1b6W q8u+uZIz5s4nPPbXAWXOu8mGIyHal7/G3MQL3jXICwNMq3L7Z7eA3uPYuFiMM1dVRVZJA/X5FY4 lPPZ0309eB22ZpZKnE15rW4K+T+PQ2fhXvH1lBsEol1pVsZEHaMmxsZBEhGcUrruWnWb4Lvyuue WyimL6rJTVq2PDb9HiqEvpy3pCItmOdOfBOklm6Su78UZJq0THLo2CphvoZsl5RL9XSp6w2bWP0 ZB39ptNHEdj4+AX3CyrVazicMssQIIq7NnBwJkKOg71+M2XaonHNvqoC+6kqILNHAs1N/fUt+DY kzM69bEUQX0PSsA8TOaBXOClutwaD09xZ5YBoHwNv3nd/GF6k/by/MZznYbouf2QrD5qq0J02w0 bxVktpLVR5ZVc9PAURyFwyo2O65I7A6UZ08lAv2hOlCrBDn+h8/F+UKdzkLcC4wIDcTsk/9VuyF FtBKuuXQjCCJbv+MxoN2++0qDVICxv97/3B88dCb6wmaPZ7dPg7yRTmXtYVNTzP/7/mhvpMzbW7 BOKLvXuUZivIBw7nYJ/pHtK8mKeOksym6waKi/DuhNA2hmyFZElVebXcU1m6N6m1wdvN/sNGetP EY3T095dAhW9wYQ== 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-20240906_091510_283113_7BE29D6E X-CRM114-Status: GOOD ( 18.53 ) 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 v4: - fixed missing return in wakeirq error path - updated trailers with reviewed & tested tags - Link to v3: https://lore.kernel.org/r/20240905-lpm-v6-10-constraints-pmdomain-v3-0-e359cbb39654@baylibre.com 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 | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 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,