From: Ingo Molnar <mingo@elte.hu>
To: Jamie Lokier <jamie@shareable.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
David VomLehn <dvomlehn@cisco.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux USB Mailing List <linux-usb@vger.kernel.org>,
Linux Embedded Mailing List <linux-embedded@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Wait for console to become available, v3.2
Date: Tue, 21 Apr 2009 16:26:27 +0200 [thread overview]
Message-ID: <20090421142627.GA18129@elte.hu> (raw)
In-Reply-To: <20090421140533.GA6375@shareable.org>
* Jamie Lokier <jamie@shareable.org> wrote:
> Ingo Molnar wrote:
> > * Arjan van de Ven <arjan@infradead.org> wrote:
> > > But more importantly... USB *CANNOT* do this fundamental
> > > operation. USB does not have the capability to know when you have
> > > seen all devices that are connected. Devices just show up a random
> > > amount of time after you turn the power on for the bus.... there's
> > > no "and now we've seen all" operation.
> >
> > Yes - and this is fundamentally true of any hotplug bus design.
>
> It's not fundamental, for devices you know are plugged in at boot.
> All it takes is for the bus to support a synchronous "enumerate
> all" procedure. That _could_ involve a timeout, but there are
> better ways. But not for USB.
>
> > What i'm saying is: instead of "wait 2000 msecs, maybe it works
> > out" hack, there should be a proper sleep+event based approach
> > to the same. With perhaps a _timeout_ for the "no console
> > arrived" negative case as well. (which timeout can be set to
> > zero in the "I _know_ there's no console around".)
>
> Isn't the proposed code doing exactly that? It sleeps waiting for
> a console, with a timeout of X msecs. If a console arrives before
> that, doesn't it wake immediately?
Yes - except that the timeout is aspecific. I.e. we'll time out even
if the delay happens not due to a device arriving too late (or not
arriving at all), but due to some earlier init step taking an
unexpectedly long time.
> > Do you see the fundamental design difference between the two
> > solutions?
>
> The only difference I see is: If you asked for a USB console, the
> timeout should begin relative to when the USB host driver kicks
> the bus, not the first /dev/console open.
>
> Conceptually the timeout is a USB characteristic, not a generic
> console one.
>
> For other (non-USB) devices which might take a while to
> initialise, it should work as you describe. E.g. an ethernet TCP
> console should register ("i'm trying to give you a console")
> followed by ("got it") or ("failed, carry on without me").
I guess we could live with this one too but still it feels wrong to
me. It would be much better to push the decision to time out into
individual console drivers.
Also, if we end up doing this - the patch, as proposed right now,
appears to add a default 1000 msecs sleep to every __tty_open()
call:
+config PRINTK_CONSOLE_WAIT
+ int "Default number of milliseconds to wait for console device"
+ default 1000
Does this only delay init during a console-less bootup - or are
there other later apps that might trigger the delay?
Ingo
next prev parent reply other threads:[~2009-04-21 14:26 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-20 23:40 Wait for console to become available, v3.2 David VomLehn
2009-04-21 6:43 ` Ingo Molnar
[not found] ` <20090421064346.GB8020-X9Un+BFzKDI@public.gmane.org>
2009-04-21 7:13 ` David Brownell
2009-04-21 8:03 ` Ingo Molnar
2009-04-21 17:11 ` David Woodhouse
2009-04-21 17:29 ` David VomLehn
[not found] ` <20090421172929.GC8251-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-21 17:37 ` Linus Torvalds
2009-04-21 17:59 ` David VomLehn
2009-04-21 17:41 ` David Woodhouse
2009-04-21 17:31 ` Linus Torvalds
[not found] ` <alpine.LFD.2.00.0904211016190.2199-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-21 19:25 ` Alan Cox
2009-04-21 23:17 ` David VomLehn
2009-04-22 8:25 ` Jamie Lokier
2009-04-22 9:11 ` Alan Cox
[not found] ` <20090422101109.7beee3ee-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2009-04-22 10:39 ` Jamie Lokier
2009-04-21 13:35 ` Arjan van de Ven
[not found] ` <20090421063549.3b71881d-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2009-04-21 13:50 ` Ingo Molnar
[not found] ` <20090421135034.GA30114-X9Un+BFzKDI@public.gmane.org>
2009-04-21 14:05 ` Jamie Lokier
2009-04-21 14:26 ` Ingo Molnar [this message]
[not found] ` <20090421142627.GA18129-X9Un+BFzKDI@public.gmane.org>
2009-04-21 14:37 ` Alan Cox
2009-04-22 8:22 ` Jamie Lokier
2009-04-22 9:13 ` Alan Cox
2009-04-21 16:42 ` David VomLehn
2009-04-21 14:36 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0904211026080.2981-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-21 16:52 ` David VomLehn
2009-04-21 19:09 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0904211457150.3986-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-21 23:08 ` David VomLehn
2009-04-22 15:40 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0904221111320.3405-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-22 20:54 ` David VomLehn
2009-04-22 21:08 ` Alan Cox
2009-04-22 21:24 ` Alan Stern
2009-04-24 0:35 ` David VomLehn
[not found] ` <20090424003555.GA31173-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-24 19:20 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0904241502440.4531-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-24 21:32 ` David VomLehn
2009-04-24 22:19 ` Jamie Lokier
[not found] ` <20090424221951.GC18260-yetKDKU6eevNLxjTenLetw@public.gmane.org>
2009-04-24 23:10 ` David VomLehn
[not found] ` <20090424231013.GA18340-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-25 1:41 ` Jamie Lokier
2009-04-25 3:11 ` Alan Stern
2009-04-26 19:52 ` Jamie Lokier
2009-04-26 21:20 ` Alan Stern
2009-04-26 21:37 ` Jamie Lokier
2009-04-26 22:36 ` Kay Sievers
2009-04-26 23:12 ` Jamie Lokier
2009-04-26 23:23 ` Kay Sievers
2009-04-26 23:46 ` Jamie Lokier
[not found] ` <20090425014152.GD23106-yetKDKU6eevNLxjTenLetw@public.gmane.org>
2009-04-26 17:55 ` David VomLehn
2009-04-22 5:35 ` David VomLehn
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=20090421142627.GA18129@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=dvomlehn@cisco.com \
--cc=hpa@zytor.com \
--cc=jamie@shareable.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).