mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] 2.4.16 kernel/printk.c (per processorinitializationcheck)
@ 2001-12-08 17:36 Manfred Spraul
  0 siblings, 0 replies; 20+ messages in thread
From: Manfred Spraul @ 2001-12-08 17:36 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Alan Cox wrote:
> x86_udelay_tsc wont have been set at that point so the main timer is still
> being used.

No. x86_udelay_tsc is initialized by time_init(), and time_init() is called before
smp_init(). The udelay implementation only multiplies with loops_per_jiffy,
therefore there is no oops on i386.

But could oops if the bios disables the TSC instruction - the first printk on
the secondary cpu happens before

     clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE)

--
    Manfred


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [PATCH] 2.4.16 kernel/printk.c (per processor initializationcheck)
  2001-12-03 10:32   ` j-nomura
@ 2001-12-04  1:45 Andrew Morton
  2001-12-03  9:20 ` [PATCH] 2.4.16 kernel/printk.c (per processor initialization check) Andrew Morton
  0 siblings, 1 reply; 20+ messages in thread
From: Andrew Morton @ 2001-12-04  1:45 UTC (permalink / raw)
  To: j-nomura; +Cc: linux-kernel

j-nomura@ce.jp.nec.com wrote:
> 
> Hi,
> 
> Thank you for commenting.
> 
> From: Andrew Morton <akpm@zip.com.au>
> Subject: Re: [PATCH] 2.4.16 kernel/printk.c (per processor initialization check)
> Date: Mon, 03 Dec 2001 01:20:28 -0800
> 
> > Seems that there is some sort of ordering problem here - someone
> > is calling printk before the MMU is initialised, but after some
> > console drivers have been installed.
> 
> Yes.
> Because smp_init() is later in place than console_init(), printk() can be
> called in such a situation.
> For example, in IA-64, identify_cpu() is called before ia64_mmu_init(),
> while identify_cpu() calls printk() in it.
> I don't think the ordering itself is a problem.
> 
> > I suspect the real fix is elsewhere, but I'm not sure where.
> >
> > Probably a clearer place to put this test would be within
> > printk itself, immediately before the down_trylock.  Does that
> > work?
> 
> The reason I put it in release_console_sem() is that release_console_sem()
> can be called from other functions than printk(), e.g. console_unblank().
> I agree with you that it is clearer but I think it is not sufficient.
> 

I really doubt if any of those paths could be called before
even the MMU is set up.

It seems that the ia64 port has installed some console drivers,
and has then called them before it is ready to do so.  Via printk.

It should not have installed the console drivers that early.  Do
you know what console driver is causing the problem?

If the console driver is not fixable then a more general approach
would be, in printk.c:

#ifndef ARCH_HAS_PRINTK_MAY_BE_USED
#define printk_may_be_used() (1)
#endif

then, in printk() itself:

                if (*p == '\n')
                        log_level_unknown = 1;
        }

+	if (!printk_may_be_used())
+		return printed_len;

        if (!down_trylock(&console_sem)) {
                /*

then, for ia64, give it a printk_may_be_used() function, and
define ARCH_HAS_PRINTK_MAY_BE_USED somewhere.

Or just not install console drivers before they may be safely
used!

-

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

end of thread, other threads:[~2001-12-09  1:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-08 17:36 [PATCH] 2.4.16 kernel/printk.c (per processorinitializationcheck) Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2001-12-04  1:45 [PATCH] 2.4.16 kernel/printk.c (per processor initializationcheck) Andrew Morton
2001-12-03  9:20 ` [PATCH] 2.4.16 kernel/printk.c (per processor initialization check) Andrew Morton
2001-12-03 10:32   ` j-nomura
2001-12-06  5:01     ` [PATCH] 2.4.16 kernel/printk.c (per processor initializationcheck) j-nomura
2001-12-07  3:40       ` [PATCH] 2.4.16 kernel/printk.c (per processorinitializationcheck) Andrew Morton
2001-12-07 18:52         ` Marcelo Tosatti
2001-12-07 20:52           ` William Lee Irwin III
2001-12-07 21:37         ` David Mosberger
2001-12-07 20:47           ` Marcelo Tosatti
2001-12-07 22:08           ` Alan Cox
2001-12-07 22:14           ` Christopher Friesen
2001-12-07 22:17           ` David Mosberger
2001-12-07 21:09             ` Marcelo Tosatti
2001-12-08  1:10             ` David Mosberger
2001-12-08 11:27               ` Alan Cox
2001-12-08 16:41               ` David Mosberger
2001-12-08 20:45                 ` Alan Cox
2001-12-09  0:32                 ` David Mosberger
2001-12-09  0:55                   ` Alan Cox
2001-12-09  0:58                   ` David Mosberger
2001-12-09  1:14                     ` David Mosberger
2001-12-09  1:32                       ` Alan Cox
2001-12-09  1:15                     ` Alan Cox

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®