diff mbox

powerpc: Reword the "returning from prom_init" message

Message ID 1421056096-20043-1-git-send-email-mpe@ellerman.id.au (mailing list archive)
State Changes Requested
Headers show

Commit Message

Michael Ellerman Jan. 12, 2015, 9:48 a.m. UTC
We get way too many bug reports that say "the kernel is hung in
prom_init", which stems from the fact that the last piece of output
people see is "returning from prom_init".

The kernel is almost never hung in prom_init(), it's just that it's
crashed somewhere after prom_init() but prior to the console coming up.

The existing message should give a clue to that, ie. "returning from"
indicates that prom_init() has finished, but it doesn't seem to work.
Let's try something different.

This prints:

  Calling quiesce...
  Shutting down Open Firmware, booting Linux via __start() ...

Which hopefully makes it clear that prom_init() is not the problem, and
although __start() probably isn't either, it's at least the right place
to begin looking.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/prom_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul A. Clarke Jan. 12, 2015, 5:27 p.m. UTC | #1
On 01/12/2015 03:48 AM, Michael Ellerman wrote:
> We get way too many bug reports that say "the kernel is hung in
> prom_init", which stems from the fact that the last piece of output
> people see is "returning from prom_init".
>
> The kernel is almost never hung in prom_init(), it's just that it's
> crashed somewhere after prom_init() but prior to the console coming up.
>
> The existing message should give a clue to that, ie. "returning from"
> indicates that prom_init() has finished, but it doesn't seem to work.
> Let's try something different.
>
> This prints:
>
>    Calling quiesce...
>    Shutting down Open Firmware, booting Linux via __start() ...
>
> Which hopefully makes it clear that prom_init() is not the problem, and
> although __start() probably isn't either, it's at least the right place
> to begin looking.

I'm very much in favor of anything that increases usability or decreases 
confusion.

I worry about confusion caused by any phrase that begins "Shutting 
down.."  Even if accurate, I wonder if something more positive that 
indicates that, at least at this point, things are continuing to proceed 
along would be preferred.

Perhaps something like "Transferring control from Open Firmware to 
kernel (via __start) ...".

(Do we know for certain that what is about to be invoked is "Linux" 
per-se, or can it be something else that has a "__start"?)

PC
Michael Ellerman Jan. 13, 2015, 12:58 a.m. UTC | #2
On Mon, 2015-01-12 at 11:27 -0600, Paul Clarke wrote:
> On 01/12/2015 03:48 AM, Michael Ellerman wrote:
> > We get way too many bug reports that say "the kernel is hung in
> > prom_init", which stems from the fact that the last piece of output
> > people see is "returning from prom_init".
> >
> > The kernel is almost never hung in prom_init(), it's just that it's
> > crashed somewhere after prom_init() but prior to the console coming up.
> >
> > The existing message should give a clue to that, ie. "returning from"
> > indicates that prom_init() has finished, but it doesn't seem to work.
> > Let's try something different.
> >
> > This prints:
> >
> >    Calling quiesce...
> >    Shutting down Open Firmware, booting Linux via __start() ...
> >
> > Which hopefully makes it clear that prom_init() is not the problem, and
> > although __start() probably isn't either, it's at least the right place
> > to begin looking.
> 
> I'm very much in favor of anything that increases usability or decreases 
> confusion.
> 
> I worry about confusion caused by any phrase that begins "Shutting 
> down.."  Even if accurate, I wonder if something more positive that 
> indicates that, at least at this point, things are continuing to proceed 
> along would be preferred.

True.

> Perhaps something like "Transferring control from Open Firmware to 
> kernel (via __start) ...".

Yeah, that's not quite accurate either :)

Linux already has control, but up until that point it is running alongside OF
and using its services. After prom_init() returns we take over the machine
entirely.

Maybe "Leaving Open Firmware, booting Linux ..."

Or just "Booting Linux ...".

> (Do we know for certain that what is about to be invoked is "Linux" 
> per-se, or can it be something else that has a "__start"?)

Yes it's Linux.

Although we treat prom_init() as a separate thing, it's just linked into the
regular kernel binary. So the "transfer" here is really just a function call.
But it signifies a switch from code that runs alongside Open Firmware
(prom_init()), to code that doesn't (the rest of the kernel).

We have talked about actually linking them separately but we've never bothered,
it wouldn't buy us much.

cheers
diff mbox

Patch

diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 1a85d8f96739..bd3e0d8ac8fd 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2910,7 +2910,7 @@  unsigned long __init prom_init(unsigned long r3, unsigned long r4,
 
 	/* Don't print anything after quiesce under OPAL, it crashes OFW */
 	if (of_platform != PLATFORM_OPAL) {
-		prom_printf("returning from prom_init\n");
+		prom_printf("Shutting down Open Firmware, booting Linux via __start() ...\n");
 		prom_debug("->dt_header_start=0x%x\n", hdr);
 	}