diff mbox

[U-Boot,v3,11/29] console: Remove vprintf() optimisation for sandbox

Message ID 1406120124-9373-12-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 23, 2014, 12:55 p.m. UTC
If the console is not present, we try to reduce overhead by stopping any
output in vprintf(), before it gets to putc(). This is of dubious merit
in general, but in the case of sandbox it is incorrect since we have a
fallback console which reports errors very early in U-Boot. If this is
defeated U-Boot can hang or exit with no indication of what is wrong.

Remove the optimisation for sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2:
- Improve wording in commit message

 common/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass July 26, 2014, 3:06 p.m. UTC | #1
On 23 July 2014 13:55, Simon Glass <sjg@chromium.org> wrote:
> If the console is not present, we try to reduce overhead by stopping any
> output in vprintf(), before it gets to putc(). This is of dubious merit
> in general, but in the case of sandbox it is incorrect since we have a
> fallback console which reports errors very early in U-Boot. If this is
> defeated U-Boot can hang or exit with no indication of what is wrong.
>
> Remove the optimisation for sandbox.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to dm/master.
diff mbox

Patch

diff --git a/common/console.c b/common/console.c
index 11c102a..5576dfd 100644
--- a/common/console.c
+++ b/common/console.c
@@ -504,7 +504,7 @@  int vprintf(const char *fmt, va_list args)
 	uint i;
 	char printbuffer[CONFIG_SYS_PBSIZE];
 
-#ifndef CONFIG_PRE_CONSOLE_BUFFER
+#if defined(CONFIG_PRE_CONSOLE_BUFFER) && !defined(CONFIG_SANDBOX)
 	if (!gd->have_console)
 		return 0;
 #endif