From nobody Tue Apr 7 04:21:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 B166423EA83 for ; Mon, 16 Mar 2026 08:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773650908; cv=none; b=gM1EY05RGgpZTmoE7JNNOb9suAuuM3JrfJqmce7MQSjnOTAqWzE1vrn/7XFKfn2r5H95oh2CCWI4JrG247+j9r8oB4KF6+j3w/nVBFaORk/KpAGcIxl5CkQIv5D7k3OuKw8TbgOClmvu74F7ePdCrpI/Mw23EOetDi+qaFtvV0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773650908; c=relaxed/simple; bh=C0RLfjOvxxqcBW+InCYlOuH6ZnHlMl5mOlNXy4qD4Rw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=E+OxZ5oUSeShSlXwvXakPts5KxSEqL8iWCvgiICfjJQPJeAUKYGZA1wd0LoNF0dSXolJ3e3iqJfkEJiWcUEJSXV6A1LRHL/H9K9cf4Jai5TT/9WShPG0F8hbqm9+qx8X3qcV5TvAZzq94HuwT6YzRwFaBTUKIHXS2iPEoaqbRO8= 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=lqlJ02rJ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YK69d0co; arc=none smtp.client-ip=205.220.168.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="lqlJ02rJ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YK69d0co" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62G64d9A538832 for ; Mon, 16 Mar 2026 08:48:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=DLH9OkgzIRACCI0JUBEX92 CcsSzaMraDpTjyv0j8cTA=; b=lqlJ02rJ0kf2DEs10UrY2yOlrc4PYZ4jmlUkNd tPIp8NLtLCjDfhF/M7jcMUEhV63v+rCBufR2yr5ssqxw1yOlImnzKsa3MSzkcQLI jJsHvDoD5nBSFhZVWBePGxfHW/6rR1BSu8HVtPTLTafmAxrm+bL460JL4omVoA2b j2USTHCfF3Uw7n4U+t+MI5izMVTfSfJdxWeOY6TY0qmQkE7LprbbpIxLk8fZKmMx pygE5znsJyAQQoCJgRQBMxWod1fb7FrefI0reWx8DcE8L/Sc5Mdmx5bK+6AUXku4 Y79L6PQ337kFLE349xtyje3jWmCJyBdDEptSfai0DeOMwgOQ== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cvyy5mv32-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 16 Mar 2026 08:48:25 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2b05a3c2421so7232375ad.1 for ; Mon, 16 Mar 2026 01:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773650905; x=1774255705; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=DLH9OkgzIRACCI0JUBEX92CcsSzaMraDpTjyv0j8cTA=; b=YK69d0coBttx98E/VKqetpFzhfYpkwXhhOMwh/4HMZqhDKOJ+4flolegFRumrqUvHu uwsqPOvPFdkIet3CmDZ+0zsHBzHwXBnZr02skI3jSkAez3k5iAZPYC26o0+itGKcR7wR VD/BX2oVDK0ZiMclkf4DLmRQU3EzlWKGfG+gHw3F16nVxNITiPDfNiivFX/YD4Pk/yT8 VR4B9L3VKH3JXCUL5QdcbiRoSg7HNnsWROOTWfHdlW9KPSu0ILTBfCZwJN8FjAEOAKkU g8ZabjFiJeA+SO3dn8uG3+yq3qzTFtTQhTrNZsTr011lYnepLp+Il+YetpZycvduHw+W C3bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773650905; x=1774255705; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DLH9OkgzIRACCI0JUBEX92CcsSzaMraDpTjyv0j8cTA=; b=etLyoYkWB1JisCr/vspaR/hj1uWO217JP0CJx47baTaGbVlJ8c1qEHTiOKso5AKtoU R/ZC69w94OvkZCx1jDjjg2CNMKPqpGuAr0AKOGx+cMEl10A5cgRhBdQ6UzYfoOZr0v9s VRSbh44qx4bRe0X02rwc779ahr7f3/LYqETPOx2jeFa7EJOIOIj7TzJ0A4Y8oaHeBuFD DgXsdMgbWS0dKDaNB/rwndoL6ZXE/hljpDbIOICy/nDiTgKuiA+ojL9xgj2t+pbU9ySV FguYDAxXHp9VlzuJhtVCVxRYcZfqxAu0LSQayfiSgX5Kq+wWp2bYtlEDAzK0zd1426rx ootQ== X-Forwarded-Encrypted: i=1; AJvYcCU4lMkj0gGa3ExsGPI1p6Cw5lB+AKtHa8izwHVjIh2gSZiTZifQlouzlmv/ta3aPCwXa04lKeul9iQWne4=@vger.kernel.org X-Gm-Message-State: AOJu0YyKSelfb1T6m3F3vGAikzybwIHN4LkCO/so4s5ozQEsCl5Jz/sT DGhOkE1V3YasS3xiR/ZLLKgSTPiNW/ohwRy+KfBu9YFX1+CaZ2SvBAViKjeCTWn3hPF/qyEbb41 NI3yuLNd/Nf/O8LGgPYy2hlk+L99kF0UC7IYR2+ynEgNoYtorff1UrP+N2Dpmrj7I+caepTKxq4 c= X-Gm-Gg: ATEYQzxo64DHPFFBgudH3rdoQ5pDgCd5UhExCQKkdhjp8exd0cYz0sHdJIOVe1tI3F2 WKpgZlJ0MYV03yDiYoG5i8+oaFntAAGGi5KQqeX7rk3+jMta8HUIBaxnZEjfZD5qgXJSV+mPDqH pAFfuFXEwG2+Cn0Qa93Q/GpA174NVUx6SppnNBZurM7oygqd3nZTtPSmPxps/dIFIvnS5RUbyRC S9tjXdQ+1Wtzold5KgxijwrFC8N8YeopHXMbgVF+75GNEsPA7ve2YW4KohEf5o9ayPJuUpll289 v1eeBHZK+iUfBqpclgNSnUV4YXRhRKxLYp1Hqo25yYb3XNQFQMeWo3vbXTvF27vN7GKXDO3N4Ba GoDy4zPx4g4i/8oc7RgAEw0BekhFE4KDmadu4jYdziQTJPH+ZMA== X-Received: by 2002:a17:903:2ec7:b0:2ae:7f84:79e3 with SMTP id d9443c01a7336-2aeca9c64eamr115688455ad.16.1773650905098; Mon, 16 Mar 2026 01:48:25 -0700 (PDT) X-Received: by 2002:a17:903:2ec7:b0:2ae:7f84:79e3 with SMTP id d9443c01a7336-2aeca9c64eamr115688295ad.16.1773650904555; Mon, 16 Mar 2026 01:48:24 -0700 (PDT) Received: from hu-mkshah-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aece62c4f9sm104154685ad.38.2026.03.16.01.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 01:48:24 -0700 (PDT) From: Maulik Shah Date: Mon, 16 Mar 2026 14:18:18 +0530 Subject: [PATCH] arm64: suspend: Remove forcing error from suspend finisher Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260316-suspend_ret-v1-1-1a30b110bb7d@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIANHDt2kC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDY0Mz3eLS4oLUvJT4otQS3RTTVKB4irFJcrKlElBHQVFqWmYF2LTo2Np aAKHaxsRdAAAA X-Change-ID: 20260316-suspend_ret-d5e202d34cc9 To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Maulik Shah X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773650902; l=3429; i=maulik.shah@oss.qualcomm.com; s=20240109; h=from:subject:message-id; bh=C0RLfjOvxxqcBW+InCYlOuH6ZnHlMl5mOlNXy4qD4Rw=; b=AUJaZ1RZqElA354OMsaaGns516zMnd90syz1b3tgLGl8xo12UZecZgdv01fhugXZJd3VMRPpi OJ6JIIYKOV1As8iaw+vBlHbl3jXVFh9gq4WVbBVzU5W+fIA81vera7O X-Developer-Key: i=maulik.shah@oss.qualcomm.com; a=ed25519; pk=bd9h5FIIliUddIk8p3BlQWBlzKEQ/YW5V+fe759hTWQ= X-Proofpoint-GUID: 6OkB8gCZDladNwssgHhkKBO33cjW2Tgp X-Authority-Analysis: v=2.4 cv=QOxlhwLL c=1 sm=1 tr=0 ts=69b7c3d9 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=UXIAUNObAAAA:8 a=EUspDBNiAAAA:8 a=860BThSAxwKqi7__TBsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=a1s67YnXd6TbAZZNj1wK:22 X-Proofpoint-ORIG-GUID: 6OkB8gCZDladNwssgHhkKBO33cjW2Tgp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA2NSBTYWx0ZWRfX9u6HdjqSR8eb /a4s+fp8hxH/qz38qjH6SftSCDaZb100awA0VuIpfB1G0xe63hTfoCHuOsIutUXu/rlqC5VD1K+ /3KsZKXtSKItaYKL2lWp+bZDXyDWLNhsE1f3W4t0N/tF6JOVJwhWOz3jHf9V6EZGxbvgkmdVoMj 8esjG3ETAregbsgXHPJa2r1VN7VcVQhXW9RC3k8spex+nsM/G1VAea3lo4KIKwEJhQDMHxEmxDa 5arSj+KfzYrKFFCxfqe4XzmxRYOGcqeVnba2zg0xtagH1haCshRGzLvJItXbNEm/d42vpORLQXU vthZ6hSctb/dTGDFtfv6PYyUXHurdLda23xnDl7FdVL9lVyNYmdchjq5Y9FhXLKoRM7mNt3CGw+ dmCbN6JKQAzzhYsZa8LXnblTu6cj92vIM9JmgQ/KhsuTAmZO3IHtmTjFKhGnCBKAe9UC3VjpDV8 8wFY0Zt+sNs/eYoxPmA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_03,2026-03-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 suspectscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603160065 Successful cpu_suspend() may not always want to return to cpu_resume() to save the work and latency involved. consider a scenario, when single physical CPU (pCPU) is used on different virtual machines (VMs) as virtual CPUs (vCPUs). VM-x's vCPU can request a powerdown state after saving the context by invoking __cpu_suspend_enter() whereas VM-y's vCPU is requesting a shallower than powerdown state. The hypervisor aggregates to a non powerdown state for pCPU. A wakeup event for VM-x's vCPU may want to resume the execution at the same place instead of jumping to cpu_resume() as the HW never reached till powerdown state which would have lost the context. While the vCPU of VM-x had latency impact of saving the context in suspend entry path but having the return to same place saves the latency to restore the context in resume path. consider another scenario, Newer CPUs include a feature called =E2=80=9Cpowerdown abandon=E2=80=9D. Th= e feature is based on the observation that events like GIC wakeups have a high likelihood of happening while the CPU is in the middle of its powerdown sequence (at wfi). Older CPUs will powerdown and immediately power back up when this happens. The newer CPUs will =E2=80=9Cgive up=E2=80=9D mid way= through if no context has been lost yet. This is possible as the powerdown operation is lengthy and a large part of it does not lose context [1]. As the wakeup arrived after SW powerdown is done but before HW is fully powered down. From SW view this is still a successful entry to suspend and since the HW did not loose the context there is no reason to return at entry address cpu_resume() to restore the context. Remove forcing the failure at kernel if the execution does not resume at cpu_resume() as kernel has no reason to treat such returns as failures when the firmware has already filled in return as success. [1] https://trustedfirmware-a.readthedocs.io/en/v2.14.0/design/firmware-des= ign.html#cpu-specific-operations-framework Signed-off-by: Maulik Shah --- arch/arm64/kernel/suspend.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c index eaaff94329cddb8d1fb8d1523395453f3501c9a5..b54e578f0f8b03c1dba38157c60= 12bb064adaa12 100644 --- a/arch/arm64/kernel/suspend.c +++ b/arch/arm64/kernel/suspend.c @@ -144,15 +144,14 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned= long)) ret =3D fn(arg); =20 /* - * Never gets here, unless the suspend finisher fails. - * Successful cpu_suspend() should return from cpu_resume(), - * returning through this code path is considered an error - * If the return value is set to 0 force ret =3D -EOPNOTSUPP - * to make sure a proper error condition is propagated + * Successful HW power down should return at cpu_resume() + * however successful SW power down may still want to + * return here to save the work and latency involved in + * restoring the context when the HW never lost it. + * + * If the return value is set to 0 do not force failure + * from here. */ - if (!ret) - ret =3D -EOPNOTSUPP; - ct_cpuidle_exit(); } else { ct_cpuidle_exit(); --- base-commit: 343f51842f4ed7143872f3aa116a214a5619a4b9 change-id: 20260316-suspend_ret-d5e202d34cc9 Best regards, --=20 Maulik Shah