public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/1] fix some SPL debug builds.
@ 2012-08-14 20:37 Jeroen Hofstee
  2012-08-14 20:40 ` [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug) Jeroen Hofstee
  0 siblings, 1 reply; 6+ messages in thread
From: Jeroen Hofstee @ 2012-08-14 20:37 UTC (permalink / raw)
  To: u-boot

Some boards with SPL fail to build with DEBUG defined. This patch
should fix the "undefined reference to `do_reset'".

before with -DDEBUG
--------------------- SUMMARY ----------------------------
Boards compiled: 303
Boards with errors: 44 ( da850_am18xxevm da850evm spear300 spear300_nand
spear300_usbtty spear300_usbtty_nand spear310 spear310_pnor spear310_nand
spear310_usbtty spear310_usbtty_pnor spear310_usbtty_nand spear320
spear320_pnor spear320_nand spear320_usbtty spear320_usbtty_pnor
spear320_usbtty_nand spear600 spear600_nand spear600_usbtty
spear600_usbtty_nand am335x_evm omap3_overo am3517_evm am3517_crane
omap3_beagle omap3_evm omap3_evm_quick_mmc devkit8000 mcx tricorder
omap4_panda omap4_sdp4430 omap5_evm harmony seaboard ventana whistler
plutux medcom tec paz00 trimslice )

Boards with warnings but no errors: 8 ( VCMA9 smdk2410 top9000eval_xe
lschlv2 lsxhl omap5912osk qong top9000eval_xe )
----------------------------------------------------------

after with -DDEBUG
--------------------- SUMMARY ----------------------------
Boards compiled: 303
Boards with errors: 29 ( spear600_nand spear320_nand spear320_usbtty_nand
spear310_pnor plutux medcom spear300_usbtty_nand spear320_usbtty_pnor
spear300 spear320_pnor spear300_usbtty spear310_usbtty_nand spear320_usbtty
spear310_usbtty_pnor spear600 seaboard trimslice spear600_usbtty tec 
whistler
ventana harmony paz00 spear300_nand spear320 spear310 spear310_nand
spear310_usbtty spear600_usbtty_nand )

Boards with warnings but no errors: 7 ( lsxhl qong top9000eval_xe lschlv2
VCMA9 omap5912osk smdk2410 )
----------------------------------------------------------

Jeroen Hofstee (1):
   lib, panic: don't call do_reset in SPL (debug).

  lib/vsprintf.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug).
  2012-08-14 20:37 [U-Boot] [PATCH 0/1] fix some SPL debug builds Jeroen Hofstee
@ 2012-08-14 20:40 ` Jeroen Hofstee
  2012-08-15 17:11   ` Tom Rini
  2012-08-24 19:30   ` Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Jeroen Hofstee @ 2012-08-14 20:40 UTC (permalink / raw)
  To: u-boot

Several omap boards won't build when DEBUG is defined, SPL build error:
"vsprintf.c:791: undefined reference to `do_reset'", since SPL has no
commands. Therefore don't call do_reset in SPL. SPL panic will end in an
endless loop or call hang if CONFIG_PANIC_HANG is defined.

cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
---
  lib/vsprintf.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index e38a4b7..4fa392d 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -18,7 +18,7 @@
  #include <errno.h>

  #include <common.h>
-#if !defined (CONFIG_PANIC_HANG)
+#if !defined(CONFIG_PANIC_HANG) && !defined(CONFIG_SPL_BUILD)
  #include <command.h>
  #endif

@@ -786,7 +786,7 @@ void panic(const char *fmt, ...)
      va_end(args);
  #if defined (CONFIG_PANIC_HANG)
      hang();
-#else
+#elif !defined(CONFIG_SPL_BUILD)
      udelay (100000);    /* allow messages to go out */
      do_reset (NULL, 0, 0, NULL);
  #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug).
  2012-08-14 20:40 ` [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug) Jeroen Hofstee
@ 2012-08-15 17:11   ` Tom Rini
  2012-08-17 10:51     ` Stefano Babic
  2012-08-24 19:30   ` Tom Rini
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2012-08-15 17:11 UTC (permalink / raw)
  To: u-boot

On Tue, Aug 14, 2012 at 10:40:50PM +0200, Jeroen Hofstee wrote:

> Several omap boards won't build when DEBUG is defined, SPL build error:
> "vsprintf.c:791: undefined reference to `do_reset'", since SPL has no
> commands. Therefore don't call do_reset in SPL. SPL panic will end in an
> endless loop or call hang if CONFIG_PANIC_HANG is defined.
> 
> cc: Tom Rini <trini@ti.com>
> Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>

OK, the problem I see with this is it forces a policy on everyone, even
non-DEBUG cases.  What I'd like to see, and I'll submit the patch, is to
document that when debugging SPL one should also set CONFIG_PANIC_HANG
as do_reset is often (but it could be defined!) undefined for SPL.

-- 
Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug).
  2012-08-15 17:11   ` Tom Rini
@ 2012-08-17 10:51     ` Stefano Babic
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2012-08-17 10:51 UTC (permalink / raw)
  To: u-boot

On 15/08/2012 19:11, Tom Rini wrote:
> On Tue, Aug 14, 2012 at 10:40:50PM +0200, Jeroen Hofstee wrote:
> 
>> Several omap boards won't build when DEBUG is defined, SPL build error:
>> "vsprintf.c:791: undefined reference to `do_reset'", since SPL has no
>> commands. Therefore don't call do_reset in SPL. SPL panic will end in an
>> endless loop or call hang if CONFIG_PANIC_HANG is defined.
>>
>> cc: Tom Rini <trini@ti.com>
>> Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
> 
> OK, the problem I see with this is it forces a policy on everyone, even
> non-DEBUG cases.  What I'd like to see, and I'll submit the patch, is to
> document that when debugging SPL one should also set CONFIG_PANIC_HANG
> as do_reset is often (but it could be defined!) undefined for SPL.

Right, we have some kind of dependencies. It is always painful if the
reason is unknown, and we should document it.

Best regards,
Stefano



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug).
  2012-08-14 20:40 ` [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug) Jeroen Hofstee
  2012-08-15 17:11   ` Tom Rini
@ 2012-08-24 19:30   ` Tom Rini
  2012-09-02 17:03     ` Wolfgang Denk
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2012-08-24 19:30 UTC (permalink / raw)
  To: u-boot

On 08/14/2012 01:40 PM, Jeroen Hofstee wrote:

> Several omap boards won't build when DEBUG is defined, SPL build error:
> "vsprintf.c:791: undefined reference to `do_reset'", since SPL has no
> commands. Therefore don't call do_reset in SPL. SPL panic will end in an
> endless loop or call hang if CONFIG_PANIC_HANG is defined.
> 
> cc: Tom Rini <trini@ti.com>
> Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
> ---
>  lib/vsprintf.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index e38a4b7..4fa392d 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -18,7 +18,7 @@
>  #include <errno.h>
> 
>  #include <common.h>
> -#if !defined (CONFIG_PANIC_HANG)
> +#if !defined(CONFIG_PANIC_HANG) && !defined(CONFIG_SPL_BUILD)
>  #include <command.h>
>  #endif
> 
> @@ -786,7 +786,7 @@ void panic(const char *fmt, ...)
>      va_end(args);
>  #if defined (CONFIG_PANIC_HANG)
>      hang();
> -#else
> +#elif !defined(CONFIG_SPL_BUILD)
>      udelay (100000);    /* allow messages to go out */
>      do_reset (NULL, 0, 0, NULL);
>  #endif

Thinking about this more.  The point is that today, no one that does SPL
has reset ability.  I would like to see this changed, slightly.  Lets do:
#if defined(CONFIG_PANIC_HANG) || defined(CONFIG_SPL_BUILD)
#if defined(CONFIG_SPL_BUILD)
puts("hanging\n");
#endif
hang();
#else
...

And no need to not include command.h I think.  This makes it clear that
a panic results in hang in SPL so that in the future, should someone
depend on other behavior it's at least saying why we aren't resetting
which is my concern.

-- 
Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug).
  2012-08-24 19:30   ` Tom Rini
@ 2012-09-02 17:03     ` Wolfgang Denk
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2012-09-02 17:03 UTC (permalink / raw)
  To: u-boot

Dear Tom Rini,

In message <5037D648.1050808@ti.com> you wrote:
> 
> And no need to not include command.h I think.  This makes it clear that
> a panic results in hang in SPL so that in the future, should someone
> depend on other behavior it's at least saying why we aren't resetting
> which is my concern.

I think a panic should always reset by default.  hang() is something
the user has explicitly ask for, it should not be used as the default
case.

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
We, the unwilling, led by the unknowing, are doing the impossible for
the ungrateful. We have done so much, for so long, with so little, we
are now qualified to do anything with nothing.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-02 17:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-14 20:37 [U-Boot] [PATCH 0/1] fix some SPL debug builds Jeroen Hofstee
2012-08-14 20:40 ` [U-Boot] [PATCH 1/1] lib, panic: don't call do_reset in SPL (debug) Jeroen Hofstee
2012-08-15 17:11   ` Tom Rini
2012-08-17 10:51     ` Stefano Babic
2012-08-24 19:30   ` Tom Rini
2012-09-02 17:03     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox