From 44fcbe837a879d226988ebeb77be2c69005fcc85 Mon Sep 17 00:00:00 2001 From: Raghavendra Rao Ananta Date: Tue, 4 Jun 2019 23:15:14 -0700 Subject: [PATCH] hvc_dcc: Disable preemption when cheking for smp_processor_id smp_processor_id() complains if called from a preemptible context. Hence, disable the preemption just before calling this and enable it back later. Change-Id: I6721796d11186eb15021b37d5ea8250afa0edda0 Signed-off-by: Raghavendra Rao Ananta --- drivers/tty/hvc/hvc_dcc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c index 041a9fdc7a18..7a86308b4dfc 100644 --- a/drivers/tty/hvc/hvc_dcc.c +++ b/drivers/tty/hvc/hvc_dcc.c @@ -72,12 +72,18 @@ static bool hvc_dcc_check(void) static bool dcc_core0_available; + preempt_disable(); + /* * If we're not on core 0, but we previously confirmed that DCC is * active, then just return true. */ - if (smp_processor_id() && dcc_core0_available) + if (smp_processor_id() && dcc_core0_available) { + preempt_enable(); return true; + } + + preempt_enable(); /* Write a test character to check if it is handled */ __dcc_putchar('\n');