From nobody Fri Dec 19 16:03:18 2025 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFCA71D7E54 for ; Sat, 24 May 2025 07:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748071854; cv=none; b=QSSx2YJajG1OMOG2Nfp01X9HsSd6isDEvpSElcllYg51xAEiNDkZVTXmd6lpVWMRi7n1QtKZceBQR5Zzmcu5OqzldgEqwDRnJZpxlgUWl2lVu/bgpvCj2kbU7HLdzAOvRYgaQiB38v5ul38LR2eFpvpiylS6qiuVKvsN/Ewrd84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748071854; c=relaxed/simple; bh=O0HVjXkPpQ+hRZJ3BsTB4d4LrVlN7b2E11+rn3JSmv0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n05AUjkzdUaLWJMbPx3qsBZ9XKnIJuqPEGGiKgvpRZikRxl+NHR8IPyah4Q/a3kvJgC4LDjkCDpg+CfK6hr/uj9gKMBVxRAAJ+bvgbup7eXbeypOfYJF7LbHC2T8htIMUeDTOQLvJjguQWOR+GfpenY+LwP9cef1yt7JmhbGd00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=yZIWcg1h; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yZIWcg1h" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-442eb5d143eso5144155e9.0 for ; Sat, 24 May 2025 00:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1748071851; x=1748676651; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZmciNu0LzBJkCwAxE+xP2RniPnh6vstV6TXm+/dhXAk=; b=yZIWcg1hyQtW1nvlEACuGJ2992VIPKucVhU95FVk6ONlEV5lmYtSf5a2PMP31wfoVi SrIfeajHXpkUXR1a4Zw+qAfmppkMpVZyuKg4QzZFiFiw1NGiY0mgIIR55JYcRWr+HiXo CnXpMtAfWS1mXAdZDZgOga5b/PCsQFzcuCMa8/HcPrErjbqt4t1DduM/XfvbRhRq9mJx GWrp3tiG4vHQ2VbG1hMo0tVwUuzkekjqXmLbdD68mtk4lg3kRkgNDvuJXAjY9WT+Hy9b Ny/Gih81f0Z89JGN7NwU69PlLlT5UippC5pF1yJ8vAtRWEC/DYk4gdYisFCOOAhknCnh YMHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748071851; x=1748676651; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZmciNu0LzBJkCwAxE+xP2RniPnh6vstV6TXm+/dhXAk=; b=KQovbLIq/Zk6NyoC15CGK5vg3wTBiPJQTFDC+NPnJ92ysHoXtChwBpjAE+N/XiMx6N 746xkLAuOgFuRx489cNS1zVf4exztinYotjMEBCZ/wnisgQBc4+LdX/crZU12eX4+sYO OSMnq/ry0DtFYIbxVQhrUUy4AsUnQbY7ssvj8T7q84cuMO/k92D2r8nnhHruwVkSSvM1 B/xBhUZtYixQZJPwTku2CP/lmDznKPbckL12oGCT4DWzodbUaULAm2C9iZjO6fWAn6nc cjWaWjuaJ4iTW70hemac9Hc6E7OwtLqs8AAiNDK9FSd7LBOJHer2oLF0mnQppBgZnga/ jwUw== X-Forwarded-Encrypted: i=1; AJvYcCWf0Zy+gIaSxqpkJnPXP0v4M1PFRkliFyQzcv0UdCDqCXqfCMcIumxI5zjFvhQ/rpSlj+3Q2PnuIDA+gzA=@vger.kernel.org X-Gm-Message-State: AOJu0YxqKSAm5SuwFKtnGoTxpI/PrsxvcbEjQL41WjT395Gdw64k0gn3 nFx91Vk/T9oop3bdnKoQ255zKlNhGAbVP7FBwZLyHkYaRnqeSWaX2qWY6M4bz2A6Lgs= X-Gm-Gg: ASbGnct+xfDM4edm5AFKqcEF34VN09dUAkhL9L0mw9TDi8qeiSfFAUhPLAUGKgTbcdm Sc4d0tg1Y8IRJS9SGN3/JpLwiLO2WLvbvPEjPMfnxSJiDez4wO+F050OAQwyEu65iMoHAiuKLwb qJlqi8Q5tBvZGRaVO9mrRQo2KwC/hRueCcJjIVzpF4Nt9/KVZAlnzIuQX3qmirPvq4dUd5fnHg9 v0WPgd30LF3EdW1TsOpJAr1HogvmI5oaZ1crSfkPC4JBg9s3QORk7VFkAHqRsofezB792unUbId cgM47AVp8VAMDUD4zQQISydZGofqnisocc7HCJymeBr7M+08WIcwxQYEiIvqUfhfLvZgWYadE+T z9A2Dm/k= X-Google-Smtp-Source: AGHT+IG3Ci8gKkZTNURWKOCr4Gya8iUahrzHV+bC1Sl6TvVnxfZLPGWzu66llvg0ow/aQlaOFzwp3g== X-Received: by 2002:a5d:5846:0:b0:3a4:bafb:adc0 with SMTP id ffacd0b85a97d-3a4cb47b7abmr1811022f8f.31.1748071851019; Sat, 24 May 2025 00:30:51 -0700 (PDT) Received: from gpeter-l.roam.corp.google.com ([212.105.145.168]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3ca066eb7sm10924273f8f.2.2025.05.24.00.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 00:30:50 -0700 (PDT) From: Peter Griffin Date: Sat, 24 May 2025 08:30:29 +0100 Subject: [PATCH 1/2] arm64: dts: exynos: gs101: Add 'local-timer-stop' to cpuidle nodes 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: <20250524-gs101-cpuidle-v1-1-aea77a7842a6@linaro.org> References: <20250524-gs101-cpuidle-v1-0-aea77a7842a6@linaro.org> In-Reply-To: <20250524-gs101-cpuidle-v1-0-aea77a7842a6@linaro.org> To: =?utf-8?q?Andr=C3=A9_Draszik?= , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Krzysztof Kozlowski Cc: William Mcvicker , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Peter Griffin , Will Deacon , Youngmin Nam X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2028; i=peter.griffin@linaro.org; h=from:subject:message-id; bh=YOBJe4JQl9jqFc/zsJIf4PxMvh4EMREF5cXBQbIBA7Y=; b=owEBbQKS/ZANAwAKAc7ouNYCNHK6AcsmYgBoMXWmsxp9Uy82tClf5s61NuoYnyaOBZdxLp10l q7TTH3NYf+JAjMEAAEKAB0WIQQO/I5vVXh1DVa1SfzO6LjWAjRyugUCaDF1pgAKCRDO6LjWAjRy unU1D/41OXg9QXtmWQJnnjdXLGulkJ+wCDBdcRAn/wUh2RWSgqGI02bMgMVihzdJcnJOfG03Lp+ vd0CGC1CeypVlnLzTodx/ofUrU0SYY50EDhSOWuA6yDvWXgcDup2GhJ/MRvt/nhjIQneh+9GXOD rlp4sDeeR6pJ9pbI4hCOjzy1RWeFJMuxJR3kZGaGqQiDvvgzTssrQ8aJJTT89IpZoK+I8ooyeKt xD5Pe04SyIDpMLDsZu4x7Evzir+odIOOvKtRBYltVZ6BSfKWvKnj+bdsuleQ1aKZTooZP2uW2yd 4qjuklYJkwWSXKFW6NrexhoCQ3m3TBNBDjaTdf/34gjH6WgafDWNcdkkqsX8kHEgmDnYhYK6nsB cT8AXkiRVkDeFd26OR99bnDq3i08Kb89ctFbCe2kXkvo2eJvkmGehf6cdbSN2LJdgjpZmGHuWcz l2ySFBhvJqaNA49ISF1qiuYfGVBxFqUdXcYNLAOnui5t4CbovkkDOfVsZqlSPIR/vFpNvRhBEhz 45XNa1nnj+I1OK4L273LmA9tu0ckNz9X1pOZ2XLwzGCKywqoaCS7/IiLHosXLV55KaF4qw8VUQ1 xUFN1BBPhlGZK0ubJgKgMV0EbOI6Wsu0aDfhxmuGKvsJHrXhT9Ov7+PeO15/9aECA/bZHxLKEHQ lEnnr4kQ1D4CV5g== X-Developer-Key: i=peter.griffin@linaro.org; a=openpgp; fpr=0EFC8E6F5578750D56B549FCCEE8B8D6023472BA From: Will Deacon In preparation for switching to the architected timer as the primary clockevents device, mark the cpuidle nodes with the 'local-timer-stop' property to indicate that an alternative clockevents device must be used for waking up from the "c2" idle state. Signed-off-by: Will Deacon [Original commit from https://android.googlesource.com/kernel/gs/+/a896fd98= 638047989513d05556faebd28a62b27c] Signed-off-by: Will McVicker Reviewed-by: Youngmin Nam Tested-by: Youngmin Nam Fixes: ea89fdf24fd9 ("arm64: dts: exynos: google: Add initial Google gs101 = SoC support") Signed-off-by: Peter Griffin --- arch/arm64/boot/dts/exynos/google/gs101.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot= /dts/exynos/google/gs101.dtsi index 48c691fd0a3ae430b5d66b402610d23b72b144d7..94aa0ffb9a9760c58818c041700= 1fd187b048ea8 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -155,6 +155,7 @@ ananke_cpu_sleep: cpu-ananke-sleep { idle-state-name =3D "c2"; compatible =3D "arm,idle-state"; arm,psci-suspend-param =3D <0x0010000>; + local-timer-stop; entry-latency-us =3D <70>; exit-latency-us =3D <160>; min-residency-us =3D <2000>; @@ -164,6 +165,7 @@ enyo_cpu_sleep: cpu-enyo-sleep { idle-state-name =3D "c2"; compatible =3D "arm,idle-state"; arm,psci-suspend-param =3D <0x0010000>; + local-timer-stop; entry-latency-us =3D <150>; exit-latency-us =3D <190>; min-residency-us =3D <2500>; @@ -173,6 +175,7 @@ hera_cpu_sleep: cpu-hera-sleep { idle-state-name =3D "c2"; compatible =3D "arm,idle-state"; arm,psci-suspend-param =3D <0x0010000>; + local-timer-stop; entry-latency-us =3D <235>; exit-latency-us =3D <220>; min-residency-us =3D <3500>; --=20 2.49.0.1151.ga128411c76-goog From nobody Fri Dec 19 16:03:18 2025 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AD181DF996 for ; Sat, 24 May 2025 07:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748071857; cv=none; b=JocADR32O6qgZ8ezUXYRGUP4nl7k1CCnOGnQNordtC5EIUdBlw/byMH2wC/qfW/HpGIQX0TPm+2MhrewKL8xADEDuNVDhFEeN3J8SXKA+/sLD/cHimmMl/qLOv80ugdGtHoKuagup9AkYtF9HtpP3c4AuTbJ/VrtmHC5VrP2zjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748071857; c=relaxed/simple; bh=7U9tlCoZc/rOj7EH40BDPDvRFAVAP6sWxjfHvLHGmLE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HojFT5KIBiAW4Gm9ASQukjjR34oeWkMYu+R6WZfT0q8sI0t6rITkbLt7Boozfiapc3UhjYkN05ZfdyB//Yse+Xmg48mc4cNoQ4WXy/LWeL5vFne30uRgwkzTASW4Dohb7nu88R7pfCR5Qm8aYICZevmnRV1SHCO0PmMIvAglDFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Xj21y3bU; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Xj21y3bU" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3a376ba6f08so326924f8f.1 for ; Sat, 24 May 2025 00:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1748071853; x=1748676653; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dpN965PXtFApJwEIkCDxa4SlX4t9L4NYatiQcXWo3sM=; b=Xj21y3bUkrs1ySK8AguOh0zH6cDlXJovXslBY1ZKJF8tcQ5+db9W4Uk5j+Dzy3Dct4 JTBuqEvA96pVLzgoJOwQYX6KHDOXTEOrKTZhB0c/b6j4YCn+S7oIhBft8NW+FzbWz8Pg vM3l+t5XUneiJzm4cTYivaLwp3Dkd8oFubRWzypMgt1gtxXX2Rh1MZmwDJ5xZ8wlf6zu ys2Dx+mM0aYhMv3iGL+ZXFHSD1lyBOR5lMRpreEQhFldBtvepaQIHeFtXqrjF9AVIEXZ OKAhgM5xB8RhdjU6tLUh4PdCVpPy2fRPFqpSYB9pR87KrJxEa4T0a/qLn4KncU5x1wXi 4SNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748071853; x=1748676653; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dpN965PXtFApJwEIkCDxa4SlX4t9L4NYatiQcXWo3sM=; b=wZxrWAeB904Ba2OigSIlIZWVp4eeWU5t0fkJmdGa7QkHzULoKMGkmNsm3zNL9bG9QC oIIBzTvtEgmAcukrbCjgW6MVFJjI7vjOO2JauiWZHodMMvhtxpRT/iFbKky4gLe0ee5+ Bita4LcokPUqoWfrBi6cRNDXQkVHScQJzyyRIM7UH7WgcsuCzd5YJBT9KuRssnTO5Mtq IxTXG5SiwFRhMcIXyM6vGLyuKQsinteUWQLkfJ6zzvnKumiW8YIh8ve5OcqZkEVl2mWZ SxPqRScRig0i4KvqCuRu6uMSd0vT78ryjidc+dKVd0pDaFOe22vxXaFQIoJ8lXetO91+ qjqg== X-Forwarded-Encrypted: i=1; AJvYcCVU8bIIPcdWXByKiztIgGsD0/yN2V7CJkwfPlUVmvmN4AxoJFlEV24yH/bse8lvsU9zpjyzqT1lHxpfBzU=@vger.kernel.org X-Gm-Message-State: AOJu0YzFCbTmyCK8rgKA0KBIG5/1daiIHAr7fcPojlzuHNGHuiEQrduD hSiEXeVwArOBPlCQRvtIAwBHiu+BhuzmzzXRSaYADJREvj/Z14+YooZ4A+XQfLsT4Hc= X-Gm-Gg: ASbGncu2aYOHnXkQwOf7LnVRSKEY2pDGeHHCo61l1dhxwXtqRrlR+XnP0GrbIQVkVOZ iNVtQF7hUolkdG7xZKsnZJ/HVnnKLlxfrfZuEm1RatWNQ3L0QNsQeLlxPAqtRtZFAURQfcoUGSL Aw7aP/QIFVLOUd+jH0plU/SPwzRWBjA7az6l66oaSCv2isK50kFqAfyVWPp5I8p0EE7GL9ieVtK 2Rp74243lieDG1loma/SN6khrsiOvzvaa607goR+Sj2LAY1ZA20Z1QHUGckBOro13XWlr2RcUB8 MYT4xPA08jiqP8pCnPsrkmejPbqEmfrEw8ZzvPkHRc6hVWgw3A7sKgO4iWJ5z9ETDO3dKODDX3y iu3oczCg= X-Google-Smtp-Source: AGHT+IF0wVjcuoZd4VTJ0sGnuwAU+9jQIdeBlKfJuU5uEJZ08QXI5uRMh7/aqwevs21KvTC+SndKRA== X-Received: by 2002:a05:6000:2890:b0:391:23de:b19a with SMTP id ffacd0b85a97d-3a4cb464885mr1858085f8f.31.1748071852553; Sat, 24 May 2025 00:30:52 -0700 (PDT) Received: from gpeter-l.roam.corp.google.com ([212.105.145.168]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3ca066eb7sm10924273f8f.2.2025.05.24.00.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 May 2025 00:30:52 -0700 (PDT) From: Peter Griffin Date: Sat, 24 May 2025 08:30:30 +0100 Subject: [PATCH 2/2] soc: samsung: exynos-pmu: Enable CPU Idle for gs101 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: <20250524-gs101-cpuidle-v1-2-aea77a7842a6@linaro.org> References: <20250524-gs101-cpuidle-v1-0-aea77a7842a6@linaro.org> In-Reply-To: <20250524-gs101-cpuidle-v1-0-aea77a7842a6@linaro.org> To: =?utf-8?q?Andr=C3=A9_Draszik?= , Tudor Ambarus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Krzysztof Kozlowski Cc: William Mcvicker , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Peter Griffin X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6895; i=peter.griffin@linaro.org; h=from:subject:message-id; bh=7U9tlCoZc/rOj7EH40BDPDvRFAVAP6sWxjfHvLHGmLE=; b=owEBbQKS/ZANAwAKAc7ouNYCNHK6AcsmYgBoMXWmtDVOeQQo+H2c8AvBH76fkztXnDVtGuqHJ H/MOqEBp7iJAjMEAAEKAB0WIQQO/I5vVXh1DVa1SfzO6LjWAjRyugUCaDF1pgAKCRDO6LjWAjRy uvt+D/0bEVtxwCaxiKJJL5LsmcMbQ09zGgPLJNXhqcCbb4XRLAVXkYKJnwc/7SC54L78zeTcBmS sVdtvXO2LLihhhB4gE/dZrdoL6DFKdfv+p7EWTWY39yAluPT8Ws9dyu60bmSnwtETaB5TvRORLr CVpi1KXEZFqcLRd76WdwhOC3TfZGZdKTlfSQoVISIYZY30N1svryxaDJ0jtyVJ9yq4bmGGg6yNb r6LsXie6JJH/SL2iCEDXGj6JoNT+cbicc5ezR22b+edZqR16pQufrH1sDH1jDTnmmboNUHnYDzC fSI3li6BxlMIgZ4Tge/XxCGIQ1OcK1G3+nV9hoxZM0AkQ65EQ/mY14m1e1zYl7rVHXTC4UAqIce ab9dpeA/rDq/7AXDV05Rt8Qrp60mvG//C+R7tp+MyEv/cofB6mydmzHb2H/PdlZwhk7a2I1fMY0 kf15KNkn87hfj9rZZmqXMAdMORi5G44moutqZKAJ4ZR9vuXN4to1tTl2QoccSM7w0eMK3lnMH8U 4lvxY++hVNk6J9uWZd5nmql7NqnfqaXKRXU72FRvSsoOS0tN6Uvlc2PuAkXpNx83FbV8obI6J+V Bgqtlt24gLXBORP35mOAIFPwUyshxgEdlzr8g5+QrqtFVNSjwWEONlnxDPG1lwRG7N2h9W2Z2ub fXQSh7iXFNUrK4Q== X-Developer-Key: i=peter.griffin@linaro.org; a=openpgp; fpr=0EFC8E6F5578750D56B549FCCEE8B8D6023472BA Register cpu pm notifiers for gs101 which call the gs101_cpu_pmu_online/offline callbacks which in turn program the ACPM hint. This is required to actually enter the idle state. A couple of corner cases are handled, namely when the system is rebooting or suspending we ignore the request. Additionally the request is ignored if the CPU is in CPU hot plug. Note: this patch has a runtime dependency on adding 'local-timer-stop' dt property to the CPU nodes. This informs the time framework to switch to a broadcast timer as the local timer will be shutdown. Without that DT property specified the system hangs in early boot with this patch applied. Signed-off-by: Peter Griffin --- drivers/soc/samsung/exynos-pmu.c | 135 +++++++++++++++++++++++++++++++++++= ++-- 1 file changed, 131 insertions(+), 4 deletions(-) diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-= pmu.c index a77288f49d249f890060c595556708334383c910..314f543d46b82dc3e991a5928fe= a50b81d4f92b7 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include +#include #include =20 #include @@ -35,6 +37,10 @@ struct exynos_pmu_context { const struct exynos_pmu_data *pmu_data; struct regmap *pmureg; struct regmap *pmuintrgen; + spinlock_t cpupm_lock; /* serialization lock */ + bool __percpu *hotplug_ing; + atomic_t sys_suspended; + atomic_t sys_rebooting; }; =20 void __iomem *pmu_base_addr; @@ -336,7 +342,7 @@ EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap_by_phandle); #define CPU_INFORM_CLEAR 0 #define CPU_INFORM_C2 1 =20 -static int gs101_cpuhp_pmu_online(unsigned int cpu) +static int gs101_cpu_pmu_online(unsigned int cpu) { unsigned int cpuhint =3D smp_processor_id(); u32 reg, mask; @@ -358,10 +364,26 @@ static int gs101_cpuhp_pmu_online(unsigned int cpu) return 0; } =20 -static int gs101_cpuhp_pmu_offline(unsigned int cpu) +static int gs101_cpuhp_pmu_online(unsigned int cpu) +{ + gs101_cpu_pmu_online(cpu); + + /* + * Mark this CPU as having finished the hotplug. + * This means this CPU can now enter C2 idle state. + */ + *per_cpu_ptr(pmu_context->hotplug_ing, cpu) =3D false; + + return 0; +} + +static int gs101_cpu_pmu_offline(unsigned int cpu) { u32 reg, mask; - unsigned int cpuhint =3D smp_processor_id(); + unsigned int cpuhint; + + spin_lock(&pmu_context->cpupm_lock); + cpuhint =3D smp_processor_id(); =20 /* set cpu inform hint */ regmap_write(pmu_context->pmureg, GS101_CPU_INFORM(cpuhint), @@ -379,16 +401,89 @@ static int gs101_cpuhp_pmu_offline(unsigned int cpu) regmap_read(pmu_context->pmuintrgen, GS101_GRP1_INTR_BID_UPEND, ®); regmap_write(pmu_context->pmuintrgen, GS101_GRP1_INTR_BID_CLEAR, reg & mask); + + spin_unlock(&pmu_context->cpupm_lock); + return 0; +} + +static int gs101_cpuhp_pmu_offline(unsigned int cpu) +{ + /* + * Mark this CPU as entering hotplug. So as not to confuse + * ACPM the CPU entering hotplug should not enter C2 idle state. + */ + *per_cpu_ptr(pmu_context->hotplug_ing, cpu) =3D true; + + gs101_cpu_pmu_offline(cpu); + return 0; } =20 +static int gs101_cpu_pm_notify_callback(struct notifier_block *self, + unsigned long action, void *v) +{ + int cpu =3D smp_processor_id(); + + switch (action) { + case CPU_PM_ENTER: + /* + * Ignore CPU_PM_ENTER event in reboot or + * suspend sequence. + */ + + if (atomic_read(&pmu_context->sys_suspended) || + atomic_read(&pmu_context->sys_rebooting)) + return NOTIFY_OK; + + if (*per_cpu_ptr(pmu_context->hotplug_ing, cpu)) + return NOTIFY_BAD; + + gs101_cpu_pmu_offline(cpu); + + break; + case CPU_PM_EXIT: + + if (atomic_read(&pmu_context->sys_rebooting)) + return NOTIFY_OK; + + gs101_cpu_pmu_online(cpu); + + break; + } + + return NOTIFY_OK; +} + +static struct notifier_block gs101_cpu_pm_notifier =3D { + .notifier_call =3D gs101_cpu_pm_notify_callback, + .priority =3D INT_MAX /* we want to be called first */ +}; + +static int exynos_cpupm_reboot_notifier(struct notifier_block *nb, + unsigned long event, void *v) +{ + switch (event) { + case SYS_POWER_OFF: + case SYS_RESTART: + atomic_set(&pmu_context->sys_rebooting, 1); + break; + } + + return NOTIFY_OK; +} + +static struct notifier_block exynos_cpupm_reboot_nb =3D { + .priority =3D INT_MAX, + .notifier_call =3D exynos_cpupm_reboot_notifier, +}; + static int exynos_pmu_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; struct regmap_config pmu_regmcfg; struct regmap *regmap; struct resource *res; - int ret; + int ret, cpu; =20 pmu_base_addr =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pmu_base_addr)) @@ -444,6 +539,12 @@ static int exynos_pmu_probe(struct platform_device *pd= ev) */ dev_warn(&pdev->dev, "pmu-intr-gen syscon unavailable\n"); } else { + pmu_context->hotplug_ing =3D alloc_percpu(bool); + + /* set PMU to power on */ + for_each_online_cpu(cpu) + gs101_cpuhp_pmu_online(cpu); + cpuhp_setup_state(CPUHP_BP_PREPARE_DYN, "soc/exynos-pmu:prepare", gs101_cpuhp_pmu_online, NULL); @@ -451,6 +552,12 @@ static int exynos_pmu_probe(struct platform_device *pd= ev) cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "soc/exynos-pmu:online", NULL, gs101_cpuhp_pmu_offline); + + cpu_pm_register_notifier(&gs101_cpu_pm_notifier); + spin_lock_init(&pmu_context->cpupm_lock); + atomic_set(&pmu_context->sys_rebooting, 0); + atomic_set(&pmu_context->sys_suspended, 0); + register_reboot_notifier(&exynos_cpupm_reboot_nb); } } =20 @@ -471,10 +578,30 @@ static int exynos_pmu_probe(struct platform_device *p= dev) return 0; } =20 +static int exynos_cpupm_suspend_noirq(struct device *dev) +{ + atomic_set(&pmu_context->sys_suspended, 1); + return 0; +} + +static int exynos_cpupm_resume_noirq(struct device *dev) +{ + atomic_set(&pmu_context->sys_suspended, 0); + return 0; +} + +static const struct dev_pm_ops cpupm_pm_ops =3D { + .suspend_noirq =3D exynos_cpupm_suspend_noirq, + .resume_noirq =3D exynos_cpupm_resume_noirq, +}; + static struct platform_driver exynos_pmu_driver =3D { .driver =3D { .name =3D "exynos-pmu", .of_match_table =3D exynos_pmu_of_device_ids, +#ifdef CONFIG_PM_SLEEP + .pm =3D &cpupm_pm_ops, +#endif }, .probe =3D exynos_pmu_probe, }; --=20 2.49.0.1151.ga128411c76-goog