diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/wakeup_reason.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/wakeup_reason.h b/include/linux/wakeup_reason.h index a26b1c998139..ca6226cc1c55 100644 --- a/include/linux/wakeup_reason.h +++ b/include/linux/wakeup_reason.h @@ -61,16 +61,22 @@ static inline void start_logging_wakeup_reasons(void) { extern bool log_wakeups; extern struct completion wakeups_completion; - log_wakeups = true; + ACCESS_ONCE(log_wakeups) = true; init_completion(&wakeups_completion); } -static inline bool logging_wakeup_reasons(void) +static inline bool logging_wakeup_reasons_nosync(void) { extern bool log_wakeups; return ACCESS_ONCE(log_wakeups); } +static inline bool logging_wakeup_reasons(void) +{ + smp_rmb(); + return logging_wakeup_reasons_nosync(); +} + void log_base_wakeup_reason(int irq); void log_suspend_abort_reason(const char *fmt, ...); |
