public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH v3 0/3] Add command to display or save Linux PStore dumps
Date: Thu, 19 Mar 2020 21:37:24 +0100	[thread overview]
Message-ID: <20200319203724.4492124003E@gemini.denx.de> (raw)
In-Reply-To: <20200319175737.10166-1-frederic.danis@collabora.com>

Dear Fr?d?ric,

In message <20200319175737.10166-1-frederic.danis@collabora.com> you wrote:
> This serie of patches adds a new pstore command allowing to display or save
> ramoops logs (oops, panic, console, ftrace and user) generated by a previous
> kernel crash.
> PStore parameters can be set in U-Boot configuration file, or at run-time
> using "pstore set" command. For kernel using Device Tree, the parameters are
> dynamically added to Device Tree.
> Records size should be the same as the ones used by kernel, and should be a
> power of 2.

I wonder if we are reinventing the wheel here again?

There is this feature in U-Boot which is called "shared log buffer";
a couple of years ago this was fully functional at least on Power
and ARM architectures, but it was rarely used and probably has not
been tested for years.  A;so, the necessary tiny patch to have it
supported in Linux as well never made it upstream (don't remember
why, likely lack of time/interest).

The functionality we had then was the following:

- A memory area war reserved in U-Boot (typically at the upper end
  of memory) as a buffer that was shared between U-Boot and Linux.
  The format was as used for the kernel log buffer.
- Upon boot, U-Boot would not re-initialize an existing log buffer,
  but keep it's content.  That means, you could read and display the
  log buffer of the linux kernel that was running before the reset.
  After kernel crashes, pretty often this contained information that
  the kernel could not even print to the serial console any more.
- In U-Boot, you could append log entries to that buffer.  For
  example, this was used to record the results of the Power On Self
  Test (POST) routines (another feature that only few people still
  remember).
- When booting Linux, the kernel syslog mechanism was used to
  extract the information from the log buffer in the usual way.

The interesting fact here was that the Linux kernel was able to
extract and save the kernel panic messages etc. from the crash
before, plus any messages logged by U-Boot.


To me this sounds very much like what you are adding here (plus a
few features more).  Does it make sense to unify such code?



Added Heiko to Cc:, as he is currently working on fixes to get
shared logbuffer working again for another project.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'm what passes for a Unix guru in my office. This is  a  frightening
concept. - Lee Ann Goldstein, in <3k55ba$c43@butch.lmsc.lockheed.com>

  parent reply	other threads:[~2020-03-19 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 17:57 [PATCH v3 0/3] Add command to display or save Linux PStore dumps Frédéric Danis
2020-03-19 17:57 ` [PATCH v3 1/3] cmd: " Frédéric Danis
2020-03-19 17:57 ` [PATCH v3 2/3] test: Add PStore command tests Frédéric Danis
2020-03-19 20:39   ` Wolfgang Denk
2020-03-19 17:57 ` [PATCH v3 3/3] cmd: Fixup DT to pass PStore Ramoops parameters Frédéric Danis
2020-03-19 19:14   ` Heinrich Schuchardt
2020-03-19 20:37 ` Wolfgang Denk [this message]
2020-03-19 22:30   ` [PATCH v3 0/3] Add command to display or save Linux PStore dumps Heinrich Schuchardt
2020-03-20  8:08     ` Wolfgang Denk
2020-03-20  8:57       ` Heiko Schocher
2020-03-20 10:13       ` Frédéric Danis
2020-03-20 10:35         ` Wolfgang Denk
2020-03-20 11:19           ` Frédéric Danis
2020-03-20 11:29             ` Wolfgang Denk
2020-03-23 15:37               ` Simon Glass
2020-03-23 15:46                 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200319203724.4492124003E@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox