From patchwork Tue Aug 20 00:00:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 13769196 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 261DEC3DA4A for ; Tue, 20 Aug 2024 00:02:06 +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=qYwQZfpXfcofXq/WqC5i1bo4dCZz/4sz9h2uTbcnNtQ=; b=S1v0M7jyBYXQIK sH9O29DetcvR08w2zq6prXir5aR8+hpyLP/EhrhaqOn9mjE13OVuolOmeeMbSP2QIWahshkbK1Wqh by+wk9+6SOuIFyye2NRs+yZSKFt/7HGx5MzZyNPl0xJhJlpuwbgimWq1Eki9bhgDH5ddSipkVVrUm hrH2si3VwBcsgmVjiLCg8BDjcCtpSyjoypHEADIv/ho426AEw6gY6387OWfZdQsl36ee+ArJFDMMb 810Jq7GDTl5B7jpi8Vi3f/F0+Q099TYMCi9Jr/HxdM5GYqvh8xJJINgjHedfLgjgWrdeJpGgOFUr1 8j2+jAcAJHu4JV1K2sBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgCJt-00000003HZB-1w6p; Tue, 20 Aug 2024 00:01:53 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgCIX-00000003HDq-1cai for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 00:00:31 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2021aeee5e4so14009505ad.0 for ; Mon, 19 Aug 2024 17:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1724112028; x=1724716828; 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=qYwQZfpXfcofXq/WqC5i1bo4dCZz/4sz9h2uTbcnNtQ=; b=0cdWC6MFPmW9hIbg+QrqTZPtbX/U7qZsqhE34HJWZRWOhSnlVg6QvqmLQ6mvPkl2cP KQZdvqwrFZ/5NX1GBSPO5mzVFr92yLlYt6//J8pP80buI5WEbwxPjxFXsSLSKWVm4oGx sUr5FI3f3wuy3aQo9FjzlUxygFBft2jHiYQCvZ1voTkR/5COka9TxX+No3+nLvQTEXRh hLNPZle5A8Dlp8vfEvhkom8fiw+FCRqa/h7zHoZ9EfzaZyXjcznayQTjjm9wShpW2d93 sfa4K5aaU3hUCpIC9Ro39gks33osfUid5h2jbrOLCsB1oGjfBi40wCQFEm9Cxh63mr0b 85ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724112028; x=1724716828; 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=qYwQZfpXfcofXq/WqC5i1bo4dCZz/4sz9h2uTbcnNtQ=; b=b11yx0OkP9Gfhkf61eGohLXLSg/TBSfJS7twyVBNi7WJk0ZFkQKdUNzLzL6b+B/Gh5 BvN2PUEnSzEKiu8Ze+Z1YpG72yLbNbz/FSOFJTFyKKqoyPFeFKn19icEhSMuO6qhMHOa Kwsz04R2/w2VF5o9oFENfLnLa6F8djM2XSX34Mjne0ti/He3NIfO9tuCz6u6PkeRqDmM MxNotZXqG2dFF62LbQwn7AnT9AyOo09J8nqbhE8bzlnt5ATUnLSsXIEe/m0UQNEzkJpf nF8MQdwNXV5vRo5dB8xJ7Fl3LMlQYysQoIECUUJQ3/d1i/aZHuOa2h/R6Ze9KZfbvv3S uN9Q== X-Forwarded-Encrypted: i=1; AJvYcCUVP18QSWOzfDkfUrKTykq7urSNd5IdHAq86vmpw1Zso9LKvEgX+pMmujc3kj7bav/0YdD9+zjHNniY3Oc6giOf@lists.infradead.org X-Gm-Message-State: AOJu0YwfS7ktHWmXa436HV9k6UFz59Ex0q2Tu08BhqK7WYn4LjLDJxCG KsF+zlP8icvlR7HWl6NRzCe6ReuV4wo9OAztRAfcgOseounAGMRE59dpvok5B20= X-Google-Smtp-Source: AGHT+IGSXvukX7kbGClstg5grsq7V6LRd/un1ZgvccObqT3cUNKRgFzs02r59XyEcSU29E7zTMcDmw== X-Received: by 2002:a17:902:ecc1:b0:201:f83e:c25d with SMTP id d9443c01a7336-20203e4c5f5mr144447395ad.7.1724112027672; Mon, 19 Aug 2024 17:00:27 -0700 (PDT) Received: from localhost ([71.212.170.185]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f031953esm67835405ad.90.2024.08.19.17.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 17:00:27 -0700 (PDT) From: Kevin Hilman Subject: [PATCH v2 0/3] pmdomain: ti_sci: collect and send low-power mode constraints Date: Mon, 19 Aug 2024 17:00:10 -0700 Message-Id: <20240819-lpm-v6-10-constraints-pmdomain-v2-0-461325a6008f@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAIrcw2YC/4WOQQ6CMBBFr0Jm7ZAWsUFX3sO4KHQqk1jAtjYSw t2t6N7dvMnPf3+BQJ4pwKlYwFPiwOOQodoV0PV6uBGyyQyVqGrRiArvk8OkUArsxiFEr3mIASd nRpdPtPu9sQdNtq6PkEsmT5Zfm+By/bKnxzN74vcJrQ6Uu5zjeCqSKqVE30n4hHsOcfTzNi7JL f3bcfi3I0kUaGSjWtUYMnV3bvV859ZTmV1wXdf1Df4dlLz8AAAA 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=2842; i=khilman@baylibre.com; h=from:subject:message-id; bh=7sp3VsNcS1ZBdE6slYC/382qTXdje+YxQ0pZ8fy11HI=; b=owEBbQKS/ZANAwAKAVk3GJrT+8ZlAcsmYgBmw9ya4MkY3hwzy0pDRAwwyoRlaI8y/D4sC6+mU qP7Z4CqnX+JAjMEAAEKAB0WIQR7h0YOFpJ/qfW/8QxZNxia0/vGZQUCZsPcmgAKCRBZNxia0/vG Zd5nEACbVCHMqTDYdiiOhvkYGOIZPNs/Qp3JJtUfwL5p3kprSf8ELnu4DvmU8lLdepCUZOSAF2z ru6G6P+QjlAr+0YR3gAY11N6DTizTdPPaayzQwVJ/Zb9tPwTqjPgj4AEmbsT3LzSixvyZ3EVfas VCqTzXgQM9silr37Jf++aXZgVpb8ZMb0j3F+17788G1nx8Ni39HMin/xxnnqwZzHXvG1qofthRh UK0feRykXuAJOZkP8HJcSpLcAfo8AAFTA7XTAulrlqBXfVlzfOP1fF4TSqEhujzlzR+9889iLQY HdLkipc4bJuhTqz8FN79h2BgHioz/vxawGM9iI58HW3esfpJgCCElwdF3f4hjWGaUvWcUCavwMp YVhox2FwRAKGeEsk46NrXd9KnP+ucDfoajJAJWTiQu8Dctt52BBdtNvgv0D07KJo88yng8LGzWb nNK4I+c26jAodSRlj8FxFxohLEUzXMPY0wgiYJgi0cL239V3dz0603YNxULpJ9TJ7d+bkQjdWyO BD1KsCailX8omO0AmqiBHF/t2+LiedvVbR1/XYO6KVF2II5C3k/7/1g4wO7dSxl3kC6mxnxVpUu RAgOjBjSdnU3/cVIKoGQwBAU8649lPyw40GvqWOa86KiglP+hKFGI0fiu1UBHbUt2R4248dN3uy p28C+hTfL1PXYEQ== 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-20240819_170029_466711_A212D83C X-CRM114-Status: GOOD ( 18.20 ) 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 Tested-by: Dhruva Gole --- 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 | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) --- base-commit: ad7eb1b6b92ee0c959a0a6ae846ddadd7a79ea64 change-id: 20240802-lpm-v6-10-constraints-pmdomain-f33df5aef449 Best regards,