From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBCaWXDn21hbm4=?= Date: Tue, 16 Apr 2013 16:40:33 +0200 Subject: [U-Boot] [PATCH] make hang() a weak function In-Reply-To: <20130416142358.E6CDA200568@gemini.denx.de> References: <1366107249-24547-1-git-send-email-andreas.devel@googlemail.com> <20130416133621.40db0a42@lilith> <516D39CF.9020907@gmail.com> <20130416122229.BB9E0200568@gemini.denx.de> <516D4B00.9030102@gmail.com> <20130416130515.04A83200568@gemini.denx.de> <516D52EE.1040402@gmail.com> <516D5D0A.20403@gmail.com> <20130416142358.E6CDA200568@gemini.denx.de> Message-ID: <516D62E1.7090306@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang, On 04/16/2013 04:23 PM, Wolfgang Denk wrote: > Dear Andreas, > > In message <516D5D0A.20403@gmail.com> you wrote: >> >> In my opinion it makes sense to panic(). In my special case I also need >> to hang() when panic(). The next question is then how to visualize the >> (end-)user of that device that we hang(). > > The intention behind hang() is to stop doing anything, i. e. to idle > the board. Nothing else. > > We can argue if this is always a good thing to do. For example, in > some situations it may be possible to switch off the board instead. > Or, as in your case, to run some code to visualize the state. > > I fully agree that these are perfectly reasonable use cases for fatal > error handling in U-Boot. But then, these are not functions to be > implemented in the context of hang(). Hang is a synonym for "place > the CPU into an infinite loop and stop doing anything else". > > If you call hang() you agree to hang the system. I got your point. > If you want to do something else, then please do not call hang(), but > some other function. I will find a solution for my very specific state of the device. But how about other places in u-boot hang()ing the device? How can we tell the user that state without a terminal? If one plugs a uart cable he might see some cause of the hang() but this is not acceptable for some groups of users. Is it wise to completely stop a device without showing the state to the user? This question is a bit hypothetical cause we should eliminate the root causes for hang()s before going to market. However I would like to hear your thoughts about that. Best regards Andreas Bie?mann