From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFovI-0006Fy-2K for qemu-devel@nongnu.org; Sat, 31 Aug 2013 13:25:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFovD-0006Xp-MV for qemu-devel@nongnu.org; Sat, 31 Aug 2013 13:25:20 -0400 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:35754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFovD-0006Xk-Ef for qemu-devel@nongnu.org; Sat, 31 Aug 2013 13:25:15 -0400 Received: by mail-lb0-f178.google.com with SMTP id z5so2847677lbh.9 for ; Sat, 31 Aug 2013 10:25:14 -0700 (PDT) From: Antony Pavlov Date: Sat, 31 Aug 2013 21:22:39 +0400 Message-Id: <1377969760-17489-2-git-send-email-antonynpavlov@gmail.com> In-Reply-To: <1377969760-17489-1-git-send-email-antonynpavlov@gmail.com> References: <1377969760-17489-1-git-send-email-antonynpavlov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 1/2] milkymist-uart: use qemu_chr_fe_write_all() instead of qemu_chr_fe_write() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , Michael Walle , Antony Pavlov , =?UTF-8?q?Andreas=20F=C3=A4rber?= 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 Signed-off-by: Antony Pavlov CC: Peter Crosthwaite CC: Michael Walle CC: Andreas Färber --- 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