From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWDJK-0008ID-PU for qemu-devel@nongnu.org; Fri, 04 Apr 2014 19:14:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWDJD-0002Eh-LD for qemu-devel@nongnu.org; Fri, 04 Apr 2014 19:14:10 -0400 Received: from theiggy.com ([66.220.1.110]:47508 helo=mail.theiggy.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWDJD-0002Eb-F8 for qemu-devel@nongnu.org; Fri, 04 Apr 2014 19:14:03 -0400 Message-ID: <533F3CB9.2080409@theiggy.com> Date: Fri, 04 Apr 2014 18:14:01 -0500 From: Brian Jackson MIME-Version: 1.0 References: <1395160174-16006-1-git-send-email-dslutz@verizon.com> <53356044.7020309@terremark.com> <533566AC.1000003@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0 v3 1/1] char/serial: Fix emptyness handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , Paolo Bonzini Cc: Jan Kiszka , "qemu-devel@nongnu.org Developers" , Don Slutz , peter.maydell@linaro.org On 04/04/2014 07:13 AM, Peter Crosthwaite wrote: > On Fri, Mar 28, 2014 at 10:10 PM, Paolo Bonzini wrote: >> 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 Not sure what the exact standard is for 2.0 stuff... but changing the subject (to include something about 2.0) or CC'ing Peter Maydell may help get this into 2.0 (just did both ;) >> >> I think the problem is that not many people understand the 8250 device >> model. CCing someone who hopefully does... >> > I have a bit of experience with 16550 :) Ill push for a merge on this one. > > Regards, > Peter > >> 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; >>>> } >>> >>> >>> >>