From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 From: Alexey Sheplyakov To: devel-kernel@lists.altlinux.org Date: Wed, 14 Dec 2022 17:18:56 +0400 Message-Id: <20221214131919.681481-9-asheplyakov@basealt.ru> X-Mailer: git-send-email 2.33.5 In-Reply-To: <20221214131919.681481-1-asheplyakov@basealt.ru> References: <20221214131919.681481-1-asheplyakov@basealt.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=A1=D1=82=D0=B0=D0=B2=D1=86=D0=B5=D0=B2?= , =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=A7=D1=83=D0=B4=D0=BE=D0=B2?= , =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A1=D0=B8=D0=BD=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= , =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=A2=D0=B5=D1=80=D1=91=D1=85=D0=B8=D0=BD?= Subject: [d-kernel] [PATCH 09/32] pm: disable all sleep states on Baikal-M based boards X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2022 13:20:11 -0000 X-List-Received-Date: Wed, 14 Dec 2022 13:20:11 -0000 Archived-At: List-Archive: List-Post: These days desktop environments try to put computer into a sleep state after a certain period of inactivity. TF307 board is able to enter a sleep state, however it does *NOT* wakeup via power button or keyboard/mouse. Apparently the only wakeup sources on TF307 board are - Real time clock (RTC) - Ethernet Surprisingly BMC (board management controller) is NOT a wakeup source. Also tp_bmc driver does not use interrupts, and polls the device instead. Perhaps BMC is unable to generate interrupts at all? To avoid the problem disable all sleep states (including s2idle) on Baikal-M systems Signed-off-by: Alexey Sheplyakov X-DONTUPSTREAM X-feature-Baikal-M --- kernel/power/suspend.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index fa3bf161d13f..1a48542ad680 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "power.h" @@ -243,6 +244,18 @@ EXPORT_SYMBOL_GPL(suspend_valid_only_mem); static bool sleep_state_supported(suspend_state_t state) { +#ifdef CONFIG_OF + if (of_device_is_compatible(of_root, "baikal,baikal-m") || + of_device_is_compatible(of_root, "baikal,bm1000")) { + /* XXX: there are no wakeup sources except RTC and Ethernet + * on BE-M1000 based boards. In other words, no way to wakeup + * system via the keyboard or power button. + * Thus even s2idle is unusable on BE-M1000 systems. + */ + pr_info("%s: no useful wakeup sources on Baikal-M", __func__); + return false; + } +#endif return state == PM_SUSPEND_TO_IDLE || (valid_state(state) && !cxl_mem_active()); } -- 2.33.5