2024-02-22 13:12:18 +03:00
|
|
|
From c9bd0e21842e8ec89b2611831a99e9320c38eda5 Mon Sep 17 00:00:00 2001
|
2023-03-15 17:53:05 +03:00
|
|
|
From: Alexey Sheplyakov <asheplyakov@basealt.ru>
|
|
|
|
Date: Mon, 23 May 2022 19:28:59 +0400
|
|
|
|
Subject: [PATCH 608/631] pm: disable all sleep states on Baikal-M based boards
|
|
|
|
|
|
|
|
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 <asheplyakov@basealt.ru>
|
|
|
|
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 <trace/events/power.h>
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#include <linux/moduleparam.h>
|
|
|
|
+#include <linux/of.h>
|
|
|
|
|
|
|
|
#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());
|
|
|
|
}
|
|
|
|
--
|
2024-02-22 13:12:18 +03:00
|
|
|
2.40.1
|
2023-03-15 17:53:05 +03:00
|
|
|
|