debug: prevent entering debug mode on panic/exception.
debug: prevent entering debug mode on panic/exception.

On non-developer devices, kgdb prevents the device from rebooting
after a panic.

Incase of panics and exceptions, to allow the device to reboot, prevent
entering debug mode to avoid getting stuck waiting for the user to
interact with debugger.

To avoid entering the debugger on panic/exception without any extra
configuration, panic_timeout is being used which can be set via
/proc/sys/kernel/panic at run time and CONFIG_PANIC_TIMEOUT sets the
default value.

Setting panic_timeout indicates that the user requested machine to
perform unattended reboot after panic. We dont want to get stuck waiting
for the user input incase of panic.

Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Cc: bfb184e7e609c03ac890274dc9e9cfddfd6b0cd0@lists.sourceforge.net
Cc: 2578944098299abf708b08eff6fcf60565553586@vger.kernel.org
Cc: Android Kernel Team <6a543c1938e2357c042e911ad9c052b5afc2d394@android.com>
Cc: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>
Cc: Sumit Semwal <d6930da0d649c01d063dcca4d796c2ac2cbb68ba@linaro.org>
Signed-off-by: Colin Cross <380081620a7947c89c11153c5513f34019caa923@android.com>
[Kiran: Added context to commit message.
panic_timeout is used instead of break_on_panic and
break_on_exception to honor CONFIG_PANIC_TIMEOUT
Modified the commit as per community feedback]
Signed-off-by: Kiran Raparthy <fe090afba918b7dc5a6faa529b8072fae626b8a6@linaro.org>
Signed-off-by: Daniel Thompson <4421c302a8f2019ff02452a16ddbdd37770f814c@linaro.org>
Signed-off-by: Jason Wessel <3f19c87103ac4cd0301ffd05a2421b687c7b3c77@windriver.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs