Query Regarding init block up due to tty_wait_until_sent

From: Kohli, Gaurav
Date: Mon Mar 05 2018 - 06:37:01 EST


Hi,

We have seen few instances, where init is getting blocked due to wait in below call:

-002|schedule()
-003|schedule_timeout() -> timeout for 30 seconds
-004|tty_wait_until_sent()
-005|tty_port_close_start.part.3()
-006|tty_port_close()
-007|uart_close()
-008|tty_name(inline)
-008|tty_release()
-009|__fput()
-010|____fput()
-011|task_work_run()
-012|do_notify_resume()
-013|work_pending(asm)
---|end of frame

When i have checked the data structures, it seems there is pending data available in buffer, but uart_port got seems to free.

(struct uart_state *)0xFFFFFFC3EDCE4000 = 0xFFFFFFC3EDCE4000 -> (
port = (
buf = (head = 0xFFFFFFC3E772BC80, work = (data = (counter = 1024), entry = (next = 0xFFFFFFC3EDCE4010, prev = 0xFFFFFFC3E
tty = 0xFFFFFFC3E772C280,
itty = 0xFFFFFFC3E772C280,
ops = 0xFFFFFF89D3E7EBB0,
lock = (rlock = (raw_lock = (owner = 3, next = 3), magic = 3735899821, owner_cpu = 4294967295, owner = 0xFFFFFFFFFFFFFFFF
blocked_open = 0,
count = 0,
open_wait = (lock = (rlock = (raw_lock = (owner = 0, next = 0), magic = 3735899821, owner_cpu = 4294967295, owner = 0xFFF
delta_msr_wait = (lock = (rlock = (raw_lock = (owner = 0, next = 0), magic = 3735899821, owner_cpu = 4294967295, owner =
flags = 0,
iflags = 5,
console = 1,
low_latency = 0,
mutex = (count = (counter = 1), wait_lock = (rlock = (raw_lock = (owner = 4, next = 4), magic = 3735899821, owner_cpu = 4
buf_mutex = (count = (counter = 1), wait_lock = (rlock = (raw_lock = (owner = 0, next = 0), magic = 3735899821, owner_cpu
xmit_buf = 0x0,
close_delay = 50,
closing_wait = 3000,
drain_delay = 0,
kref = (refcount = (counter = 1))),
pm_state = UART_PM_STATE_ON = 0x0,
xmit = (buf = 0xFFFFFFC3E7507000, head = 1, tail = 0),
refcount = (counter = 1),
remove_wait = (lock = (rlock = (raw_lock = (owner = 0, next = 0), magic = 3735899821, owner_cpu = 4294967295, owner = 0xFFF
uart_port = 0xFFFFFF89D58582A0 -> (
lock = (rlock = (raw_lock = (owner = 604, next = 604), magic = 3735899821, owner_cpu = 4294967295, owner = 0xFFFFFFFFFFFF
iobase = 0,
membase = 0xFFFFFF800C7C4000,
serial_in = 0x0,
serial_out = 0x0,
set_termios = 0x0,
So in that case write of data won't be possible, So to avoid that do we have to reduce timeout which seems high in current case.
And how can we avoid this if data is available in tty, but uart_port seems to be free.

Please let me know, In case further info is required.

Regards
Gaurav

--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.