[PATCH RFC] hrtimer: support hrtimer suspend when CPU suspend
From: Wang Qing
Date: Mon Jun 21 2021 - 04:05:22 EST
When the CPU suspend, in order to achieve a more power-saving effect,
it is hoped that the CPU sleeps as long as possible, but the timer is an
important reason for the CPU to wake up.
In some cases, when the CPU suspend, the timer doesn’t have to work either,
such as watchdog hrtimer. The maximum suspend time of the CPU is 4s if enable
lockup detector, which is unacceptable on some products, and in fact, watchdog
timer can suspend when the cpu suspend.
This is a patch for comments, I'm not sure if there any ill-considerations.
If this feature is really needed, I will continue to develop.
Signed-off-by: Wang Qing <wangqing@xxxxxxxx>
---
include/linux/hrtimer.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index bb5e7b0..6d8e4f3
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -112,6 +112,7 @@ enum hrtimer_restart {
* @is_soft: Set if hrtimer will be expired in soft interrupt context.
* @is_hard: Set if hrtimer will be expired in hard interrupt context
* even on RT.
+ * @allow_suspend: Set if hrtimer will suspend when CPU suspend
*
* The hrtimer structure must be initialized by hrtimer_init()
*/
@@ -124,6 +125,7 @@ struct hrtimer {
u8 is_rel;
u8 is_soft;
u8 is_hard;
+ u8 allow_suspend;
};
/**
--
2.7.4