From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart()
Date: Mon, 14 Mar 2011 23:01:08 +0100 [thread overview]
Message-ID: <20110314220108.683E51518DB6@gemini.denx.de> (raw)
In-Reply-To: <44A75130-ED4F-46D6-B0E4-12433CC15142@boeing.com>
Dear "Moffett, Kyle D",
In message <44A75130-ED4F-46D6-B0E4-12433CC15142@boeing.com> you wrote:
>
> Oh, absolutely. I do think there still needs to be a separation
> between a "normal user-initiated restart" and an "panic-time
> emergency restart" though, see further on in this email.
These terms refer to another software level, though.
do_reset() is supposed to provide a hard reset function, nothing else
- as mentioned, the software way of pressing the reset button (or
pulling the plug).
A "normal user-initiated restart" would be the equivalent of a
"shutdown -r" in Linux context. We don't offer such a service in
U-Boot, as it has never been needed yet. If implemented, it would
probably call do_reset() as last of it's actions.
A "panic-time emergency restart" can be anything, too - again, it
would probably call do_reset() at the end.
> Such decisions on what is and is not "acceptable" to run on a panic()
> are better left to the individual boards and architectures.
This is a completely new topic now. We have not been discussing the
implementation or function of panic() before. This has nothing to do
with what do_reset() is supposed to do - do_reset() may (or may not)
be one action called by panic() [and if so, it should be the last
thing that panic() has been doing.]
> Specifically, the separate board and arch hooks for regular and
> "emergency" restarts that I included in the patch:
>
> __arch_restart()
> __board_restart()
> __arch_emergency_restart()
> __board_emergency_restart()
Yes, and I object against such unneeded (for everybody else)
complexity.
> I would argue that is a bug to be fixed. Regardless of how various
> boards and architectures implement "reset", U-Boot should provide
> generic functionality to drivers and library code to allow them to
> indicate what they want:
>
> (1) A safe normal operational restart, with all hardware shut down
> (as much as is considered necessary on the platform). Depending on
> the platform this may fail or take some time.
>
> (2) A critical error restart, where system state may be undefined
> and the calling code does not expect the function to ever return.
This is overkill for a boot loader. We assume that when anything goes
wrong we do the best we can to perform a hard reset. Any halfway sane
hardware design will allow you do do that. There is a zillion of ways
to do that - from causing a machine check, using a hardware watchdog,
messing limits of system monitor chips, etc. etc. Or there is a
simple GPIO pin that triggers an external hard reset.
If some hardware provides no such option I will not hesitate to call
this a hardare bug and blame the hardware designer.
Workarounds for such bugs should be dealt with in board specific code.
> Linux has *both* of those cases in the kernel: sys_reboot() and
> emergency_restart().
Linux is an OS. U-Boot is a boot loader.
Linux offers many things and services that are not available in
U-Boot.
I am even tempted to recommend you to boot Linux as part of your reset
sequence ;-)
> The "jump to _start" case is very similar to Linux kexec(). There are two specific use-cases:
The "jump to _start" case is something I consider a bug that should be
fixed. I will not accept the existence of such code as reason to
build arbitrarily complex layers on top of it. It may be the best
possible solution in the given case (which I actually doubt), but even
then it's just that: the best possible approximation to what
actuallyis needed.
> (1) Safe reliable run-time handoff from one kernel to another
> (2) Emergency panic() call into another kernel to record the error and reboot safely
U-Boot just provides "reset".
I think I understand what you have in mind, but I'm not going to
accept that, especially not in common code. Sorry.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
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
Remember that Beethoven wrote his first symphony in C ...
next prev parent reply other threads:[~2011-03-14 22:01 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-07 17:37 [U-Boot] [PATCH 0/21] Generic cross-architecture system restart support Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart() Kyle Moffett
2011-03-07 21:40 ` Mike Frysinger
2011-03-07 21:56 ` Moffett, Kyle D
2011-03-07 22:10 ` Mike Frysinger
2011-03-07 23:09 ` Graeme Russ
2011-03-08 2:45 ` Mike Frysinger
2011-03-13 19:24 ` Wolfgang Denk
2011-03-14 16:23 ` Moffett, Kyle D
2011-03-14 18:59 ` Wolfgang Denk
2011-03-14 19:52 ` Moffett, Kyle D
2011-03-14 20:38 ` Wolfgang Denk
2011-03-14 21:20 ` Moffett, Kyle D
2011-03-14 22:01 ` Wolfgang Denk [this message]
2011-03-21 11:43 ` Graeme Russ
2011-03-21 12:00 ` Wolfgang Denk
2011-03-22 12:05 ` Graeme Russ
2011-03-22 13:28 ` Wolfgang Denk
2011-03-23 0:19 ` Graeme Russ
2011-04-11 18:31 ` Wolfgang Denk
2011-03-07 17:37 ` [U-Boot] [PATCH 02/21] Replace do_reset() calls with {system, emergency}_restart() Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 03/21] arm: Call "panic()" instead of "hang()" for div-by-zero Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 04/21] arm: Replace unnecessary bad_mode() with panic() Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 05/21] arm: cpux9k2: Remove unnecessary XF_do_reset assignment Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 06/21] arm: Rename nonstandard board_reset() as at91_board_reset() Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 07/21] arm: Generic system restart support Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 08/21] avr32: " Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 09/21] blackfin: Replace "bfin_reset_or_hang()" with "panic()" Kyle Moffett
2011-03-07 21:44 ` Mike Frysinger
2011-03-07 17:37 ` [U-Boot] [PATCH 10/21] blackfin: Generic system restart support Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 11/21] i386: " Kyle Moffett
2011-03-07 21:54 ` Graeme Russ
2011-03-07 22:06 ` Moffett, Kyle D
2011-03-07 22:26 ` Graeme Russ
2011-03-07 22:57 ` Moffett, Kyle D
2011-03-07 23:06 ` Graeme Russ
2011-03-07 17:37 ` [U-Boot] [PATCH 12/21] m68k: " Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 13/21] microblaze: " Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 14/21] mips: " Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 15/21] nios2: " Kyle Moffett
2011-03-09 0:13 ` Scott McNutt
2011-03-09 0:42 ` Moffett, Kyle D
2011-03-09 1:33 ` Scott McNutt
2011-03-07 17:37 ` [U-Boot] [PATCH 16/21] powerpc: " Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 17/21] sh: Unify duplicate reset code Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 18/21] sh: Generic system restart support Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 19/21] sparc: Unify duplicate reset code Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 20/21] sparc: Generic system restart support Kyle Moffett
2011-03-07 17:37 ` [U-Boot] [PATCH 21/21] Remove legacy do_reset() function Kyle Moffett
2011-03-07 21:55 ` Graeme Russ
2011-03-07 23:00 ` Moffett, Kyle D
2011-03-07 23:03 ` Graeme Russ
2011-03-07 21:44 ` [U-Boot] [PATCH 0/21] Generic cross-architecture system restart support Graeme Russ
2011-03-13 19:16 ` Wolfgang Denk
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=20110314220108.683E51518DB6@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