pch_console_write was calling:

    local_irq_save()
        spin_lock(a)
        spin_lock(b)
        ...
        spin_unlock(b)
        spin_unlock(a)
    local_irq_restore()

Which trips the rtmutex debug code:

BUG: sleeping function called from invalid context at kernel/rtmutex.c:646

Update the function to use the _nort versions of local_irq* (thanks Peterz for
the suggestion).

    local_irq_save_nort()
        spin_lock(a)
        spin_lock(b)
        ...
        spin_unlock(b)
        spin_unlock(a)
    local_irq_restore_nort()

Signed-off-by: Darren Hart <dvh...@linux.intel.com>
CC: Tomoya MORINAGA <tomoya.r...@gmail.com>
CC: Feng Tang <feng.t...@intel.com>
CC: Alexander Stein <alexander.st...@systec-electronic.com>
CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>
CC: Alan Cox <a...@linux.intel.com>
CC: Steven Rostedt <rost...@goodmis.org>
CC: Peter Zijlstra <pet...@infradead.org>
CC: linux-ser...@vger.kernel.org
---
 drivers/tty/serial/pch_uart.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index db61d00..9164cef 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1489,7 +1489,7 @@ pch_console_write(struct console *co, const char *s, 
unsigned int count)
 
        touch_nmi_watchdog();
 
-       local_irq_save(flags);
+       local_irq_save_nort(flags);
        spin_lock(&priv->lock);
        if (priv->port.sysrq) {
                /* serial8250_handle_port() already took the lock */
@@ -1519,7 +1519,7 @@ pch_console_write(struct console *co, const char *s, 
unsigned int count)
        if (locked)
                spin_unlock(&priv->port.lock);
        spin_unlock(&priv->lock);
-       local_irq_restore(flags);
+       local_irq_restore_nort(flags);
 
 }
 
-- 
1.7.5.4

_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to