From: Wolfgang Denk Date: Sat, 10 Mar 2012 23:49:15 +0100 Subject: [U-Boot] [PATCH v2 3/4] tegra: Implement pre-console putc() for fdt warning In-Reply-To: References: <1331325178-14634-1-git-send-email-sjg@chromium.org> <1331325178-14634-3-git-send-email-sjg@chromium.org> <20120310081620.CB434202C07@gemini.denx.de> <20120310200830.C8F9E202DB1@gemini.denx.de> Message-ID: <20120310224915.E1036202DB1@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Simon, In message you wrote: > > > I think outputting data to all "potential" console ports is a really > > bad thing, as you cannot know how your users are using the hardware. > > They may have attached hardware to the UARTs, and the data you send to > > the port causes a mis-function of the device. =A0I guess you don't add > > to your documentation a warning like: select one port as console, and > > leave allother ports unused, because we may send random date to all > > ports any time? > > Only on a fatal error. Unfortunately this idea of 'fatal error' was > lost in the conversion from board_panic_no_console() to This "fatal error" might become a fatal accident in some cases if you send random data to some port that controls some kind of machinery or whatever. Never ever do that! > board_pre_console_putc(). I would be keen to move back to that > original plan, so that the idea of a fatal error is captured. In a > fatal error situation there is no prospect of the board working and > the only hope is that we can alert the user. Agreed. But you must not do this by performing random actions on random (potentially otherwise used [by the end user]) interfaces. > > If you do not know which UART port to use, then the only consequence > > can be not to use any UART prt at all. Use a LED with blink codes or > > whatever your hardwar ehas, but do not mess with random ports. > > I agres with the sentiment and this is a very ugly corner case, but in > practice people want to know what happened, not just be presented with > a brick. Yes, I understand this. But please try to find another way to signal failure. Do not perform random actions on a device - you could as well always output all data on all UART ports because with this codeyou cannot use the other ports for any serious purpose anyway. > > I also cannot understand why you think you must init() and drain() the > > UART for each character printed - ok, the latter is probably a > > consequence of re-initializing the port for each character. > > Eventually this will be not needed once you get rid of the re-init. > > OK so how about moving to a puts()-type interface? Then I can remove this. Sorry, but I don't have enough context - pts() interface where or for what? 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 Each honest calling, each walk of life, has its own elite, its own aristocracy based on excellence of performance. - James Bryant Conant