mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eli Billauer <eli@billauer.co.il>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: open() on /dev/tty takes 30 seconds on 2.6.36
Date: Wed, 03 Nov 2010 02:15:04 +0200	[thread overview]
Message-ID: <4CD0A988.4070204@billauer.co.il> (raw)
In-Reply-To: <201011012039.16312.arnd@arndb.de>

Arnd Bergmann wrote:

> Ok, that's certainly modem-manager in the tty_release function, calling
> uart_close, which has this code:
>
>         if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) {
>                 /*
>                  * hack: open-coded tty_wait_until_sent to avoid
>                  * recursive tty_lock
>                  */
>                 long timeout = msecs_to_jiffies(port->closing_wait);
>                 if (wait_event_interruptible_timeout(tty->write_wait,
>                                 !tty_chars_in_buffer(tty), timeout) >= 0)
>                         __uart_wait_until_sent(uport, timeout);
>         }
>
> port->closing_wait gets initialized to 30 seconds, which fits your
> symptom.
>   
I lost you here. Maybe my version is outdated? The most similar thing I 
have is this in tty_port.c, in tty_port_close_start():

    if (test_bit(ASYNCB_INITIALIZED, &port->flags) &&
            port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
        tty_wait_until_sent(tty, port->closing_wait);

I put a printk on invocations of tty_wait_until_sent(), which was called 
like crazy during bootup on behalf of tty1, and then never again after 
boot was completed. I should point out, that during this session, all I 
did was to wait a few minutes and then reboot the computer from the GUI 
login console. So I never logged in. Anyhow, the ttySx ports were opened 
and closed, the same 30 seconds delays, but no call to 
tty_wait_until_sent() until kernel logging was stopped.

> What does "lspci -vvx" show about the
> port? 
It turns out, that the device, to which ttyS1-ttyS3 are attached is a 
soft modem, which doesn't even have drivers for a 64 bits system. There 
is no /dev/ttyS4, which is consistent with the "Couldn't register serial 
port 0000:05:04.0: -28" message. Anyhow, I can't say I understand why 
any serial port was allocated to this modem. But it's not like I 
understand how it should work.

05:04.0 Modem: ALi Corporation SmartLink SmartPCI563 56K Modem (prog-if 
00 [Generic])
    Subsystem: Device 2020:545a
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- 
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 32
    Interrupt: pin A routed to IRQ 16
    Region 0: Memory at fbbff000 (32-bit, non-prefetchable) [size=4K]
    Region 1: I/O ports at be00 [size=256]
    Capabilities: [40] Power Management version 2
        Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Kernel driver in use: serial
00: b9 10 5a 54 07 00 90 02 00 00 03 07 00 20 00 00
10: 00 f0 bf fb 01 be 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 20 20 5a 54
30: 00 00 00 00 40 00 00 00 00 00 00 00 0b 01 00 00

   Eli

-- 
Web: http://www.billauer.co.il


  parent reply	other threads:[~2010-11-03  0:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30  7:47 Eli Billauer
2010-10-30 18:46 ` Andrew Morton
2010-10-30 20:46   ` Arnd Bergmann
2010-10-31  0:20   ` Eli Billauer
2010-10-31  3:36     ` Arnd Bergmann
2010-10-31  6:34       ` James Cloos
2010-10-31 11:36         ` Arnd Bergmann
2010-11-02 10:28           ` Tejun Heo
2010-11-01  1:12       ` Eli Billauer
2010-11-01 19:39         ` Arnd Bergmann
2010-11-01 20:46           ` Alan Cox
2010-11-03  0:15           ` Eli Billauer [this message]
2010-11-03  3:32             ` Arnd Bergmann
2010-11-03 10:34               ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CD0A988.4070204@billauer.co.il \
    --to=eli@billauer.co.il \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome