On 15/12/2014 16:50, Dr. David Alan Gilbert wrote: >> > >> > if (val & UART_FCR_XFR) { >> > + s->lsr |= UART_LSR_THRE; >> > + s->thr_ipending = 1; >> > fifo8_reset(&s->xmit_fifo); >> > } > Doesn't that break the assertion you added in patch 2? > i.e. if I write a character, but it can't be sent, so it's added > to the tsr_retry, but before the callback I set FCR_XFR, and that > now sets LSR_THRE, then the callback triggers and it hits the > assert?
You're right. The TEMT assertion is okay, but the THRE assertion should be inside if (s->tsr_retry <= 0). Paolo