All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-06  2:34 ` David VomLehn
  0 siblings, 0 replies; 9+ messages in thread
From: David VomLehn @ 2009-06-06  2:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, linux-usb, greg, linux-scsi, netdev, arjan

Wait for the console device to become available.

History
v6	Changed BOOTDEV_* to INITDEV_*.
v5.1	Corrected call to initdev_register() to be initdev_registered().
v5	Change bootdev_* to initdev_*.
v4	Use new hotplug synchronization infrastructure. Include Braille
	console support.
v3.2	Use only a single new command line parameter by adding the possible
	value "forever".  Add message specifying the parameter to modify to
	increase the delay for console initialization
v3.1	Correct the abbreviation for milliseconds in
	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
	Peter Anvin for this.
v3	Increase the default delay to 1 second and add kernel command line
	parameters to override the default delay. Thanks to David Brownell for
	his helpful suggestions.
v2	Wait for the preferred console rather than any console. Make the
	delay interval a tunable.
v1	Initial version

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
---
 drivers/accessibility/braille/braille_console.c |    2 +
 kernel/printk.c                                 |   29 ++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index d672cfe..6d1693f 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -378,6 +378,8 @@ int braille_register_console(struct console *console, int index,
 	braille_co = console;
 	register_keyboard_notifier(&keyboard_notifier_block);
 	register_vt_notifier(&vt_notifier_block);
+
+	initdev_registered(INITDEV_CONSOLE_TYPE);
 	return 0;
 }
 
diff --git a/kernel/printk.c b/kernel/printk.c
index 5052b54..7cdc91c 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -33,6 +33,7 @@
 #include <linux/bootmem.h>
 #include <linux/syscalls.h>
 #include <linux/kexec.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 
@@ -1075,8 +1076,10 @@ void console_unblank(void)
 
 /*
  * Return the console tty driver structure and its associated index
+ * @index:	Pointer to the device index
+ * Returns NULL if no driver available, otherwise a pointer to the TTY driver.
  */
-struct tty_driver *console_device(int *index)
+struct tty_driver *_console_device(int *index)
 {
 	struct console *c;
 	struct tty_driver *driver = NULL;
@@ -1094,6 +1097,29 @@ struct tty_driver *console_device(int *index)
 }
 
 /*
+ * Returns true if all specific consoles are registered, false otherwise
+ */
+static bool have_all_consoles(void)
+{
+	struct tty_driver *driver;
+	int		index;
+
+	driver = _console_device(&index);
+
+	return driver != NULL;
+}
+
+struct tty_driver *console_device(int *index)
+{
+	struct tty_driver *driver;
+	initdev_wait(INITDEV_CONSOLE_TYPE, have_all_consoles);
+
+	driver = _console_device(index);
+
+	return driver;
+}
+
+/*
  * Prevent further output on the passed console device so that (for example)
  * serial drivers can disable console output before suspending a port, and can
  * re-enable output afterwards.
@@ -1230,6 +1256,7 @@ void register_console(struct console *console)
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 	}
 	release_console_sem();
+	initdev_registered(INITDEV_CONSOLE_TYPE);
 }
 EXPORT_SYMBOL(register_console);
 

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-06  2:34 ` David VomLehn
  0 siblings, 0 replies; 9+ messages in thread
From: David VomLehn @ 2009-06-06  2:34 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, greg-U8xfFu+wG4EAvxtiuMwx3w,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	arjan-wEGCiKHe2LqWVfeAwA7xHQ

Wait for the console device to become available.

History
v6	Changed BOOTDEV_* to INITDEV_*.
v5.1	Corrected call to initdev_register() to be initdev_registered().
v5	Change bootdev_* to initdev_*.
v4	Use new hotplug synchronization infrastructure. Include Braille
	console support.
v3.2	Use only a single new command line parameter by adding the possible
	value "forever".  Add message specifying the parameter to modify to
	increase the delay for console initialization
v3.1	Correct the abbreviation for milliseconds in
	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
	Peter Anvin for this.
v3	Increase the default delay to 1 second and add kernel command line
	parameters to override the default delay. Thanks to David Brownell for
	his helpful suggestions.
v2	Wait for the preferred console rather than any console. Make the
	delay interval a tunable.
v1	Initial version

Signed-off-by: David VomLehn <dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
---
 drivers/accessibility/braille/braille_console.c |    2 +
 kernel/printk.c                                 |   29 ++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index d672cfe..6d1693f 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -378,6 +378,8 @@ int braille_register_console(struct console *console, int index,
 	braille_co = console;
 	register_keyboard_notifier(&keyboard_notifier_block);
 	register_vt_notifier(&vt_notifier_block);
+
+	initdev_registered(INITDEV_CONSOLE_TYPE);
 	return 0;
 }
 
diff --git a/kernel/printk.c b/kernel/printk.c
index 5052b54..7cdc91c 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -33,6 +33,7 @@
 #include <linux/bootmem.h>
 #include <linux/syscalls.h>
 #include <linux/kexec.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 
@@ -1075,8 +1076,10 @@ void console_unblank(void)
 
 /*
  * Return the console tty driver structure and its associated index
+ * @index:	Pointer to the device index
+ * Returns NULL if no driver available, otherwise a pointer to the TTY driver.
  */
-struct tty_driver *console_device(int *index)
+struct tty_driver *_console_device(int *index)
 {
 	struct console *c;
 	struct tty_driver *driver = NULL;
@@ -1094,6 +1097,29 @@ struct tty_driver *console_device(int *index)
 }
 
 /*
+ * Returns true if all specific consoles are registered, false otherwise
+ */
+static bool have_all_consoles(void)
+{
+	struct tty_driver *driver;
+	int		index;
+
+	driver = _console_device(&index);
+
+	return driver != NULL;
+}
+
+struct tty_driver *console_device(int *index)
+{
+	struct tty_driver *driver;
+	initdev_wait(INITDEV_CONSOLE_TYPE, have_all_consoles);
+
+	driver = _console_device(index);
+
+	return driver;
+}
+
+/*
  * Prevent further output on the passed console device so that (for example)
  * serial drivers can disable console output before suspending a port, and can
  * re-enable output afterwards.
@@ -1230,6 +1256,7 @@ void register_console(struct console *console)
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 	}
 	release_console_sem();
+	initdev_registered(INITDEV_CONSOLE_TYPE);
 }
 EXPORT_SYMBOL(register_console);
 
--
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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-06  8:55   ` Stefan Richter
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Richter @ 2009-06-06  8:55 UTC (permalink / raw)
  To: David VomLehn
  Cc: linux-kernel, akpm, linux-usb, greg, linux-scsi, netdev, arjan

David VomLehn wrote:
> Wait for the console device to become available.
> 
> History
> v6	Changed BOOTDEV_* to INITDEV_*.
> v5.1	Corrected call to initdev_register() to be initdev_registered().
> v5	Change bootdev_* to initdev_*.
> v4	Use new hotplug synchronization infrastructure. Include Braille
> 	console support.
> v3.2	Use only a single new command line parameter by adding the possible
> 	value "forever".  Add message specifying the parameter to modify to
> 	increase the delay for console initialization
> v3.1	Correct the abbreviation for milliseconds in
> 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
> 	Peter Anvin for this.
> v3	Increase the default delay to 1 second and add kernel command line
> 	parameters to override the default delay. Thanks to David Brownell for
> 	his helpful suggestions.
> v2	Wait for the preferred console rather than any console. Make the
> 	delay interval a tunable.
> v1	Initial version
> 
> Signed-off-by: David VomLehn <dvomlehn@cisco.com>
> ---
>  drivers/accessibility/braille/braille_console.c |    2 +
>  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
>  2 files changed, 30 insertions(+), 1 deletions(-)

Is this diff complete?
-- 
Stefan Richter
-=====-==--= -==- --==-
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-06  8:55   ` Stefan Richter
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Richter @ 2009-06-06  8:55 UTC (permalink / raw)
  To: David VomLehn
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, greg-U8xfFu+wG4EAvxtiuMwx3w,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	arjan-wEGCiKHe2LqWVfeAwA7xHQ

David VomLehn wrote:
> Wait for the console device to become available.
> 
> History
> v6	Changed BOOTDEV_* to INITDEV_*.
> v5.1	Corrected call to initdev_register() to be initdev_registered().
> v5	Change bootdev_* to initdev_*.
> v4	Use new hotplug synchronization infrastructure. Include Braille
> 	console support.
> v3.2	Use only a single new command line parameter by adding the possible
> 	value "forever".  Add message specifying the parameter to modify to
> 	increase the delay for console initialization
> v3.1	Correct the abbreviation for milliseconds in
> 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
> 	Peter Anvin for this.
> v3	Increase the default delay to 1 second and add kernel command line
> 	parameters to override the default delay. Thanks to David Brownell for
> 	his helpful suggestions.
> v2	Wait for the preferred console rather than any console. Make the
> 	delay interval a tunable.
> v1	Initial version
> 
> Signed-off-by: David VomLehn <dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/accessibility/braille/braille_console.c |    2 +
>  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
>  2 files changed, 30 insertions(+), 1 deletions(-)

Is this diff complete?
-- 
Stefan Richter
-=====-==--= -==- --==-
http://arcgraph.de/sr/
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-08 22:13     ` David VomLehn
  0 siblings, 0 replies; 9+ messages in thread
From: David VomLehn @ 2009-06-08 22:13 UTC (permalink / raw)
  To: Stefan Richter
  Cc: linux-kernel, akpm, linux-usb, greg, linux-scsi, netdev, arjan

On Sat, Jun 06, 2009 at 04:55:09AM -0400, Stefan Richter wrote:
> David VomLehn wrote:
> > Wait for the console device to become available.
> > 
> > History
> > v6	Changed BOOTDEV_* to INITDEV_*.
> > v5.1	Corrected call to initdev_register() to be initdev_registered().
> > v5	Change bootdev_* to initdev_*.
> > v4	Use new hotplug synchronization infrastructure. Include Braille
> > 	console support.
> > v3.2	Use only a single new command line parameter by adding the possible
> > 	value "forever".  Add message specifying the parameter to modify to
> > 	increase the delay for console initialization
> > v3.1	Correct the abbreviation for milliseconds in
> > 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
> > 	Peter Anvin for this.
> > v3	Increase the default delay to 1 second and add kernel command line
> > 	parameters to override the default delay. Thanks to David Brownell for
> > 	his helpful suggestions.
> > v2	Wait for the preferred console rather than any console. Make the
> > 	delay interval a tunable.
> > v1	Initial version
> > 
> > Signed-off-by: David VomLehn <dvomlehn@cisco.com>
> > ---
> >  drivers/accessibility/braille/braille_console.c |    2 +
> >  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
> >  2 files changed, 30 insertions(+), 1 deletions(-)
> 
> Is this diff complete?

To the best of my knowledge, yes, it is complete. What makes it look as though
it might not be?

> Stefan Richter

David VomLehn

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-08 22:13     ` David VomLehn
  0 siblings, 0 replies; 9+ messages in thread
From: David VomLehn @ 2009-06-08 22:13 UTC (permalink / raw)
  To: Stefan Richter
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, greg-U8xfFu+wG4EAvxtiuMwx3w,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	arjan-wEGCiKHe2LqWVfeAwA7xHQ

On Sat, Jun 06, 2009 at 04:55:09AM -0400, Stefan Richter wrote:
> David VomLehn wrote:
> > Wait for the console device to become available.
> > 
> > History
> > v6	Changed BOOTDEV_* to INITDEV_*.
> > v5.1	Corrected call to initdev_register() to be initdev_registered().
> > v5	Change bootdev_* to initdev_*.
> > v4	Use new hotplug synchronization infrastructure. Include Braille
> > 	console support.
> > v3.2	Use only a single new command line parameter by adding the possible
> > 	value "forever".  Add message specifying the parameter to modify to
> > 	increase the delay for console initialization
> > v3.1	Correct the abbreviation for milliseconds in
> > 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
> > 	Peter Anvin for this.
> > v3	Increase the default delay to 1 second and add kernel command line
> > 	parameters to override the default delay. Thanks to David Brownell for
> > 	his helpful suggestions.
> > v2	Wait for the preferred console rather than any console. Make the
> > 	delay interval a tunable.
> > v1	Initial version
> > 
> > Signed-off-by: David VomLehn <dvomlehn-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
> > ---
> >  drivers/accessibility/braille/braille_console.c |    2 +
> >  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
> >  2 files changed, 30 insertions(+), 1 deletions(-)
> 
> Is this diff complete?

To the best of my knowledge, yes, it is complete. What makes it look as though
it might not be?

> Stefan Richter

David VomLehn
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-08 22:30       ` Stefan Richter
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Richter @ 2009-06-08 22:30 UTC (permalink / raw)
  To: David VomLehn
  Cc: linux-kernel, akpm, linux-usb, greg, linux-scsi, netdev, arjan

David VomLehn wrote:
> On Sat, Jun 06, 2009 at 04:55:09AM -0400, Stefan Richter wrote:
>> David VomLehn wrote:
...
>>> v3.2	Use only a single new command line parameter by adding the possible
>>> 	value "forever".  Add message specifying the parameter to modify to
>>> 	increase the delay for console initialization
>>> v3.1	Correct the abbreviation for milliseconds in
>>> 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
...
>>> ---
>>>  drivers/accessibility/braille/braille_console.c |    2 +
>>>  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
>>>  2 files changed, 30 insertions(+), 1 deletions(-)
>> Is this diff complete?
> 
> To the best of my knowledge, yes, it is complete. What makes it look as though
> it might not be?

The history notes.
kernel-parameters.txt, new command line parameter...
-- 
Stefan Richter
-=====-==--= -==- -=--=
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
@ 2009-06-08 22:30       ` Stefan Richter
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Richter @ 2009-06-08 22:30 UTC (permalink / raw)
  To: David VomLehn
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, greg-U8xfFu+wG4EAvxtiuMwx3w,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	arjan-wEGCiKHe2LqWVfeAwA7xHQ

David VomLehn wrote:
> On Sat, Jun 06, 2009 at 04:55:09AM -0400, Stefan Richter wrote:
>> David VomLehn wrote:
...
>>> v3.2	Use only a single new command line parameter by adding the possible
>>> 	value "forever".  Add message specifying the parameter to modify to
>>> 	increase the delay for console initialization
>>> v3.1	Correct the abbreviation for milliseconds in
>>> 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
...
>>> ---
>>>  drivers/accessibility/braille/braille_console.c |    2 +
>>>  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
>>>  2 files changed, 30 insertions(+), 1 deletions(-)
>> Is this diff complete?
> 
> To the best of my knowledge, yes, it is complete. What makes it look as though
> it might not be?

The history notes.
kernel-parameters.txt, new command line parameter...
-- 
Stefan Richter
-=====-==--= -==- -=--=
http://arcgraph.de/sr/
--
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/7] initdev:kernel:Await console discovery, v6
  2009-06-08 22:30       ` Stefan Richter
  (?)
@ 2009-06-08 22:34       ` David VomLehn
  -1 siblings, 0 replies; 9+ messages in thread
From: David VomLehn @ 2009-06-08 22:34 UTC (permalink / raw)
  To: Stefan Richter
  Cc: linux-kernel, akpm, linux-usb, greg, linux-scsi, netdev, arjan

On Tue, Jun 09, 2009 at 12:30:03AM +0200, Stefan Richter wrote:
> David VomLehn wrote:
>> On Sat, Jun 06, 2009 at 04:55:09AM -0400, Stefan Richter wrote:
>>> David VomLehn wrote:
> ...
>>>> v3.2	Use only a single new command line parameter by adding the possible
>>>> 	value "forever".  Add message specifying the parameter to modify to
>>>> 	increase the delay for console initialization
>>>> v3.1	Correct the abbreviation for milliseconds in
>>>> 	Documentation/kernel-parameters.txt to be "ms", not "mS". Thanks to
> ...
>>>> ---
>>>>  drivers/accessibility/braille/braille_console.c |    2 +
>>>>  kernel/printk.c                                 |   29 ++++++++++++++++++++++-
>>>>  2 files changed, 30 insertions(+), 1 deletions(-)
>>> Is this diff complete?
>>
>> To the best of my knowledge, yes, it is complete. What makes it look as though
>> it might not be?
>
> The history notes.
> kernel-parameters.txt, new command line parameter...

Now I understand--you haven't been following this in detail, and there is
no reason why you should have. The history reflects the fact that the
original approach changed completely once Alan Stern let me know that we
really could tell when we have discovered all attached USB devices. It's
still trying to solve the same problem, however, so I kept the history
for continuity.

> Stefan Richter

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-08 22:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-06  2:34 [PATCH 3/7] initdev:kernel:Await console discovery, v6 David VomLehn
2009-06-06  2:34 ` David VomLehn
2009-06-06  8:55 ` Stefan Richter
2009-06-06  8:55   ` Stefan Richter
2009-06-08 22:13   ` David VomLehn
2009-06-08 22:13     ` David VomLehn
2009-06-08 22:30     ` Stefan Richter
2009-06-08 22:30       ` Stefan Richter
2009-06-08 22:34       ` David VomLehn

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.