[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dialog --pause not timing out on serial console (dialog 1.2)

From: Stefan Puiu
Subject: Re: dialog --pause not timing out on serial console (dialog 1.2)
Date: Fri, 16 Jul 2021 13:16:52 +0300

Hi Rich,

On Thu, Jul 15, 2021 at 11:58 PM Rich Coe <rich.coe@elucidbio.com> wrote:
> Hi Stefan,
>     I looked at the linux tty driver, and I was partially correct.
>     TCSETSW is going to wait for the output to drain before setting the
>     new termios attributes.

Thanks for looking this up.

I came to the same conclusion. By checking /proc/`pidof dialog`/stack
I can see it's stuck in tty_wait_until_sent, called from set_termios.
And tty_wait_until_sent seems to wait for !tty_chars_in_buffer(tty),
as far as I can tell. I'm looking at
(I have kernel 3.19.8). It seems to wait before applying any settings.

>     So no carrier or blocked output is going to hang the TCSETSW until
>     the output drains.

Do you think this should show up if checking with stty? Say 'stty -a
-F /dev/ttyS0'?

>     Since this hangs without a terminal attached, the problem is probably
>     some output written to the terminal line before anyone can set CLOCAL.
>     And that's going to prevent any changes to the tty driver until a
>     device is connected.
>     What you'll probably need is 'terminator' to wrap DTR to DCD to make
>     the driver think a terminal is attached when there is none.

I probably need to read a bit on serial ports and consoles. Not sure
what you mean by 'terminator' here.

Thanks for the pointers!

> Rich

reply via email to

[Prev in Thread] Current Thread [Next in Thread]