* Early printk recent changes.
@ 2007-03-27 14:16 Franck Bui-Huu
2007-03-27 14:31 ` Maciej W. Rozycki
0 siblings, 1 reply; 9+ messages in thread
From: Franck Bui-Huu @ 2007-03-27 14:16 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Linux MIPS List
Hi,
I'm wondering how arch/mips/kernel/early_printk.c is supposed to be used.
I've already an early console that needs some setup before registering
it. In the current context I can't do that anymore. Of course I can do
it once in prom_putchar() but quite frankly I do not see the real
point to make this common for all platforms.
Moreover I used to call setup_early_printk() sooner in my prom setup code.
BTW, it seems some '__init' and '__init_data' are missing...
--
Franck
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Early printk recent changes.
2007-03-27 14:16 Early printk recent changes Franck Bui-Huu
@ 2007-03-27 14:31 ` Maciej W. Rozycki
2007-03-27 15:03 ` Franck Bui-Huu
0 siblings, 1 reply; 9+ messages in thread
From: Maciej W. Rozycki @ 2007-03-27 14:31 UTC (permalink / raw)
To: Franck Bui-Huu; +Cc: Ralf Baechle, Linux MIPS List
Hi,
> I'm wondering how arch/mips/kernel/early_printk.c is supposed to be used.
>
> I've already an early console that needs some setup before registering
> it. In the current context I can't do that anymore. Of course I can do
> it once in prom_putchar() but quite frankly I do not see the real
> point to make this common for all platforms.
>
> Moreover I used to call setup_early_printk() sooner in my prom setup code.
I suppose you do not have to use it. I cannot be satisfied with the
implementation for the use by the DECstation either, so I am going to
revive the old code as soon as I upgrade my setup. ;-) Feel free to use
the old version of arch/mips/dec/prom/console.c as a template.
Don't fix what isn't broken...
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Early printk recent changes.
2007-03-27 14:31 ` Maciej W. Rozycki
@ 2007-03-27 15:03 ` Franck Bui-Huu
2007-03-27 15:38 ` Maciej W. Rozycki
0 siblings, 1 reply; 9+ messages in thread
From: Franck Bui-Huu @ 2007-03-27 15:03 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Ralf Baechle, Linux MIPS List
On 3/27/07, Maciej W. Rozycki <macro@linux-mips.org> wrote:
>
> Don't fix what isn't broken...
>
Well with such advice, Linux would have been stuck to version 0.4 ;)
--
Franck
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Early printk recent changes.
2007-03-27 15:03 ` Franck Bui-Huu
@ 2007-03-27 15:38 ` Maciej W. Rozycki
2007-03-27 16:06 ` Franck Bui-Huu
0 siblings, 1 reply; 9+ messages in thread
From: Maciej W. Rozycki @ 2007-03-27 15:38 UTC (permalink / raw)
To: Franck Bui-Huu; +Cc: Ralf Baechle, Linux MIPS List
On Tue, 27 Mar 2007, Franck Bui-Huu wrote:
> > Don't fix what isn't broken...
> >
>
> Well with such advice, Linux would have been stuck to version 0.4 ;)
Fortunately, there is a feature called "common sense" and it has
prevented a halt from happening. Also I wouldn't be brave enough to claim
any particular version of Linux, nor any other piece of software, is
perfect, though, admittedly, the level of imperfection varies highly
across different versions and pieces.
In this case I gather this was a bulk change and some platforms have
benefited and the DECstation has lost. You seem to have problems as well.
These issues can be dealt with somehow and they do not mean the change was
bad as a whole.
Maciej
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Early printk recent changes.
2007-03-27 15:38 ` Maciej W. Rozycki
@ 2007-03-27 16:06 ` Franck Bui-Huu
2007-03-27 17:57 ` Ralf Baechle
0 siblings, 1 reply; 9+ messages in thread
From: Franck Bui-Huu @ 2007-03-27 16:06 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Ralf Baechle, Linux MIPS List
On 3/27/07, Maciej W. Rozycki <macro@linux-mips.org> wrote:
> On Tue, 27 Mar 2007, Franck Bui-Huu wrote:
>
> > > Don't fix what isn't broken...
> > >
> >
> > Well with such advice, Linux would have been stuck to version 0.4 ;)
>
> Fortunately, there is a feature called "common sense" and it has
> prevented a halt from happening. Also I wouldn't be brave enough to claim
> any particular version of Linux, nor any other piece of software, is
> perfect, though, admittedly, the level of imperfection varies highly
> across different versions and pieces.
>
you did notice the smiley, didn't you ?
> In this case I gather this was a bulk change and some platforms have
> benefited and the DECstation has lost. You seem to have problems as well.
> These issues can be dealt with somehow and they do not mean the change was
> bad as a whole.
I think that's the reason why I started this thread: To see if this
change is good and really woth...
Making a new file 'early_printk' to gather 3 tiny functions. In the
other way we lose the possibilty to register the console earlier, and
we need to make some hacks to configure the console if it needs to be.
I understand that such change is needed by x86 arch but for mips I'm skeptical.
--
Franck
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Early printk recent changes.
2007-03-27 16:06 ` Franck Bui-Huu
@ 2007-03-27 17:57 ` Ralf Baechle
2007-03-28 6:51 ` [PATCH 1/2] early_printk: use init section Franck Bui-Huu
2007-03-28 7:37 ` Early printk recent changes Franck Bui-Huu
0 siblings, 2 replies; 9+ messages in thread
From: Ralf Baechle @ 2007-03-27 17:57 UTC (permalink / raw)
To: Franck Bui-Huu; +Cc: Maciej W. Rozycki, Linux MIPS List
On Tue, Mar 27, 2007 at 06:06:10PM +0200, Franck Bui-Huu wrote:
> > In this case I gather this was a bulk change and some platforms have
> >benefited and the DECstation has lost. You seem to have problems as well.
> >These issues can be dealt with somehow and they do not mean the change was
> >bad as a whole.
>
> I think that's the reason why I started this thread: To see if this
> change is good and really woth...
>
> Making a new file 'early_printk' to gather 3 tiny functions. In the
> other way we lose the possibilty to register the console earlier, and
> we need to make some hacks to configure the console if it needs to be.
>
> I understand that such change is needed by x86 arch but for mips I'm
> skeptical.
I decieded to rush the whole early printk thing since we had several
copies of early printk in the MIPS code already. Add plenty of
variations of prom_putchar / prom_printf. We certainly now have less
loose ends in the code than before. And since we're always in the trade
of better mouse trap I certainly won't object if submits has one :-)
Ralf
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] early_printk: use init section
2007-03-27 17:57 ` Ralf Baechle
@ 2007-03-28 6:51 ` Franck Bui-Huu
2007-03-28 6:51 ` [PATCH 2/2] early_printk: allow the early console to run earlier Franck Bui-Huu
2007-03-28 7:37 ` Early printk recent changes Franck Bui-Huu
1 sibling, 1 reply; 9+ messages in thread
From: Franck Bui-Huu @ 2007-03-28 6:51 UTC (permalink / raw)
To: ralf; +Cc: linux-mips
From: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
arch/mips/kernel/early_printk.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c
index 304efdc..57ba73a 100644
--- a/arch/mips/kernel/early_printk.c
+++ b/arch/mips/kernel/early_printk.c
@@ -12,7 +12,8 @@
extern void prom_putchar(char);
-static void early_console_write(struct console *con, const char *s, unsigned n)
+static void __init
+early_console_write(struct console *con, const char *s, unsigned n)
{
while (n-- && *s) {
if (*s == '\n')
@@ -22,7 +23,7 @@ static void early_console_write(struct console *con, const char *s, unsigned n)
}
}
-static struct console early_console = {
+static struct console early_console __initdata = {
.name = "early",
.write = early_console_write,
.flags = CON_PRINTBUFFER | CON_BOOT,
--
1.5.1.rc1.27.g1d848
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/2] early_printk: allow the early console to run earlier
2007-03-28 6:51 ` [PATCH 1/2] early_printk: use init section Franck Bui-Huu
@ 2007-03-28 6:51 ` Franck Bui-Huu
0 siblings, 0 replies; 9+ messages in thread
From: Franck Bui-Huu @ 2007-03-28 6:51 UTC (permalink / raw)
To: ralf; +Cc: linux-mips
From: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
arch/mips/kernel/early_printk.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/mips/kernel/early_printk.c b/arch/mips/kernel/early_printk.c
index 57ba73a..f68f82f 100644
--- a/arch/mips/kernel/early_printk.c
+++ b/arch/mips/kernel/early_printk.c
@@ -30,8 +30,14 @@ static struct console early_console __initdata = {
.index = -1
};
+static int early_console_initialized __initdata;
+
void __init setup_early_printk(void)
{
+ if (early_console_initialized)
+ return;
+ early_console_initialized = 1;
+
register_console(&early_console);
}
--
1.5.1.rc1.27.g1d848
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: Early printk recent changes.
2007-03-27 17:57 ` Ralf Baechle
2007-03-28 6:51 ` [PATCH 1/2] early_printk: use init section Franck Bui-Huu
@ 2007-03-28 7:37 ` Franck Bui-Huu
1 sibling, 0 replies; 9+ messages in thread
From: Franck Bui-Huu @ 2007-03-28 7:37 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Maciej W. Rozycki, Linux MIPS List
On 3/27/07, Ralf Baechle <ralf@linux-mips.org> wrote:
> loose ends in the code than before. And since we're always in the trade
> of better mouse trap I certainly won't object if submits has one :-)
>
since you agree to consider them, I'll do that shortly.
--
Franck
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-03-28 7:53 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-27 14:16 Early printk recent changes Franck Bui-Huu
2007-03-27 14:31 ` Maciej W. Rozycki
2007-03-27 15:03 ` Franck Bui-Huu
2007-03-27 15:38 ` Maciej W. Rozycki
2007-03-27 16:06 ` Franck Bui-Huu
2007-03-27 17:57 ` Ralf Baechle
2007-03-28 6:51 ` [PATCH 1/2] early_printk: use init section Franck Bui-Huu
2007-03-28 6:51 ` [PATCH 2/2] early_printk: allow the early console to run earlier Franck Bui-Huu
2007-03-28 7:37 ` Early printk recent changes Franck Bui-Huu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox