Any ideas on how to deal with serial port kernel deadlocks (version 4.11.3)??

I’m re-running buildroot using ttyO0 instead of ttyS0 for getty

Here is the log from using ttyS0:

Initializing random number generator… done.

Starting network: ip: RTNETLINK answers: File exists

FAIL

Starting sshd: OK

[ 22.933599] ttyS ttyS0: tty_port_close_start: tty->count = 1 port count = 2

[ 22.941638]

[ 22.941644] ======================================================

[ 22.941648] [ INFO: possible circular locking dependency detected ]

[ 22.941650] 4.11.3 #1 Not tainted

[ 22.941654] -------------------------------------------------------

[ 22.941657] getty/118 is trying to acquire lock:

[ 22.941660] (&port_lock_key){-.-…}, at: [] serial_omap_console_write+0x124/0x164

[ 22.941670]

[ 22.941673] but task is already holding lock:

[ 22.941675] (&(&port->lock)->rlock){-.-…}, at: [] tty_port_close_start.part.0+0x1c/0x194

[ 22.941684]

[ 22.941687] which lock already depends on the new lock.

[ 22.941689]

[ 22.941691]

[ 22.941695] the existing dependency chain (in reverse order) is:

[ 22.941696]

[ 22.941698] → #1 (&(&port->lock)->rlock){-.-…}:

[ 22.941708] tty_port_tty_get+0x14/0x40

[ 22.941711] tty_port_default_wakeup+0x8/0x20

[ 22.941714] serial_omap_irq+0x324/0x3cc

[ 22.941717] __handle_irq_event_percpu+0x48/0x3b4

[ 22.941720] handle_irq_event_percpu+0x1c/0x58

[ 22.941723] handle_irq_event+0x38/0x5c

[ 22.941726] handle_level_irq+0xc0/0x154

[ 22.941728] generic_handle_irq+0x20/0x34

[ 22.941731] __handle_domain_irq+0x64/0xe0

[ 22.941734] __irq_svc+0x70/0x98

[ 22.941737] _raw_spin_unlock_irqrestore+0x34/0x44

[ 22.941740] uart_write+0xf4/0x188

[ 22.941743] n_tty_write+0x1b0/0x454

[ 22.941745] tty_write+0x174/0x2c0

[ 22.941748] __vfs_write+0x1c/0x114

[ 22.941751] vfs_write+0xa0/0x168

[ 22.941753] SyS_write+0x3c/0x90

[ 22.941756] ret_fast_syscall+0x0/0x1c

[ 22.941758]

[ 22.941760] → #0 (&port_lock_key){-.-…}:

[ 22.941769] _raw_spin_lock+0x28/0x38

[ 22.941773] serial_omap_console_write+0x124/0x164

[ 22.941775] console_unlock+0x290/0x52c

[ 22.941778] vprintk_emit+0x21c/0x2b0

[ 22.941781] vprintk_default+0x20/0x28

[ 22.941784] printk+0x20/0x30

[ 22.941787] tty_port_close_start.part.0+0x180/0x194

[ 22.941789] tty_port_close+0x28/0x64

[ 22.941792] tty_release+0xf0/0x494

[ 22.941795] __fput+0x84/0x1d4

[ 22.941798] task_work_run+0xc0/0xe4

[ 22.941800] do_work_pending+0xbc/0xc0

[ 22.941803] slow_work_pending+0xc/0x20

[ 22.941805]

[ 22.941808] other info that might help us debug this:

[ 22.941810]

[ 22.941813] Possible unsafe locking scenario:

[ 22.941815]

[ 22.941817] CPU0 CPU1

[ 22.941820] ---- ----

[ 22.941822] lock(&(&port->lock)->rlock);

[ 22.941829] lock(&port_lock_key);

[ 22.941835] lock(&(&port->lock)->rlock);

[ 22.941841] lock(&port_lock_key);

[ 22.941847]

[ 22.941849] *** DEADLOCK ***

[ 22.941851]

[ 22.941854] 3 locks held by getty/118:

[ 22.941856] #0: (&tty->legacy_mutex){+.+.+.}, at: [] tty_release+0x40/0x494

Changing my serial port to ttyO0 didn’t fix anything… Can anybody help me with this problem?