* [PATCH] allow console drivers to be called early
@ 2004-05-13 22:47 Jesse Barnes
2004-05-14 2:44 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Jesse Barnes @ 2004-05-13 22:47 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 541 bytes --]
This is a simple patch to allow arches to set early_printk_ok if they've
registered console drivers that support early operation. I've got an ia64
specific bit and an sn2 specific bit that I can post for reference if
anyone's interested, but they're pretty straightforward, so I'm just posting
this for comments. The ia64 one just adds a register_early_consoles()
function to the ia64 code that gets called early on in setup_arch. All it
does is call the init routines of console drivers that are setup to do early
printks.
Jesse
[-- Attachment #2: early-printk.patch --]
[-- Type: text/plain, Size: 1081 bytes --]
===== kernel/printk.c 1.37 vs edited =====
--- 1.37/kernel/printk.c Tue May 4 10:48:06 2004
+++ edited/kernel/printk.c Fri May 7 15:01:33 2004
@@ -54,6 +54,7 @@
EXPORT_SYMBOL(console_printk);
int oops_in_progress;
+int early_printk_ok;
/*
* console_sem protects the console_drivers list, and also
@@ -526,7 +527,7 @@
log_level_unknown = 1;
}
- if (!cpu_online(smp_processor_id()) &&
+ if (!early_printk_ok && !cpu_online(smp_processor_id()) &&
system_state != SYSTEM_RUNNING) {
/*
* Some console drivers may assume that per-cpu resources have
===== include/linux/kernel.h 1.48 vs edited =====
--- 1.48/include/linux/kernel.h Mon Apr 12 10:53:58 2004
+++ edited/include/linux/kernel.h Fri May 7 16:16:49 2004
@@ -107,6 +107,7 @@
}
extern void bust_spinlocks(int yes);
+extern int early_printk_ok; /* If set, console drivers will be called even if the system isn't up yet */
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
extern int panic_on_oops;
extern int system_state; /* See values below */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] allow console drivers to be called early
2004-05-13 22:47 [PATCH] allow console drivers to be called early Jesse Barnes
@ 2004-05-14 2:44 ` Andrew Morton
2004-05-14 3:16 ` Jesse Barnes
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2004-05-14 2:44 UTC (permalink / raw)
To: Jesse Barnes; +Cc: linux-kernel
Jesse Barnes <jbarnes@engr.sgi.com> wrote:
>
> This is a simple patch to allow arches to set early_printk_ok if they've
> registered console drivers that support early operation. I've got an ia64
> specific bit and an sn2 specific bit that I can post for reference if
> anyone's interested, but they're pretty straightforward, so I'm just posting
> this for comments. The ia64 one just adds a register_early_consoles()
> function to the ia64 code that gets called early on in setup_arch. All it
> does is call the init routines of console drivers that are setup to do early
> printks.
>
> ...
> * console_sem protects the console_drivers list, and also
> @@ -526,7 +527,7 @@
> log_level_unknown = 1;
> }
>
> - if (!cpu_online(smp_processor_id()) &&
> + if (!early_printk_ok && !cpu_online(smp_processor_id()) &&
Is it not possible to mark this cpu as being online? It sure seems to be.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] allow console drivers to be called early
2004-05-14 2:44 ` Andrew Morton
@ 2004-05-14 3:16 ` Jesse Barnes
0 siblings, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2004-05-14 3:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton
On Thursday, May 13, 2004 7:44 pm, Andrew Morton wrote:
> > - if (!cpu_online(smp_processor_id()) &&
> > + if (!early_printk_ok && !cpu_online(smp_processor_id()) &&
>
> Is it not possible to mark this cpu as being online? It sure seems to be.
But then we miss out on all the good stuff happening in setup_arch since
smp_processor_id() isn't set in cpu_online_map until smp_prepare_boot_cpu. I
can try upping it in arch code, but iirc, I had problems with that in older
kernels due to the expectations of some of the other CPU upping code. I'll
give it a try again and either give you a good answer or send a more
appropriate patch to David.
Thanks,
Jesse
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-05-14 3:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-13 22:47 [PATCH] allow console drivers to be called early Jesse Barnes
2004-05-14 2:44 ` Andrew Morton
2004-05-14 3:16 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®