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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1653064200; bh=hmePdtQZzZwTbMofF0i/DtQU9lhdZkCxv5YyYLguvcs=; h=Reply-To:In-Reply-To:References:Date:Subject:Cc:To:From: Message-Id; b=XEIjbWhYQ59FnM3CIh+Lr8CVa/KRYChXLKabOkf4ErGwDuPUtEEKAfwQ0mPqNxNF5 vVf0TdD+aGKEZH4gMLjXGKSxDeMnz3siUdHVmVEp+3JG7PXfNCRLtzRmu0Fwo9fPMo BTV/e0Z+Z8XiwY0uacGQtLZXaIdmivqOjJXYKj2Q= Authentication-Results: sas1-c701ea5c66a2.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru From: asheplyakov@yandex.ru To: devel@lists.altlinux.org Date: Fri, 20 May 2022 20:28:35 +0400 Message-Id: <20220520162849.1554351-22-asheplyakov@yandex.ru> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220520162849.1554351-1-asheplyakov@yandex.ru> References: <20220520162849.1554351-1-asheplyakov@yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Vitaly Chikunov , Igor Chudov , Alexey Sheplyakov , Evgeny Sinelnikov Subject: [devel] [PATCH 21/35] pm: disable all sleep states on Baikal-M based boards X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2022 16:30:12 -0000 Archived-At: List-Archive: List-Post: From: Alexey Sheplyakov 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 X-DONTUPSTREAM X-feature-Baikal-M --- kernel/power/suspend.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 6fcdee7e87a5..99298e393d48 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "power.h" @@ -236,6 +237,17 @@ 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")) { + /* 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); } -- 2.32.0