diff mbox

[v2,1/2] milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write()

Message ID 1377969760-17489-2-git-send-email-antonynpavlov@gmail.com
State New
Headers show

Commit Message

Antony Pavlov Aug. 31, 2013, 5:22 p.m. UTC
qemu_chr_fe_write() is capable of returning 0
to indicate EAGAIN (and friends) and we don't
handle this.

Just change it to qemu_chr_fe_write_all() to fix.

Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
CC: Michael Walle <michael@walle.cc>
CC: Andreas Färber <afaerber@suse.de>
---
 hw/char/milkymist-uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Crosthwaite Sept. 1, 2013, 10:58 p.m. UTC | #1
On Sun, Sep 1, 2013 at 3:22 AM, Antony Pavlov <antonynpavlov@gmail.com> wrote:
> qemu_chr_fe_write() is capable of returning 0
> to indicate EAGAIN (and friends) and we don't
> handle this.
>
> Just change it to qemu_chr_fe_write_all() to fix.
>
> Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Acked-by Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> CC: Michael Walle <michael@walle.cc>
> CC: Andreas Färber <afaerber@suse.de>
> ---
>  hw/char/milkymist-uart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
> index 2e4b5c5..6e4bc20 100644
> --- a/hw/char/milkymist-uart.c
> +++ b/hw/char/milkymist-uart.c
> @@ -124,7 +124,7 @@ static void uart_write(void *opaque, hwaddr addr, uint64_t value,
>      switch (addr) {
>      case R_RXTX:
>          if (s->chr) {
> -            qemu_chr_fe_write(s->chr, &ch, 1);
> +            qemu_chr_fe_write_all(s->chr, &ch, 1);
>          }
>          s->regs[R_STAT] |= STAT_TX_EVT;
>          break;
> --
> 1.8.4.rc3
>
>
Michael Walle Sept. 2, 2013, 3:39 p.m. UTC | #2
Am Samstag, 31. August 2013, 19:22:39 schrieb Antony Pavlov:
> qemu_chr_fe_write() is capable of returning 0
> to indicate EAGAIN (and friends) and we don't
> handle this.
> 
> Just change it to qemu_chr_fe_write_all() to fix.
> 
> Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> CC: Michael Walle <michael@walle.cc>
> CC: Andreas Färber <afaerber@suse.de>
> ---
>  hw/char/milkymist-uart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
> index 2e4b5c5..6e4bc20 100644
> --- a/hw/char/milkymist-uart.c
> +++ b/hw/char/milkymist-uart.c
> @@ -124,7 +124,7 @@ static void uart_write(void *opaque, hwaddr addr,
> uint64_t value, switch (addr) {
>      case R_RXTX:
>          if (s->chr) {
> -            qemu_chr_fe_write(s->chr, &ch, 1);
> +            qemu_chr_fe_write_all(s->chr, &ch, 1);
>          }
>          s->regs[R_STAT] |= STAT_TX_EVT;
>          break;


Acked-by: Michael Walle <michael@walle.cc>
Michael Walle Sept. 17, 2013, 5:24 p.m. UTC | #3
Am Montag, 2. September 2013, 00:58:42 schrieb Peter Crosthwaite:
> On Sun, Sep 1, 2013 at 3:22 AM, Antony Pavlov <antonynpavlov@gmail.com> 
wrote:
> > qemu_chr_fe_write() is capable of returning 0
> > to indicate EAGAIN (and friends) and we don't
> > handle this.
> > 
> > Just change it to qemu_chr_fe_write_all() to fix.
> > 
> > Reported-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> Acked-by Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> > Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> > CC: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> > CC: Michael Walle <michael@walle.cc>
> > CC: Andreas Färber <afaerber@suse.de>
> > ---
> > 
> >  hw/char/milkymist-uart.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
> > index 2e4b5c5..6e4bc20 100644
> > --- a/hw/char/milkymist-uart.c
> > +++ b/hw/char/milkymist-uart.c
> > @@ -124,7 +124,7 @@ static void uart_write(void *opaque, hwaddr addr,
> > uint64_t value,
> > 
> >      switch (addr) {
> >      
> >      case R_RXTX:
> >          if (s->chr) {
> > 
> > -            qemu_chr_fe_write(s->chr, &ch, 1);
> > +            qemu_chr_fe_write_all(s->chr, &ch, 1);
> > 
> >          }
> >          s->regs[R_STAT] |= STAT_TX_EVT;
> >          break;
> > 
> > --
> > 1.8.4.rc3

I'll pick this one. Thank you.
diff mbox

Patch

diff --git a/hw/char/milkymist-uart.c b/hw/char/milkymist-uart.c
index 2e4b5c5..6e4bc20 100644
--- a/hw/char/milkymist-uart.c
+++ b/hw/char/milkymist-uart.c
@@ -124,7 +124,7 @@  static void uart_write(void *opaque, hwaddr addr, uint64_t value,
     switch (addr) {
     case R_RXTX:
         if (s->chr) {
-            qemu_chr_fe_write(s->chr, &ch, 1);
+            qemu_chr_fe_write_all(s->chr, &ch, 1);
         }
         s->regs[R_STAT] |= STAT_TX_EVT;
         break;