From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Xx9-0006Km-A4 for qemu-devel@nongnu.org; Mon, 15 Dec 2014 10:53:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0Xx2-0000Sa-Hy for qemu-devel@nongnu.org; Mon, 15 Dec 2014 10:52:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0Xx2-0000SW-9r for qemu-devel@nongnu.org; Mon, 15 Dec 2014 10:52:48 -0500 Message-ID: <548F03C5.8010008@redhat.com> Date: Mon, 15 Dec 2014 16:52:37 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1418388243-1886-1-git-send-email-pbonzini@redhat.com> <1418388243-1886-4-git-send-email-pbonzini@redhat.com> <20141215155040.GI5502@work-vm> In-Reply-To: <20141215155040.GI5502@work-vm> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 3/4] serial: update LSR on enabling/disabling FIFOs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: imammedo@redhat.com, andrey@xdel.ru, qemu-devel@nongnu.org, batuzovk@ispras.ru 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