[U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart()

Wolfgang Denk wd at denx.de
Mon Mar 21 13:00:54 CET 2011


Dear Graeme Russ,

In message <4D8739F6.5040805 at gmail.com> you wrote:
>
> I kind of like the idea of different reset sources (CPU exception, hardware
> failure, user initiated) but agree copying the linux architecture is over
> the top.

What's the difference as far as do_reset() is concenred?  It shall
just (hard) reset the system, nothing else.

> Is there any reason reset() could not take a 'reason' parameter? It could
> be a bit-mask with CPU, SOC and arch reserved bits (unhandled exception,
> user initiated, panic etc) and board specific bits

What for? To perform the intended purpose, no parameter is needed.

> Board or arch specific code could handle different reasons however they
> please (like logging it in NVRAM prior to restart, gracefully shutting down
> multiple CPU's, clearing DMA buffers etc)

That would be a layer higher than do_reset() (for example, in
panic()).

> All 'hang', 'panic', 'reset' etc code can be simplified into a single code
> path (although calling 'reset' to 'hang' is a bit odd)

hang() and reset() are intentionally very different things.  A call to
hang() is supposed to hang (surprise, surprise!) infinitely.  It must
not cause a reset.

panic() is a higher software layer. It probably results in calling
reset() in the end.

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
You don't need a weatherman to know which way the wind blows.
                                                          - Bob Dylan


More information about the U-Boot mailing list