Subject: [PATCH] fix DEBUG_LL DCC race condition

From: [email-masked] (Tony Lindgren)
Date: Wed, 31 Oct 2012 09:27:56 -0700

* Johannes Stezenbach <[email-masked]> [121029 08:20]:
> Trying to boot a kernel with I- and D-caches disabled
> sometimes hangs when DEBUG_LL output to DCC is enabled.
> Apparently the JTAG debugger sometimes reads the
> DCC register before busyuart could see the wDTRfull flag,
> thus busyuart spins in an endless loop.
> 
> The reason seems to be a misunderstanding of the purpose
> of the busyuart macro.  For UART, waituart waits until
> there is space in the FIFO, and busyuart waits until
> the FIFO is empty (all data is sent).
> For DCC, busyuart should be identical to waituart since
> there is no FIFO.
> 
> Signed-off-by: Johannes Stezenbach <[email-masked]>
> ---
> Only tested on ARMv6.
> e.g. arch/arm/mach-at91/include/mach/debug-macro.S has some
> comments which clarify what busyuart is supposed to be doing.

Your explanation makes sense to me:

Acked-by: Tony Lindgren <[email-masked]>