[PATCH V2] powerpc/powernv: Add a kmsg_dumper that flushes console output on panic

Andrew Donnellan andrew.donnellan at au1.ibm.com
Fri Nov 27 16:12:25 AEDT 2015


On 25/11/15 14:26, Russell Currey wrote:
> On BMC machines, console output is controlled by the OPAL firmware and is
> only flushed when its pollers are called.  When the kernel is in a panic
> state, it no longer calls these pollers and thus console output does not
> completely flush, causing some output from the panic to be lost.
>
> This patch adds a new kmsg_dumper which gets called at panic time to ensure
> panic output is not lost.  It accomplishes this by calling OPAL_CONSOLE_FLUSH
> in the OPAL API, and if that is not available, the pollers are called enough
> times to (hopefully) completely flush the buffer.

As per our off-list discussions, the commit message should explain that 
the console is already flushed upon reboot, and thus this patch fixes a 
problem in the case where the kernel is not set to reboot on panic, or 
will only reboot after an extended delay. Additionally, you could still 
miss messages printed in panic() after the dumpers are called, i.e. the 
"end kernel panic" message.

>
> Signed-off-by: Russell Currey <ruscur at russell.cc>

The code looks reasonable.

With the changes I've mentioned above:

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan at au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited



More information about the Linuxppc-dev mailing list