@@ -170,6 +170,7 @@ void __attribute__ ((weak)) arch_suspend_enable_irqs(void)
*
* This function should be called after devices have been suspended.
*/
+extern bool printk_sync_suspended;
static int suspend_enter(suspend_state_t state, bool *wakeup)
{
char suspend_abort[MAX_SUSPEND_ABORT_LEN];
@@ -218,6 +219,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
}
arch_suspend_disable_irqs();
+ printk_sync_suspended = true;
BUG_ON(!irqs_disabled());
error = syscore_suspend();
@@ -237,6 +239,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
syscore_resume();
}
+ printk_sync_suspended = false;
arch_suspend_enable_irqs();
BUG_ON(irqs_disabled());
@@ -293,6 +293,7 @@ static u32 log_buf_len = __LOG_BUF_LEN;
/* Control whether printing to console must be synchronous. */
static bool __read_mostly printk_sync = false;
+bool printk_sync_suspended = false;
/* Printing kthread for async printk */
static struct task_struct *printk_kthread;
/* When `true' printing thread has messages to print */
@@ -300,7 +301,7 @@ static bool printk_kthread_need_flush_console;
static inline bool can_printk_async(void)
{
- return !printk_sync && printk_kthread;
+ return !printk_sync && !printk_sync_suspended && printk_kthread;
}
/* Return log buffer address */