From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTVcF-0007om-D9 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:10:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTVcA-0003qa-O0 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:10:31 -0400 Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:46667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTVcA-0003qR-EK for qemu-devel@nongnu.org; Fri, 28 Mar 2014 08:10:26 -0400 Received: by mail-ee0-f54.google.com with SMTP id d49so4057378eek.27 for ; Fri, 28 Mar 2014 05:10:25 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <533566AC.1000003@redhat.com> Date: Fri, 28 Mar 2014 13:10:20 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1395160174-16006-1-git-send-email-dslutz@verizon.com> <53356044.7020309@terremark.com> In-Reply-To: <53356044.7020309@terremark.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/1] char/serial: Fix emptyness handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Don Slutz Cc: Jan Kiszka , Peter Crosthwaite , qemu-devel@nongnu.org Il 28/03/2014 12:43, Don Slutz ha scritto: > Ping. (Since this is a bug fix, I think it can go into 2.0) > -Don Slutz I think the problem is that not many people understand the 8250 device model. CCing someone who hopefully does... Paolo > On 03/18/14 12:29, Don Slutz wrote: >> The commit 88c1ee73d3231c74ff90bcfc084a7589670ec244 >> char/serial: Fix emptyness check >> >> Still causes extra NULL byte(s) to be sent. >> >> So if the fifo is empty, do not send an extra NULL byte. >> >> Reviewed-by: Peter Crosthwaite >> Signed-off-by: Don Slutz >> --- >> Changes V2 to v3 >> Revert v2 changes >> Fix coding style issues. >> Changes v1 to v2 >> Do full state change on fifo8_is_empty. >> >> hw/char/serial.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/hw/char/serial.c b/hw/char/serial.c >> index 6d3b5af..f4d167f 100644 >> --- a/hw/char/serial.c >> +++ b/hw/char/serial.c >> @@ -225,8 +225,10 @@ static gboolean serial_xmit(GIOChannel *chan, >> GIOCondition cond, void *opaque) >> if (s->tsr_retry <= 0) { >> if (s->fcr & UART_FCR_FE) { >> - s->tsr = fifo8_is_empty(&s->xmit_fifo) ? >> - 0 : fifo8_pop(&s->xmit_fifo); >> + if (fifo8_is_empty(&s->xmit_fifo)) { >> + return FALSE; >> + } >> + s->tsr = fifo8_pop(&s->xmit_fifo); >> if (!s->xmit_fifo.num) { >> s->lsr |= UART_LSR_THRE; >> } > > >