Re: [PATCH v2 2/2] MIPS: fix kernel lockup or crash after CPU offline/online

From: Maciej W. Rozycki
Date: Fri Jan 30 2015 - 13:54:04 EST


On Fri, 30 Jan 2015, James Hogan wrote:

> > > Hmm, kernel/printk/printk.c does have:
> > >
> > > static inline int can_use_console(unsigned int cpu)
> > > {
> > > return cpu_online(cpu) || have_callable_console();
> > > }
> > >
> > > which should prevent it dumping printk buffer to console. CPU shouldn't
> > > be marked online that early, which suggests that the console has the
> > > CON_ANYTIME flag set, which it probably shouldn't if it depends on
> > > module code. call_console_drivers() seems to ensure the CPU is online or
> > > has CON_ANYTIME before calling the console write callback.
> > >
> > > A quick glance and I can't see any evidence of netconsole being able to
> > > get CON_ANYTIME.
> >
> > It does not set the flag. But flags are kept in module's static data,
> > so the original problem stays.
> >
> > A.
>
> Ah yes, of course. This approach looks correct to me then.

In such a case shouldn't the flags be copied out on console registration
to a structure that is guaranteed to be accessible at all times?

Maciej
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/