From nobody Mon Feb 9 10:51:46 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25A1128031D for ; Wed, 31 Dec 2025 16:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767198102; cv=none; b=bwqTDRSA+bbL5TdEOcIeekrGmVpXXlFJeZA/k90psIP6qYa13P27RXYO8ccmUS1Ag1kayvQN7cS8DHxVFuaFtWZ8rWCO5Cpr8ke7eFmWvQ9usyUFUcvx7YSpX2FFmPSIx6UX50rPMvt2sDpXKid20cHC7m3UFYGTpF60HORi1ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767198102; c=relaxed/simple; bh=Dfl4wj1tHq5tXEC6+ndOD0LIoQhp1gdm9p/bKFTAoIo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e+nqM9gyhcolMkZNkWf0sr7PeZkTqUXVPA2COQ+0afNmXHL0NVPzqtQpERF+GKWjtHohd+clGZ0rnm7IO3sJSjcF8fQHiFlLzOnGZeRC8zNxXE5UUdK2TUvx1hMb6bCnGQxyuLPec2dNCmEgxBN48ykZlWoSpHUJEyEP/ikpv8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=jIir1ym/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=EXfwNj9/; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="jIir1ym/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="EXfwNj9/" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BVCTf1b3216708 for ; Wed, 31 Dec 2025 16:21:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=3VGjqJh3RyT0cJ/oz3tmoYde8EAQg76pmaj 0byO6AQ8=; b=jIir1ym/0RzTiTmXO0k0/TBi2NXCRdP4WCrkyCMzSjhQhlLPHIk nF6kmXL9ze+5L6vgKh2sVMXwCoSs/Ph4sn/xWrBDCfAS15YLpxDJMAzhGU7D6GT+ 03LgsXjS7+AhvYxfE/dFISRhhPyqS6pPqUjVoMN54CipnU5C3t5hS0nqa7aYJswU KOxp79q8qUJ7eazrC8wGNK0NaJ12eI4MWBqtq7SBosGpJio8aRxQmXY3AEQ3nkTP eETnrMt0FBF2KDPi5iDYvY4VikioVVt3jkr8IBrd5rwEkx28QqQg5uB5iOEySSMm TGoJhttT7HgGuFpsIiLD+y+siLkRv7JjsHw== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bd3v8rcc1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 31 Dec 2025 16:21:39 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-7b8a12f0cb4so12339552b3a.3 for ; Wed, 31 Dec 2025 08:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767198099; x=1767802899; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3VGjqJh3RyT0cJ/oz3tmoYde8EAQg76pmaj0byO6AQ8=; b=EXfwNj9/pjpsRYgvFwdYtstziBiXx235oAdyIA0QOcj6m2bh+RU9GrKJscnbEo9+7s /Ydj82Xfac1FJfsVxgCU+v6qtMuh31C7xVQXdRHUWgC+5o+S2ensYWoNBrmjc3sIM01x Eq/a7gAMSxOzxj0NipowHvMhdl1swY/XaBo938VaB26yYm61GV+/2ZcZCqaJisETsTjB EB+IZJ61CnHzEbiW1lfd1tyZxEb9GZqHfgC+Kxp+rVqxdqK4xxEJFEetyYqleNhm2jZR xIzpIY1Pg/IK75DGxI4TdWW/1+ODm2ygG71+Axv654VsSpF4dcx5wq3WSc5kleidMHBd 6wBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767198099; x=1767802899; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3VGjqJh3RyT0cJ/oz3tmoYde8EAQg76pmaj0byO6AQ8=; b=wG/QT/aIUmuXzPL/qM5yC9Wpf7OctDkqJjxDJRx3FcbYUCVlUL0g6a2GJuqjKoLtqn kuAEPuuwF7RjyYgXLBEI5mXUHs6T30RrhOUNmy93sliQyYKwUPWYgJYAUQW6iefmECsI iXC1p97WfPBkMkAsmgPv3qyFFQABX52f0XLCq91Ej0fKIFaIVXVE2eCi+y4lRgj8c84/ 5WsS/beN8u8M2PO2VA8/VbKfv7DZRlqCwUiqqr/uFsA2ec9HcbG6xVrXZARrAuS3r/x5 S0WPSkHn29Y9Ge6WBu7x4xZ2z5iHmMIZdZL2Pl2rIvaeIC5dUXehWDLP3UQgwI5rfWr8 lGxw== X-Forwarded-Encrypted: i=1; AJvYcCWBLRy6MR2VAgpCDeldr15bcXCkyM4K3VFV/gc51Id+kN/yWBBi7pkxeX2rjGCl6jT8moeY5DeC/P3A5rA=@vger.kernel.org X-Gm-Message-State: AOJu0Yzn906l8Twdk2fFWCxrKvr4TC1et7fC8c2JcLOmzR9sBiysoNvA nnVv5ly3fqkytC0Etkw6gu6HmjSvYVRbNtuiFoXc/Ik6AvpqZXnxan/gaVM2JBm6bTAN/QIQflM oOaexwCgkkJoTepwdYgOPcKNLPjhmgC146GGZJLEQUc3/a7KG/cdC46w51HnHz8w8784= X-Gm-Gg: AY/fxX5qJbsIp4ZnN69JQzO8b3x4+8OisXhu1UUiuwR3nMolfYlTlFhVqG0iaDl9YM9 OqxUzaBCVyNzKgYOjjzHSgpGcQVTabb/AuBGjGU5eGs9BPhD5L8Nat0q+uk70DPhO0vQnTiE5Q8 F7b8+ECeTw1IyaVglKR7nXIYLLkqJ4SPPDpTBPZjo4w25zpm2VVkeCbCA3TxnvClHKIZc2Pgvs5 dFlqnKri7Yk1SIgGQkuigM1fT1O7JhRVPOU4XEZnc6oLu7fD37ag07ugYH9UnpVZzweSp6pFFmE UBBwlxaD+BDEeYLmIyKyo4DOeybN1lmo0+pHKFtoDGZXiAU5jWZQW85GzgLM/eXn+aGU5AGRwYR pYOSAmxaj3bW7uD8ePeQGr6qeKg4= X-Received: by 2002:a05:6a20:9185:b0:366:14af:9bd2 with SMTP id adf61e73a8af0-376aa0f0667mr38630123637.72.1767198098868; Wed, 31 Dec 2025 08:21:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYvA64y+3S57tuUNoeBafTx8Axml2iOeqZq9m8url0fId7OZAR4MDkFvxJDSd4oSBYqR6G+g== X-Received: by 2002:a05:6a20:9185:b0:366:14af:9bd2 with SMTP id adf61e73a8af0-376aa0f0667mr38630087637.72.1767198098271; Wed, 31 Dec 2025 08:21:38 -0800 (PST) Received: from work.. ([120.60.48.165]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34e9224d9e5sm33394008a91.17.2025.12.31.08.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 08:21:37 -0800 (PST) From: Manivannan Sadhasivam To: mark.rutland@arm.com, lpieralisi@kernel.org Cc: bjorn.andersson@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, mani@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Konrad Dybcio , Sudeep Holla , Manivannan Sadhasivam Subject: [PATCH] firmware: psci: Set pm_set_resume/suspend_via_firmware() for SYSTEM_SUSPEND Date: Wed, 31 Dec 2025 21:51:26 +0530 Message-ID: <20251231162126.7728-1-manivannan.sadhasivam@oss.qualcomm.com> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjMxMDE0MyBTYWx0ZWRfX4LMTKZFOXyeV YzPokz7tTSW09cQT7ILnOzbOT4U/bGGLFA9v8GnKWh1yf0JnA1rt2N5phKtLXmtEai0bAa9uNO2 fK2CDdqOWzvOhvAXbimX1rTsSR9lw26W7sxyThnEjUfzGsQCQ3LjiTGtWwXKLw3wEVK7iU8P9eR hGZ3KvbMx/DgDM3PuyioBXW8RSyKt9h4ZMxlRV3UxwexmEFLi1TYup7TtOwO7CZAtlwVrfrI7uQ WeHOM5wq1U7IUOPaz16IWz4xeh4X7HSQ4jJXWPmPlgz0XY974c6AnHVY2RykeoByMAhEFLF0csE r2O8pLcweqFFuwB7vsH52a78T4OKh5f3YGzt4RpbhLzgSZ2VLv2sPbyZSgsVdKaYlDzp57N0Zor aw5p1/cCNs4MNk8dROQFtxwZ6e5AZ4PTt7ME4d7fVxe/SEpWFuR2Cc6DD4SOj+swFm9qhVmInAN lwBpKZm8dObpCtDDHZw== X-Authority-Analysis: v=2.4 cv=JdOxbEKV c=1 sm=1 tr=0 ts=69554d94 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=06avtC1bF50uQPtHxsqKqg==:17 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=7CQSdrXTAAAA:8 a=HVrQ54pZ-2Peqzm-NS4A:9 a=OpyuDcXvxspvyRM73sMx:22 a=cvBusfyB2V15izCimMoJ:22 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-GUID: RXlLzvKsh5Pj7alCTLpj-J_PG_6iyJ3h X-Proofpoint-ORIG-GUID: RXlLzvKsh5Pj7alCTLpj-J_PG_6iyJ3h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-31_05,2025-12-31_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 adultscore=0 phishscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512310143 Content-Type: text/plain; charset="utf-8" From: Konrad Dybcio PSCI specification defines the SYSTEM_SUSPEND feature which enables the firmware to implement the suspend to RAM (S2RAM) functionality by transitioning the system to a deeper low power state. When the system enters such state, the power to the peripheral devices might be removed. So the respective device drivers must prepare for the possible removal of the power by performing actions such as shutting down or resetting the device in their system suspend callbacks. The Linux PM framework allows the platform drivers to convey this info to device drivers by calling the pm_set_suspend_via_firmware() and pm_set_resume_via_firmware() APIs. Hence, if the PSCI firmware supports SYSTEM_SUSPEND feature, call the above mentioned APIs in the psci_system_suspend_begin() and psci_system_suspend_enter() callbacks. Signed-off-by: Konrad Dybcio Reviewed-by: Sudeep Holla [mani: reworded the description to be more elaborative] Signed-off-by: Manivannan Sadhasivam --- This patch was part of an old series that didn't make it to mainline due to objections in the binding and exposing CPU_SUSPEND as S2RAM patches: https://lore.kernel.org/all/20241028-topic-cpu_suspend_s2ram-v1-0-9fdd9a04b= 75c@oss.qualcomm.com/ But this patch on its own is useful for platforms implementing the S2RAM feature in PSCI firmware. So I picked it up, tested on Qcom X1E T14s and resending it. drivers/firmware/psci/psci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 38ca190d4a22..e73bae6cb23a 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -539,12 +539,22 @@ static int psci_system_suspend(unsigned long unused) =20 static int psci_system_suspend_enter(suspend_state_t state) { + pm_set_resume_via_firmware(); + return cpu_suspend(0, psci_system_suspend); } =20 +static int psci_system_suspend_begin(suspend_state_t state) +{ + pm_set_suspend_via_firmware(); + + return 0; +} + static const struct platform_suspend_ops psci_suspend_ops =3D { .valid =3D suspend_valid_only_mem, .enter =3D psci_system_suspend_enter, + .begin =3D psci_system_suspend_begin, }; =20 static void __init psci_init_system_reset2(void) --=20 2.48.1