hvconsole.c : possible problem

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri May 7 08:12:40 EST 2004

On Fri, 2004-05-07 at 05:28, Hollis Blanchard wrote:
> On Apr 28, 2004, at 12:05 AM, Benjamin Herrenschmidt wrote:
> >  - The whole wait_for_packet() is completely synchronous (doesn't
> > schedule), that doesn't sound very good.
> Can't do schedule(). wait_for_packet() is called at init time, as a
> console_initcall, to handshake with the service processor.
> console_init() is called under lock_kernel()...
> 	bad: scheduling while atomic!

Ugh ? You can schedule in lock_kernel iirc ... Maybe not any more...
Well, you can probably just test for system_state before scheduling.

> I'm sure other code is in this same position. Is it a good idea to do
> something like
> 	if (in_atomic())
> 		usleep()
> 	else
> 		schedule()

No. If the problem is only about console_init(), system state should be


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/

More information about the Linuxppc64-dev mailing list