[U-Boot] Going beyond CONFIG_SYS_CBSIZE limit causes a hang

Fabio Estevam festevam at gmail.com
Mon May 19 02:49:09 CEST 2014


On Sun, May 18, 2014 at 9:26 PM, Fabio Estevam <festevam at gmail.com> wrote:
> Hi,
>
> When I enter the number of characters defined by CONFIG_SYS_CBSIZE
> into the console I noticed that further characters are no longer
> accepted.
>
> This part is fine. The problem is that after hitting Enter I get a system hang.
>
> To reproduce the problem more easily I set CONFIG_SYS_CBSIZE to only 50:
>
> => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> Unknown command 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - try 'help
> '
> (Then the console hangs)
>
> Also tried to enter the maximum of accepted characters
> (CONFIG_SYS_CBSIZE is only 50 in this example), then after it reaches
> the limit, I hit one backspace followed by Enter:
>
> => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> Unknown command 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - try 'help'
> data abort
> pc : [<27706c6e>]          lr : [<27706c65>]
> sp : 4f56cdc0  ip : 00000000     fp : 4f56ef70
> data abort
> pc : [<66a53642>]          lr : [<66653639>]
> sp : 4f56ccd8  ip : 0000000f     fp : 4f56ef70
> data abort
> pc : [<666fffce>]          lr : [<66653635>]
> sp : 4f56cbf0  ip : 0000000f     fp : 4f56ef70
> data abort
> pc : [<666fffea>]          lr : [<66653635>]
> sp : 4f56cb08  ip : 0000000f     fp : 4f56ef70
> data abort
> pc : [<4ff6f1e8>]          lr : [<66653635>]
> sp : 4f56ca20  ip : 0000000f     fp : 4f56ef70
> data abort
> pc : [<666acd74>]          lr : [<66653635>]
> sp : 4f56c938  ip : 0000000f     fp : 4f56ef70
> data abort
> pc : [<4ff6f1e8>]          lr : [<66653635>]
> sp : 4f56c850  ip : 0000000f     fp : 4f56ef70
> data abort
> pc : [<666ffffa>]          lr : [<66653635>]
> sp : 4f56c768  ip : 0000000f     fp : 4f56ef70
>
> These tests were made on a mx6qsabresd.
>
> What would be the correct way to to avoid such hangs?

Ok, I managed to fix the hang:

--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -217,7 +217,7 @@
 #define CONFIG_SYS_CBSIZE              256

 /* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 32)
 #define CONFIG_SYS_MAXARGS             16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE

The problem is that the original CONFIG_SYS_PBSIZE could not fit the
'Unknown command  - try 'help' characters.

Will submit a patch shortly.


More information about the U-Boot mailing list