From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-embedded-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [Patch] Wait for console to become available, ver 3
Date: Mon, 20 Apr 2009 15:14:00 -0700 [thread overview]
Message-ID: <20090420151400.11afd62a.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0904201744410.6832-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
On Mon, 20 Apr 2009 17:51:16 -0400 (EDT)
Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org> wrote:
> On Mon, 20 Apr 2009, Andrew Morton wrote:
>
> > If we want b) then how to do it?
> >
> > One possibility: the initcalls have been completed when init_post() is
> > called. How about: if one of those initcalls will be asynchronously
> > registering a console, it should inform the console layer about this.
> > It should call the new i_will_be_adding_a_console_soon() function
> > within its initcall. The console subsystem will remember this, and we
> > can cause init_post() to block until that registration has occurred.
> >
> > We'll need to be able to handle errors, and we'll need to be able to
> > handle the case where the initcall function isn't sure whether or not
> > it will be registering a console. So there will also need to be an
> > oops_im_not_adding_a_console_after_all() function, which will withdraw
> > the effects of i_will_be_adding_a_console_soon().
> >
> > Which means that i_will_be_adding_a_console_soon() will need to return
> > a handle for the oops_im_not_adding_a_console_after_all() caller to
> > pass.
> >
> > If init_post() is currently blocked awaiting the arrival of the
> > console, oops_im_not_adding_a_console_after_all() will unblock
> > init_post() if there are no more potential console registrations
> > pending, and inti_post()'s attempt to open a console will fail.
> >
> >
> > Or something like that?
>
> What if a subsystem simply doesn't know in advance whether or not it's
> going to register a console? Or doesn't know when it has finished
> probing all devices (since a new device could be plugged in at any
> time)?
Fix it. It's trivial to make a sub-driver call back into a higher
layer to tell it that it registered a console. Or just do the
i_will_be_adding_a_console_soon()/oops_im_not_adding_a_console_after_all()
calls from the layer which _does_ know.
> Not to mention that this scheme appears more complicated than the one
> it's intended to replace... although it doesn't have any boot-line
> parameters.
It isn't very complicated.
Yes, a boot parameter is "simple" to inplement. But it's ghastly from
a usability POV. Especially if you care about boot times. For how
long do you delay? The user has to experiment with different delays
until he finds the magic number. Then he adds 10% and waits for the
inevitable failure reports to come in.
It's much better to just get it right, even if that makes it more
"complex".
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: dvomlehn@cisco.com, linux-kernel@vger.kernel.org,
linux-embedded@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [Patch] Wait for console to become available, ver 3
Date: Mon, 20 Apr 2009 15:14:00 -0700 [thread overview]
Message-ID: <20090420151400.11afd62a.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0904201744410.6832-100000@iolanthe.rowland.org>
On Mon, 20 Apr 2009 17:51:16 -0400 (EDT)
Alan Stern <stern@rowland.harvard.edu> wrote:
> On Mon, 20 Apr 2009, Andrew Morton wrote:
>
> > If we want b) then how to do it?
> >
> > One possibility: the initcalls have been completed when init_post() is
> > called. How about: if one of those initcalls will be asynchronously
> > registering a console, it should inform the console layer about this.
> > It should call the new i_will_be_adding_a_console_soon() function
> > within its initcall. The console subsystem will remember this, and we
> > can cause init_post() to block until that registration has occurred.
> >
> > We'll need to be able to handle errors, and we'll need to be able to
> > handle the case where the initcall function isn't sure whether or not
> > it will be registering a console. So there will also need to be an
> > oops_im_not_adding_a_console_after_all() function, which will withdraw
> > the effects of i_will_be_adding_a_console_soon().
> >
> > Which means that i_will_be_adding_a_console_soon() will need to return
> > a handle for the oops_im_not_adding_a_console_after_all() caller to
> > pass.
> >
> > If init_post() is currently blocked awaiting the arrival of the
> > console, oops_im_not_adding_a_console_after_all() will unblock
> > init_post() if there are no more potential console registrations
> > pending, and inti_post()'s attempt to open a console will fail.
> >
> >
> > Or something like that?
>
> What if a subsystem simply doesn't know in advance whether or not it's
> going to register a console? Or doesn't know when it has finished
> probing all devices (since a new device could be plugged in at any
> time)?
Fix it. It's trivial to make a sub-driver call back into a higher
layer to tell it that it registered a console. Or just do the
i_will_be_adding_a_console_soon()/oops_im_not_adding_a_console_after_all()
calls from the layer which _does_ know.
> Not to mention that this scheme appears more complicated than the one
> it's intended to replace... although it doesn't have any boot-line
> parameters.
It isn't very complicated.
Yes, a boot parameter is "simple" to inplement. But it's ghastly from
a usability POV. Especially if you care about boot times. For how
long do you delay? The user has to experiment with different delays
until he finds the magic number. Then he adds 10% and waits for the
inevitable failure reports to come in.
It's much better to just get it right, even if that makes it more
"complex".
next prev parent reply other threads:[~2009-04-20 22:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 21:31 [Patch] Wait for console to become available, ver 3 David VomLehn
2009-04-17 21:31 ` David VomLehn
2009-04-17 22:15 ` H. Peter Anvin
2009-04-17 23:12 ` David VomLehn
2009-04-20 21:30 ` Andrew Morton
2009-04-20 21:51 ` Alan Stern
2009-04-20 21:51 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.0904201744410.6832-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-20 22:14 ` Andrew Morton [this message]
2009-04-20 22:14 ` Andrew Morton
[not found] ` <20090420151400.11afd62a.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2009-04-20 22:35 ` David VomLehn
2009-04-20 22:35 ` David VomLehn
[not found] ` <20090420223500.GB11068-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-20 22:50 ` Andrew Morton
2009-04-20 22:50 ` Andrew Morton
2009-04-20 23:23 ` David VomLehn
2009-04-20 22:53 ` Greg KH
2009-04-20 22:53 ` Greg KH
2009-04-20 22:29 ` David VomLehn
2009-04-20 22:29 ` David VomLehn
[not found] ` <20090420222948.GA11068-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-20 22:35 ` Andrew Morton
2009-04-20 22:35 ` Andrew Morton
2009-04-25 8:16 ` Pavel Machek
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=20090420151400.11afd62a.akpm@linux-foundation.org \
--to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=linux-embedded-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.