char/serial: Fix emptyness handling
PATCH v3 1/1 char/serial: Fix emptyness handling
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.
---
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(-)
hw/char/serial.c +4 -2
@@ -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 ; }
Signature · 1 line
1.8.4
Ping. (Since this is a bug fix, I think it can go into 2.0)
-Don Slutz
Quoted 37 lines · Don Slutz
The commit
88c1ee73d3231c74ff90bcfc084a7589670ec244char/serial: Fix emptyness checkStill 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 <[email protected]>Signed-off-by Don Slutz <[email protected]>---
Changes V2 to v3
Revert v2 changes
Fix coding style issues.
Changes v1 to v2
Do full state change onfifo8_is_empty.hw/char/serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/char/serial.c +4
-2@@ -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 ; }
Il 28/03/2014 12:43, Don Slutz ha scritto:
Quoted 2 lines
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
Quoted 40 lines · Don Slutz
Quoted 36 lines
The commit
88c1ee73d3231c74ff90bcfc084a7589670ec244char/serial: Fix emptyness checkStill 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 <[email protected]>Signed-off-by Don Slutz <[email protected]>---
Changes V2 to v3
Revert v2 changes
Fix coding style issues.
Changes v1 to v2
Do full state change onfifo8_is_empty.hw/char/serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/char/serial.c +4
-2@@ -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 ; }
Quoted 9 lines · Paolo Bonzini
Il 28/03/2014 12:43, Don Slutz ha scritto:
Quoted 2 lines
Ping. (Since this is a bug fix, I think it can go into 2.0)
-Don SlutzI 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
Quoted 47 lines
Paolo
Quoted 42 lines · Don Slutz
Quoted 37 lines
The commit
88c1ee73d3231c74ff90bcfc084a7589670ec244char/serial: Fix emptyness checkStill 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 <[email protected]>Signed-off-by Don Slutz <[email protected]>---
Changes V2 to v3
Revert v2 changes
Fix coding style issues.
Changes v1 to v2
Do full state change onfifo8_is_empty.hw/char/serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/char/serial.c +4
-2@@ -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 ; }
Quoted 5 lines · Peter Crosthwaite
Quoted 4 lines · Paolo Bonzini
Il 28/03/2014 12:43, Don Slutz ha scritto:
Quoted 2 lines
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 ;)
Quoted 53 lines
Quoted 4 lines
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,
PeterQuoted 44 lines
Paolo
Quoted 40 lines · Don Slutz
Quoted 36 lines
The commit
88c1ee73d3231c74ff90bcfc084a7589670ec244char/serial: Fix emptyness checkStill 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 <[email protected]>Signed-off-by Don Slutz <[email protected]>---
Changes V2 to v3
Revert v2 changes
Fix coding style issues.
Changes v1 to v2
Do full state change onfifo8_is_empty.hw/char/serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)hw/char/serial.c +4
-2@@ -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 ; }
Peter Maydell
AppliedQuoted 7 lines · Peter Crosthwaite
Quoted 6 lines · Paolo Bonzini
Il 28/03/2014 12:43, Don Slutz ha scritto:
Quoted 2 lines
Ping. (Since this is a bug fix, I think it can go into 2.0)
-Don Slutz
Quoted 5 lines
Quoted 3 lines
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.
Applied to master, thanks.
-- PMM